diff -r 71dcdac53510 -r 90241d0c87b6 jaxws/make/Makefile --- a/jaxws/make/Makefile Thu Sep 17 13:46:52 2009 -0700 +++ b/jaxws/make/Makefile Mon Sep 21 13:57:02 2009 -0700 @@ -23,7 +23,7 @@ # have any questions. # -# Makefile for jaxws: wrapper around Ant build.xml file +# Makefile wrapper around Ant build.xml file # # On Solaris, the 'make' utility from Sun will not work with these makefiles. @@ -41,38 +41,12 @@ ANT_OPTIONS += -verbose endif -ifdef JDK_VERSION - ANT_OPTIONS += -Djdk.version=$(JDK_VERSION) -endif - -ifdef FULL_VERSION - ANT_OPTIONS += -Dfull.version='$(FULL_VERSION)' # will contain spaces -endif - -ifdef MILESTONE - ANT_OPTIONS += -Dmilestone=$(MILESTONE) -endif - -ifdef BUILD_NUMBER - ANT_OPTIONS += -Dbuild.number=$(BUILD_NUMBER) -else - ifdef JDK_BUILD_NUMBER - ANT_OPTIONS += -Dbuild.number=$(JDK_BUILD_NUMBER) - endif -endif - -ifeq ($(VARIANT), DBG) - ANT_OPTIONS += -Djavac.debug=true -else - ifeq ($(VARIANT), OPT) +ifeq ($(VARIANT), OPT) + ifneq ($(DEBUG_CLASSFILES), true) ANT_OPTIONS += -Djavac.debug=false endif endif -ifeq ($(DEBUG_CLASSFILES), true) - ANT_OPTIONS += -Djavac.debug=true -endif - # Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN) # and the somewhat misnamed CLASS_VERSION (-target NN) ifdef TARGET_CLASS_VERSION @@ -91,24 +65,53 @@ endif endif -ifdef ALT_BOOTDIR - ANT_JAVA_HOME = JAVA_HOME=$(ALT_BOOTDIR) +# Figure out the platform we are using +_SYSTEM_UNAME := $(shell uname) +_PLATFORM_KIND = unix +ifeq ($(_SYSTEM_UNAME), Windows_NT) + _PLATFORM_KIND = windows +endif +ifneq (,$(findstring CYGWIN,$(_SYSTEM_UNAME))) + _PLATFORM_KIND = windows endif +# Where is /java in case we need it +ifdef ALT_SLASH_JAVA + _SLASHJAVA = $(ALT_SLASH_JAVA) +else + ifeq ($(_PLATFORM_KIND), windows) + _SLASHJAVA=J:/ + else + _SLASHJAVA=/java + endif +endif + +# Where is /java/devtools in case we need it +ifdef ALT_JDK_DEVTOOLS_DIR + _DEVTOOLS = $(ALT_JDK_DEVTOOLS_DIR) +else + _DEVTOOLS = $(_SLASHJAVA)/devtools +endif + +# Add in path to devtools +ANT_OPTIONS += -Ddevtools=$(_DEVTOOLS) + ifdef ALT_OUTPUTDIR OUTPUTDIR = $(ALT_OUTPUTDIR) - ANT_OPTIONS += -Dbuild.dir=$(ALT_OUTPUTDIR)/build - ANT_OPTIONS += -Ddist.dir=$(ALT_OUTPUTDIR)/dist + ANT_OPTIONS += -Doutput.dir=$(ALT_OUTPUTDIR) else OUTPUTDIR = .. endif ifdef ALT_LANGTOOLS_DIST + ifdef ALT_BOOTDIR + ANT_JAVA_HOME = JAVA_HOME=$(ALT_BOOTDIR) + endif ANT_OPTIONS += -Dbootstrap.dir=$(ALT_LANGTOOLS_DIST)/bootstrap -endif - -ifdef FINDBUGS_HOME - ANT_OPTIONS += -Dfindbugs.home=$(FINDBUGS_HOME) +else + ifdef ALT_JDK_IMPORT_PATH + ANT_JAVA_HOME = JAVA_HOME=$(ALT_JDK_IMPORT_PATH) + endif endif ifdef ANT_HOME @@ -124,18 +127,59 @@ endif # Default target and expected 'do everything' target -all: build - -# Standard make clobber target -clobber: clean +default: all # All ant targets of interest -ANT_TARGETS = build clean sanity # for now +ANT_TARGETS = all source build dist clobber clean sanity # Create a make target for each $(ANT_TARGETS): - $(ANT_JAVA_HOME) $(ANT) -version - $(ANT_JAVA_HOME) $(ANT) $(ANT_OPTIONS) $@ + cd .. && $(ANT_JAVA_HOME) $(ANT) -version + cd .. && $(ANT_JAVA_HOME) $(ANT) $(ANT_OPTIONS) $@ + +# Help target +define helpenvline +@echo " $1";echo " $2" +endef +help: + @echo "----------------------------------------------------------" + @echo " " + @echo "Help information for this Makefile:" + @echo " " + @echo " Targets (see ant project information for descriptions):" + @echo " $(ANT_TARGETS)" + @echo " " + @echo " Environment or command line variables (all optional):" + $(call helpenvline, ALT_BOOTDIR,\ + "JAVA_HOME to use when running ant") + $(call helpenvline, ALT_LANGTOOLS_DIST,\ + "path to langtools repository dist directory") + $(call helpenvline, ALT_OUTPUTDIR,\ + "path to root of output") + $(call helpenvline, DEBUG_CLASSFILES,\ + "if set makes sure ant property javac.debug is true") + $(call helpenvline, JAVAC_SOURCE_ARG,\ + "if SOURCE_LANGUAGE_VERSION not set uses this to set ant property javac.source") + $(call helpenvline, JAVAC_TARGET_ARG,\ + "if TARGET_CLASS_VERSION not set uses this to set ant property javac.target") + $(call helpenvline, SOURCE_LANGUAGE_VERSION,\ + "if set uses this to set ant property javac.source") + $(call helpenvline, QUIET,\ + "if set will pass -quiet to ant") + $(call helpenvline, TARGET_CLASS_VERSION,\ + "JAVA_HOME to use when running ant") + $(call helpenvline, VARIANT,\ + "if set to OPT means optimized build will set javac.debug to false") + $(call helpenvline, VERBOSE,\ + "if set will pass -verbose to ant") + @echo " " + @echo "----------------------------------------------------------" + @echo " " + @echo "Ant project file help information:" + @echo " " + @$(ANT_JAVA_HOME) cd .. && $(ANT) $(ANT_OPTIONS) -p + @echo " " + @echo "----------------------------------------------------------" # Targets for Sun's internal JPRT build system JPRT_ARCHIVE_BUNDLE=$(OUTPUTDIR)/jprt.zip @@ -145,5 +189,5 @@ zip -q -r $(JPRT_ARCHIVE_BUNDLE) . ) # Declare these phony (not filenames) -.PHONY: $(ANT_TARGETS) all clobber \ +.PHONY: $(ANT_TARGETS) \ jprt_build_product jprt_build_debug jprt_build_fastdebug