diff -r 8a3fe0ae06a8 -r e64f2cb57d05 NewMakefile.gmk --- a/NewMakefile.gmk Wed Oct 24 13:11:42 2012 -0700 +++ b/NewMakefile.gmk Fri Oct 26 14:29:57 2012 -0700 @@ -31,8 +31,9 @@ CP=cp ECHO=echo MKDIR=mkdir +PRINTF=printf PWD=pwd -SH=sh +TAR=tar ifeq ($(PLATFORM),windows) ZIP=zip else @@ -63,10 +64,48 @@ $(ECHO) "ERROR: No configurations to build"; exit 1; \ fi @for bdir in $(dir $(ALL_MAKEFILES)) ; do \ - $(ECHO) "$(CD) $${bdir} && $(MAKE) $(EXTRA_MAKE_ARGS) $@" ; \ - $(CD) $${bdir} && $(MAKE) $(EXTRA_MAKE_ARGS) $@ ; \ + $(ECHO) "$(CD) $${bdir} && $(MAKE) $@" ; \ + $(CD) $${bdir} && $(MAKE) $@ ; \ done +# TBD: Deploy input +$(BUILD_DIR_ROOT)/.deploy_input: + @if [ "$(ALL_MAKEFILES)" = "" ] ; then \ + $(ECHO) "ERROR: No configurations to build"; exit 1; \ + fi + @for bdir in $(dir $(ALL_MAKEFILES)) ; do \ + if [ deploy/make/Makefile ] ; then \ + echo "Attempting deploy build." ; \ + ( \ + $(RM) -r $${bdir}/deploy_input ; \ + $(MKDIR) -p $${bdir}/deploy_input ; \ + ( $(CD) $${bdir}/images && $(TAR) -cf - j2sdk-image j2re-image ) \ + | ( $(CD) $${bdir}/deploy_input && $(TAR) -xf - ) ; \ + ) ; \ + fi; \ + done + touch $@ + +# TBD: Deploy images +deploy: $(BUILD_DIR_ROOT)/.deploy_input + @if [ "$(ALL_MAKEFILES)" = "" ] ; then \ + $(ECHO) "ERROR: No configurations to build"; exit 1; \ + fi + @for bdir in $(dir $(ALL_MAKEFILES)) ; do \ + if [ deploy/make/Makefile ] ; then \ + echo "Attempting deploy build." ; \ + ( \ + $(CD) deploy/make && \ + $(MAKE) \ + ABS_OUTPUTDIR=$${bdir}/deploy_input \ + OUTPUTDIR=$${bdir}/deploy_input \ + ) ; \ + fi; \ + done + +# TBD: Install bundles +install: + # Bundle creation bundles: @if [ "$(ALL_IMAGE_DIRS)" = "" ] ; then \ @@ -91,8 +130,8 @@ checks: @$(ECHO) "No checks yet" -# Keep track of phony targets -PHONY_LIST += all images clean clobber checks +# Keep track of user targets +USER_TARGETS += all deploy install images clean clobber checks ########################################################################### # To help in adoption of the new configure&&make build process, a bridge @@ -102,32 +141,18 @@ bridgeBuild: bridge2configure images # Bridge from old Makefile ALT settings to configure options -bridge2configure: .bridge2configureOpts - $(CD) common/makefiles && sh ../autoconf/configure $(strip $(shell $(CAT) $<)) +bridge2configure: $(BUILD_DIR_ROOT)/.bridge2configureOpts + bash ./configure $(strip $(shell $(CAT) $<)) # Create a file with configure options created from old Makefile mechanisms. -.bridge2configureOpts: .bridge2configureOptsLatest +$(BUILD_DIR_ROOT)/.bridge2configureOpts: $(BUILD_DIR_ROOT)/.bridge2configureOptsLatest $(RM) $@ $(CP) $< $@ -# In case make was invoked from a specific path -_MAKE_COMMAND_PATH:=$(firstword $(MAKE)) -ifneq ($(dir $(_MAKE_COMMAND_PATH)),./) - # This could be removed someday if JPRT was fixed and we could assume that - # the path to make was always in PATH. - MAKE_BINDIR:=$(call UnixPath,$(dir $(_MAKE_COMMAND_PATH))) - NEWPATH:=$(MAKE_BINDIR):${PATH} - PATH:=$(NEWPATH) - export PATH - MAKE_COMMAND=$(MAKE_BINDIR)/$(notdir $(_MAKE_COMMAND_PATH)) -else - MAKE_COMMAND=$(_MAKE_COMMAND_PATH) -endif - # Use this file to only change when obvious things have changed -.bridge2configureOptsLatest: FRC +$(BUILD_DIR_ROOT)/.bridge2configureOptsLatest: FRC $(RM) $@.tmp - @$(ECHO) " MAKE=$(MAKE_COMMAND) " >> $@.tmp + $(MKDIR) -p $(BUILD_DIR_ROOT) @$(ECHO) " --with-debug-level=$(if $(DEBUG_LEVEL),$(DEBUG_LEVEL),release) " >> $@.tmp ifdef ARCH_DATA_MODEL @$(ECHO) " --with-target-bits=$(ARCH_DATA_MODEL) " >> $@.tmp @@ -156,20 +181,30 @@ # Clobber all the built files clobber:: bridge2clobber bridge2clobber:: - $(RM) .bridge2* + $(RM) $(BUILD_DIR_ROOT)/.bridge2* + $(RM) $(BUILD_DIR_ROOT)/.deploy_input # Keep track of phony targets PHONY_LIST += bridge2configure bridgeBuild bridge2clobber ########################################################################### +# Sanity checks (history target) +# + +sanity: checks + +# Keep track of user targets +USER_TARGETS += sanity + +########################################################################### # Javadocs # javadocs: cd common/makefiles && $(MAKE) -f MakefileJavadoc.gmk -# Keep track of phony targets -PHONY_LIST += javadocs +# Keep track of user targets +USER_TARGETS += javadocs ########################################################################### # JPRT targets @@ -190,7 +225,6 @@ jprt_build_debug: BUILD_DIRNAME=*-debug jprt_build_debug: jprt_build_generic -jprt_build_generic: EXTRA_MAKE_ARGS=LOG=nofile,info jprt_build_generic: $(JPRT_ARCHIVE_BUNDLE) $(JPRT_ARCHIVE_BUNDLE): bridgeBuild bundles @@ -203,9 +237,59 @@ jprt_build_generic ########################################################################### +# Help target + +HELP_FORMAT=%12s%s\n + +help: + @$(PRINTF) "# JDK Makefile\n" + @$(PRINTF) "#\n" + @$(PRINTF) "# Usage: make [Target]\n" + @$(PRINTF) "#\n" + @$(PRINTF) "# $(HELP_FORMAT)" "Target " "Description" + @$(PRINTF) "# $(HELP_FORMAT)" "------ " "-----------" + @for i in $(USER_TARGETS) ; do \ + $(MAKE) help_$${i} ; \ + done + @$(PRINTF) "#\n" + +help_all: + @$(PRINTF) "# $(HELP_FORMAT)" "$(subst help_,,$@) - " \ + "Build the entire jdk but not the images" +help_images: + @$(PRINTF) "# $(HELP_FORMAT)" "$(subst help_,,$@) - " \ + "Create the jdk images for the builds" +help_deploy: + @$(PRINTF) "# $(HELP_FORMAT)" "$(subst help_,,$@) - " \ + "Create the jdk deploy images from the jdk images" +help_install: + @$(PRINTF) "# $(HELP_FORMAT)" "$(subst help_,,$@) - " \ + "Create the jdk install bundles from the deploy images" +help_clean: + @$(PRINTF) "# $(HELP_FORMAT)" "$(subst help_,,$@) - " \ + "Clean and prepare for a fresh build from scratch" +help_clobber: + @$(PRINTF) "# $(HELP_FORMAT)" "$(subst help_,,$@) - " \ + "Clean and also purge any hidden derived data" +help_checks: + @$(PRINTF) "# $(HELP_FORMAT)" "$(subst help_,,$@) - " \ + "Perform various checks to make sure we can build" +help_sanity: + @$(PRINTF) "# $(HELP_FORMAT)" "$(subst help_,,$@) - " \ + "Same as 'make checks'" +help_javadocs: + @$(PRINTF) "# $(HELP_FORMAT)" "$(subst help_,,$@) - " \ + "Build the javadocs" +help_help: + @$(PRINTF) "# $(HELP_FORMAT)" "$(subst help_,,$@) - " \ + "Print out the help messages" + +# Keep track of user targets +USER_TARGETS += help + +########################################################################### # Phony targets -.PHONY: $(PHONY_LIST) +.PHONY: $(PHONY_LIST) $(USER_TARGETS) # Force target FRC: -