8141261: Clean up building of demos

Reviewed-by: erikj, tbell
This commit is contained in:
Magnus Ihse Bursie 2015-11-03 17:48:01 +01:00
parent 62017e75bc
commit 99948f872a
4 changed files with 20 additions and 7 deletions

View File

@ -435,7 +435,7 @@ JDK_TARGETS += $(JDK_IMAGE_DIR)/src.zip
# 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 @@ ifneq ($(findstring images, $(MAKECMDGOALS)), )
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)

View File

@ -560,6 +560,8 @@ ALL_TARGETS += default jdk images docs all
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: $(CLEAN_DIR_TARGETS)
$(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 @@ dist-clean: clean
)
$(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

View File

@ -46,6 +46,13 @@ define CleanDir
@$(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)

View File

@ -686,7 +686,7 @@ define SetupJavaCompilationBody
# 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), \