8141261: Clean up building of demos
authorihse
Tue, 03 Nov 2015 17:48:01 +0100
changeset 33437 1cf150337073
parent 33436 c6d79360ecff
child 33438 35cd6a1619df
8141261: Clean up building of demos Reviewed-by: erikj, tbell
make/Images.gmk
make/Main.gmk
make/MainSupport.gmk
make/common/JavaCompilation.gmk
--- a/make/Images.gmk	Tue Nov 03 16:51:55 2015 +0100
+++ b/make/Images.gmk	Tue Nov 03 17:48:01 2015 +0100
@@ -435,7 +435,7 @@
 # directories will always trigger the rule for recompile since
 # _the.list_of_packages files are touched.
 ifneq ($(findstring images, $(MAKECMDGOALS)), )
-  $(JDK_IMAGE_DIR)/demo/%: $(SUPPORT_OUTPUTDIR)/demo/image/%
+  $(JDK_IMAGE_DIR)/demo/%: $(SUPPORT_OUTPUTDIR)/demos/image/%
 	if [ ! -d "$@" ]; then \
 	  $(ECHO) $(LOG_INFO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'; \
 	  $(MKDIR) -p $(@D); \
@@ -443,9 +443,9 @@
 	fi
 
   # Find all files including directories
-  JDK_DEMO_TARGETS := $(if $(wildcard $(SUPPORT_OUTPUTDIR)/demo/image), \
-      $(patsubst $(SUPPORT_OUTPUTDIR)/demo/image/%, $(JDK_IMAGE_DIR)/demo/%, \
-      $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/demo/image \
+  JDK_DEMO_TARGETS := $(if $(wildcard $(SUPPORT_OUTPUTDIR)/demos/image), \
+      $(patsubst $(SUPPORT_OUTPUTDIR)/demos/image/%, $(JDK_IMAGE_DIR)/demo/%, \
+      $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/demos/image \
           ! \( -name "_the*" -o -name "javac_state" \) )))
 
   JDK_TARGETS += $(JDK_DEMO_TARGETS)
--- a/make/Main.gmk	Tue Nov 03 16:51:55 2015 +0100
+++ b/make/Main.gmk	Tue Nov 03 17:48:01 2015 +0100
@@ -560,6 +560,8 @@
 CLEAN_DIRS += hotspot jdk bootcycle-build test buildtools support \
     images make-support test-make bundles
 CLEAN_DIR_TARGETS := $(addprefix clean-, $(CLEAN_DIRS))
+CLEAN_SUPPORT_DIRS += demos
+CLEAN_SUPPORT_DIR_TARGETS := $(addprefix clean-, $(CLEAN_SUPPORT_DIRS))
 CLEAN_TESTS += hotspot-jtreg-native jdk-jtreg-native lib
 CLEAN_TEST_TARGETS += $(addprefix clean-test-, $(CLEAN_TESTS))
 CLEAN_PHASES := gensrc java native include docs
@@ -577,6 +579,9 @@
 $(CLEAN_DIR_TARGETS):
 	$(call CleanDir,$(patsubst clean-%, %, $@))
 
+$(CLEAN_SUPPORT_DIR_TARGETS):
+	$(call CleanSupportDir,$(patsubst clean-%, %, $@))
+
 $(CLEAN_TEST_TARGETS):
 	$(call CleanTest,$(patsubst clean-test-%, %, $@))
 
@@ -610,8 +615,9 @@
 	)
 	$(ECHO) Cleaned everything, you will have to re-run configure.
 
-ALL_TARGETS += clean dist-clean $(CLEAN_DIR_TARGETS) $(CLEAN_TEST_TARGETS) \
-    $(CLEAN_PHASE_TARGETS) $(CLEAN_MODULE_TARGETS) $(CLEAN_MODULE_PHASE_TARGETS)
+ALL_TARGETS += clean dist-clean $(CLEAN_DIR_TARGETS) $(CLEAN_SUPPORT_DIR_TARGETS) \
+    $(CLEAN_TEST_TARGETS) $(CLEAN_PHASE_TARGETS) $(CLEAN_MODULE_TARGETS) \
+    $(CLEAN_MODULE_PHASE_TARGETS)
 
 ################################################################################
 # Declare *-only targets for each normal target
--- a/make/MainSupport.gmk	Tue Nov 03 16:51:55 2015 +0100
+++ b/make/MainSupport.gmk	Tue Nov 03 17:48:01 2015 +0100
@@ -46,6 +46,13 @@
 	@$(PRINTF) " done\n"
 endef
 
+define CleanSupportDir
+	@$(PRINTF) "Cleaning $(strip $1) build artifacts ..."
+	@$(PRINTF) "\n" $(LOG_DEBUG)
+	$(RM) -r $(SUPPORT_OUTPUTDIR)/$(strip $1)
+	@$(PRINTF) " done\n"
+endef
+
 define CleanTest
 	@$(PRINTF) "Cleaning test $(strip $1) ..."
 	@$(PRINTF) "\n" $(LOG_DEBUG)
--- a/make/common/JavaCompilation.gmk	Tue Nov 03 16:51:55 2015 +0100
+++ b/make/common/JavaCompilation.gmk	Tue Nov 03 17:48:01 2015 +0100
@@ -686,7 +686,7 @@
 
   # Check if a srczip was specified, then setup the rules for the srczip.
   ifneq (,$$($1_SRCZIP))
-    $$(eval $$(call SetupZipArchive,ARCHIVE_$1, \
+    $$(eval $$(call SetupZipArchive, ZIP_ARCHIVE_$1, \
         SRC:=$$($1_SRC), \
         ZIP:=$$($1_SRCZIP), \
         INCLUDES:=$$($1_INCLUDES), \