8219971: Introduce SetupExecute in build system

Reviewed-by: erikj
This commit is contained in:
Magnus Ihse Bursie 2019-03-05 11:07:19 +01:00
parent b0d139de19
commit d9153b8e3c
15 changed files with 403 additions and 169 deletions

View File

@ -1,4 +1,4 @@
# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -26,6 +26,7 @@ default: all
include $(SPEC) include $(SPEC)
include MakeBase.gmk include MakeBase.gmk
include Execute.gmk
include Modules.gmk include Modules.gmk
ifeq ($(MODULE), ) ifeq ($(MODULE), )
@ -37,7 +38,8 @@ $(eval $(call IncludeCustomExtension, CreateJmods.gmk))
################################################################################ ################################################################################
JMODS_DIR := $(IMAGES_OUTPUTDIR)/jmods JMODS_DIR := $(IMAGES_OUTPUTDIR)/jmods
JMODS_TEMPDIR := $(SUPPORT_OUTPUTDIR)/jmods JMODS_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jmods
JMOD_FILE := $(MODULE).jmod
LIBS_DIR ?= $(firstword $(wildcard $(addsuffix /$(MODULE), \ LIBS_DIR ?= $(firstword $(wildcard $(addsuffix /$(MODULE), \
$(SUPPORT_OUTPUTDIR)/modules_libs $(IMPORT_MODULES_LIBS)))) $(SUPPORT_OUTPUTDIR)/modules_libs $(IMPORT_MODULES_LIBS))))
@ -152,26 +154,27 @@ endif
# to avoid false incremental rebuilds. # to avoid false incremental rebuilds.
ifeq ($(INTERIM_JMOD), true) ifeq ($(INTERIM_JMOD), true)
DEPS := $(filter-out $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/classlist, $(DEPS)) DEPS := $(filter-out $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/classlist, $(DEPS))
INTERIM_MSG := interim$(SPACE)
endif endif
JMOD_FLAGS += --exclude '**{_the.*,_*.marker,*.diz,*.debuginfo,*.dSYM/**,*.dSYM,*.pdb,*.map}' JMOD_FLAGS += --exclude '**{_the.*,_*.marker,*.diz,*.debuginfo,*.dSYM/**,*.dSYM,*.pdb,*.map}'
# Create jmods in a temp dir and then move them into place to keep the # Create jmods in the support dir and then move them into place to keep the
# module path in $(IMAGES_OUTPUTDIR)/jmods valid at all times. # module path in $(IMAGES_OUTPUTDIR)/jmods valid at all times.
$(JMODS_DIR)/$(MODULE).jmod: $(DEPS) $(eval $(call SetupExecute, create_$(JMOD_FILE), \
$(call LogWarn, Creating $(patsubst $(OUTPUTDIR)/%, %, $@)) WARN := Creating $(INTERIM_MSG)$(JMOD_FILE), \
$(call MakeDir, $(JMODS_DIR) $(JMODS_TEMPDIR)) DEPS := $(DEPS), \
$(RM) $@ $(JMODS_TEMPDIR)/$(notdir $@) OUTPUT_FILE := $(JMODS_DIR)/$(JMOD_FILE), \
$(call ExecuteWithLog, $(SUPPORT_OUTPUTDIR)/jmods/$(MODULE).jmod, \ SUPPORT_DIR := $(JMODS_SUPPORT_DIR), \
$(JMOD) create \ PRE_COMMAND := $(RM) $(JMODS_DIR)/$(JMOD_FILE) $(JMODS_SUPPORT_DIR)/$(JMOD_FILE), \
--module-version $(VERSION_SHORT) \ COMMAND := $(JMOD) create --module-version $(VERSION_SHORT) \
--target-platform '$(OPENJDK_MODULE_TARGET_PLATFORM)' \ --target-platform '$(OPENJDK_MODULE_TARGET_PLATFORM)' \
--module-path $(JMODS_DIR) \ --module-path $(JMODS_DIR) $(JMOD_FLAGS) \
$(JMOD_FLAGS) $(JMODS_TEMPDIR)/$(notdir $@) \ $(JMODS_SUPPORT_DIR)/$(JMOD_FILE), \
) POST_COMMAND := $(MV) $(JMODS_SUPPORT_DIR)/$(JMOD_FILE) $(JMODS_DIR)/$(JMOD_FILE), \
$(MV) $(JMODS_TEMPDIR)/$(notdir $@) $@ ))
TARGETS += $(JMODS_DIR)/$(MODULE).jmod TARGETS += $(create_$(JMOD_FILE))
################################################################################ ################################################################################

View File

@ -1,4 +1,4 @@
# Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -26,6 +26,7 @@ default: all
include $(SPEC) include $(SPEC)
include MakeBase.gmk include MakeBase.gmk
include Execute.gmk
include Modules.gmk include Modules.gmk
include ModuleTools.gmk include ModuleTools.gmk
include ProcessMarkdown.gmk include ProcessMarkdown.gmk
@ -195,10 +196,13 @@ define setup_gengraph_dot_to_png
# For each module needing a graph, create a png file from the dot file # For each module needing a graph, create a png file from the dot file
# generated by the GenGraphs tool and store it in the target dir. # generated by the GenGraphs tool and store it in the target dir.
$$($1_$2_PNG_TARGET): $$($1_GENGRAPHS_MARKER) $$(eval $$(call SetupExecute, gengraphs_png_$1_$2, \
$$(call MakeDir, $$(@D)) INFO := Running dot for module graphs for $2, \
$$(call ExecuteWithLog, $$($1_$2_DOT_SRC), \ DEPS := $$(gengraphs_$1_TARGET), \
$$(DOT) -Tpng -o $$($1_$2_PNG_TARGET) $$($1_$2_DOT_SRC)) OUTPUT_FILE := $$($1_$2_PNG_TARGET), \
SUPPORT_DIR := $$($1_GENGRAPHS_DIR), \
COMMAND := $$(DOT) -Tpng -o $$($1_$2_PNG_TARGET) $$($1_$2_DOT_SRC), \
))
$1_MODULEGRAPH_TARGETS += $$($1_$2_PNG_TARGET) $1_MODULEGRAPH_TARGETS += $$($1_$2_PNG_TARGET)
endef endef
@ -336,18 +340,18 @@ define SetupApiDocsGenerationBody
$1_SOURCE_DEPS := $$(call CacheFind, $$(wildcard $$(foreach module, \ $1_SOURCE_DEPS := $$(call CacheFind, $$(wildcard $$(foreach module, \
$$($1_ALL_MODULES), $$(call FindModuleSrcDirs, $$(module))))) $$($1_ALL_MODULES), $$(call FindModuleSrcDirs, $$(module)))))
# Javadoc creates a lot of files but use index.html as a marker $$(eval $$(call SetupExecute, javadoc_$1, \
$$($1_TARGET_DIR)/index.html: $$(BUILD_TOOLS_JDK) $$($1_VARDEPS_FILE) \ WARN := Generating $1 javadoc for $$(words $$($1_ALL_MODULES)) modules, \
$$($1_SOURCE_DEPS) $$($1_OVERVIEW) INFO := Javadoc modules: $$($1_ALL_MODULES), \
$$(call LogWarn, Generating $1 javadoc for \ DEPS := $$(BUILD_TOOLS_JDK) $$($1_VARDEPS_FILE) $$($1_SOURCE_DEPS) \
$$(words $$($1_ALL_MODULES)) modules) $$($1_OVERVIEW), \
$$(call LogInfo, Javadoc modules: $$($1_ALL_MODULES)) OUTPUT_DIR := $$($1_TARGET_DIR), \
$$(call MakeDir, $$($1_TARGET_DIR)) SUPPORT_DIR := $$(SUPPORT_OUTPUTDIR)/docs, \
$$(call ExecuteWithLog, $$(SUPPORT_OUTPUTDIR)/docs/$1, \ COMMAND := $$($1_JAVADOC_CMD) -d $$($1_TARGET_DIR) $$($1_OPTIONS) \
$$($1_JAVADOC_CMD) -d $$($1_TARGET_DIR) \ $$($1_LOG_OPTION), \
$$($1_OPTIONS) $$($1_LOG_OPTION)) ))
$1_JAVADOC_TARGETS := $$($1_TARGET_DIR)/index.html $1_JAVADOC_TARGETS := $$(javadoc_$1_TARGET)
ifeq ($$(ENABLE_FULL_DOCS), true) ifeq ($$(ENABLE_FULL_DOCS), true)
# We have asked ModuleGraph to generate links to png files. Now we must # We have asked ModuleGraph to generate links to png files. Now we must
@ -367,19 +371,18 @@ define SetupApiDocsGenerationBody
$$(TOPDIR)/make/jdk/src/classes/build/tools/jigsaw/javadoc-graphs.properties $$(TOPDIR)/make/jdk/src/classes/build/tools/jigsaw/javadoc-graphs.properties
$1_GENGRAPHS_DIR := $$(SUPPORT_OUTPUTDIR)/docs/$1-gengraphs $1_GENGRAPHS_DIR := $$(SUPPORT_OUTPUTDIR)/docs/$1-gengraphs
$1_GENGRAPHS_MARKER := $$($1_GENGRAPHS_DIR)/_gengraphs_run.marker
$$($1_GENGRAPHS_MARKER): $$(BUILD_JIGSAW_TOOLS) $$(GENGRAPHS_PROPS) $$(eval $$(call SetupExecute, gengraphs_$1, \
$$(call LogInfo, Running gengraphs for $1 documentation) INFO := Running gengraphs for $1 documentation, \
$$(call MakeDir, $$($1_GENGRAPHS_DIR)) DEPS := $$(BUILD_JIGSAW_TOOLS) $$(GENGRAPHS_PROPS), \
$$(call ExecuteWithLog, $$($1_GENGRAPHS_DIR)/gengraphs, \ OUTPUT_DIR := $$($1_GENGRAPHS_DIR), \
$$(TOOL_GENGRAPHS) --spec --output $$($1_GENGRAPHS_DIR) \ COMMAND := $$(TOOL_GENGRAPHS) --spec --output $$($1_GENGRAPHS_DIR) \
--dot-attributes $$(GENGRAPHS_PROPS) && \ --dot-attributes $$(GENGRAPHS_PROPS), \
$$(TOUCH) $$($1_GENGRAPHS_MARKER)) ))
# For each module needing a graph, create a png file from the dot file # For each module needing a graph, create a png file from the dot file
# generated by the GenGraphs tool and store it in the target dir. # generated by the GenGraphs tool and store it in the target dir.
# They will depend on $1_GENGRAPHS_MARKER, and will be added to $1. # They will depend on gengraphs_$1_TARGET, and will be added to $1.
$$(foreach m, $$($1_MODULES_NEEDING_GRAPH), \ $$(foreach m, $$($1_MODULES_NEEDING_GRAPH), \
$$(eval $$(call setup_gengraph_dot_to_png,$1,$$m)) \ $$(eval $$(call setup_gengraph_dot_to_png,$1,$$m)) \
) )

View File

@ -29,19 +29,21 @@ default: all
include $(SPEC) include $(SPEC)
include MakeBase.gmk include MakeBase.gmk
include Execute.gmk
include $(TOPDIR)/make/ModuleTools.gmk include $(TOPDIR)/make/ModuleTools.gmk
################################################################################ ################################################################################
PACKAGES_ATTRIBUTE_TARGET := $(JDK_OUTPUTDIR)/_packages_attribute.done
ALL_MODULEINFO_CLASSES := $(wildcard $(JDK_OUTPUTDIR)/modules/*/module-info.class) ALL_MODULEINFO_CLASSES := $(wildcard $(JDK_OUTPUTDIR)/modules/*/module-info.class)
$(PACKAGES_ATTRIBUTE_TARGET): $(ALL_MODULEINFO_CLASSES) $(BUILD_JIGSAW_CLASSES) $(eval $(call SetupExecute, optimize_image, \
$(call LogInfo, Optimizing the exploded image) INFO := Optimizing the exploded image, \
$(call ExecuteWithLog, $@, $(TOOL_ADD_PACKAGES_ATTRIBUTE) $(JDK_OUTPUTDIR)) DEPS := $(ALL_MODULEINFO_CLASSES) $(BUILD_JIGSAW_CLASSES), \
$(TOUCH) $@ OUTPUT_DIR := $(JDK_OUTPUTDIR), \
COMMAND := $(TOOL_ADD_PACKAGES_ATTRIBUTE) $(JDK_OUTPUTDIR), \
))
TARGETS := $(PACKAGES_ATTRIBUTE_TARGET) TARGETS := $(optimize_image_TARGET)
################################################################################ ################################################################################

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -27,9 +27,9 @@ default: all
include $(SPEC) include $(SPEC)
include MakeBase.gmk include MakeBase.gmk
include Execute.gmk
include Modules.gmk include Modules.gmk
TOOL_TARGETS :=
JDK_TARGETS := JDK_TARGETS :=
JRE_TARGETS := JRE_TARGETS :=
@ -56,9 +56,6 @@ BASE_RELEASE_FILE := $(JDK_OUTPUTDIR)/release
JMODS := $(wildcard $(IMAGES_OUTPUTDIR)/jmods/*.jmod) JMODS := $(wildcard $(IMAGES_OUTPUTDIR)/jmods/*.jmod)
# Use this file inside the image as target for make rule
JIMAGE_TARGET_FILE := release
JLINK_ORDER_RESOURCES := **module-info.class JLINK_ORDER_RESOURCES := **module-info.class
JLINK_JLI_CLASSES := JLINK_JLI_CLASSES :=
ifeq ($(ENABLE_GENERATE_CLASSLIST), true) ifeq ($(ENABLE_GENERATE_CLASSLIST), true)
@ -88,40 +85,57 @@ ifeq ($(JLINK_KEEP_PACKAGED_MODULES), true)
JLINK_JDK_EXTRA_OPTS := --keep-packaged-modules $(JDK_IMAGE_DIR)/jmods JLINK_JDK_EXTRA_OPTS := --keep-packaged-modules $(JDK_IMAGE_DIR)/jmods
endif endif
$(JDK_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(JMODS) \ $(eval $(call SetupExecute, jlink_jdk, \
$(call DependOnVariable, JDK_MODULES_LIST) $(BASE_RELEASE_FILE) WARN := Creating jdk image, \
$(call LogWarn, Creating jdk image) DEPS := $(JMODS) $(BASE_RELEASE_FILE) \
$(RM) -r $(JDK_IMAGE_DIR) $(call DependOnVariable, JDK_MODULES_LIST), \
$(call ExecuteWithLog, $(SUPPORT_OUTPUTDIR)/images/jdk, \ OUTPUT_DIR := $(JDK_IMAGE_DIR), \
$(JLINK_TOOL) --add-modules $(JDK_MODULES_LIST) \ SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jdk, \
$(JLINK_JDK_EXTRA_OPTS) \ PRE_COMMAND := $(RM) -r $(JDK_IMAGE_DIR), \
--output $(JDK_IMAGE_DIR) \ COMMAND := $(JLINK_TOOL) --add-modules $(JDK_MODULES_LIST) \
) $(JLINK_JDK_EXTRA_OPTS) --output $(JDK_IMAGE_DIR), \
ifeq ($(BUILD_CDS_ARCHIVE), true) ))
$(call LogWarn, Creating CDS archive for jdk image)
$(FIXPATH) $(JDK_IMAGE_DIR)/bin/java \
-Xshare:dump -Xmx128M -Xms128M $(LOG_INFO)
endif
$(TOUCH) $@
$(JRE_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(JMODS) \ JLINK_JDK_TARGETS := $(jlink_jdk)
$(call DependOnVariable, JRE_MODULES_LIST) $(BASE_RELEASE_FILE)
$(call LogWarn, Creating legacy jre image)
$(RM) -r $(JRE_IMAGE_DIR)
$(call ExecuteWithLog, $(SUPPORT_OUTPUTDIR)/images/jre, \
$(JLINK_TOOL) --add-modules $(JRE_MODULES_LIST) \
$(JLINK_JRE_EXTRA_OPTS) \
--output $(JRE_IMAGE_DIR) \
)
ifeq ($(BUILD_CDS_ARCHIVE), true)
$(call LogWarn, Creating CDS archive for jre image)
$(FIXPATH) $(JRE_IMAGE_DIR)/bin/java \
-Xshare:dump -Xmx128M -Xms128M $(LOG_INFO)
endif
$(TOUCH) $@
TOOL_JRE_TARGETS := $(JRE_IMAGE_DIR)/$(JIMAGE_TARGET_FILE) $(eval $(call SetupExecute, jlink_jre, \
TOOL_JDK_TARGETS := $(JDK_IMAGE_DIR)/$(JIMAGE_TARGET_FILE) WARN := Creating legacy jre image, \
DEPS := $(JMODS) $(BASE_RELEASE_FILE) \
$(call DependOnVariable, JDK_MODULES_LIST), \
OUTPUT_DIR := $(JDK_IMAGE_DIR), \
SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jre, \
PRE_COMMAND := $(RM) -r $(JRE_IMAGE_DIR), \
COMMAND := $(JLINK_TOOL) --add-modules $(JRE_MODULES_LIST) \
$(JLINK_JRE_EXTRA_OPTS) --output $(JRE_IMAGE_DIR), \
))
JLINK_JRE_TARGETS := $(jlink_jre)
ifeq ($(BUILD_CDS_ARCHIVE), true)
CDS_ARCHIVE := lib/server/classes.jsa
$(eval $(call SetupExecute, gen_cds_archive_jdk, \
WARN := Creating CDS archive for jdk image, \
DEPS := $(jlink_jdk), \
OUTPUT_FILE := $(JDK_IMAGE_DIR)/$(CDS_ARCHIVE), \
SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jdk, \
COMMAND := $(FIXPATH) $(JDK_IMAGE_DIR)/bin/java -Xshare:dump \
-Xmx128M -Xms128M $(LOG_INFO), \
))
JDK_TARGETS += $(gen_cds_archive_jdk)
$(eval $(call SetupExecute, gen_cds_archive_jre, \
WARN := Creating CDS archive for jre image, \
DEPS := $(jlink_jre), \
OUTPUT_FILE := $(JRE_IMAGE_DIR)/$(CDS_ARCHIVE), \
SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jre, \
COMMAND := $(FIXPATH) $(JRE_IMAGE_DIR)/bin/java -Xshare:dump \
-Xmx128M -Xms128M $(LOG_INFO), \
))
JDK_TARGETS += $(gen_cds_archive_jdk)
endif
################################################################################ ################################################################################
# src.zip # src.zip
@ -244,11 +258,11 @@ $(eval $(call IncludeCustomExtension, Images-post.gmk))
################################################################################ ################################################################################
$(JRE_TARGETS): $(TOOL_JRE_TARGETS) $(JRE_TARGETS): $(JLINK_JRE_TARGETS)
$(JDK_TARGETS): $(TOOL_JDK_TARGETS) $(JDK_TARGETS): $(JLINK_JDK_TARGETS)
jdk: $(TOOL_JDK_TARGETS) $(JDK_TARGETS) jdk: $(JLINK_JDK_TARGETS) $(JDK_TARGETS)
jre: $(TOOL_JRE_TARGETS) $(JRE_TARGETS) jre: $(JLINK_JRE_TARGETS) $(JRE_TARGETS)
symbols: $(SYMBOLS_TARGETS) symbols: $(SYMBOLS_TARGETS)
all: jdk jre symbols all: jdk jre symbols

View File

@ -456,7 +456,7 @@ define DeclareInterimJmodRecipe
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CreateJmods.gmk \ +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CreateJmods.gmk \
MODULE=$1 \ MODULE=$1 \
JMODS_DIR=$(INTERIM_JMODS_DIR) \ JMODS_DIR=$(INTERIM_JMODS_DIR) \
JMODS_TEMPDIR=$(INTERIM_JMODS_DIR)/temp \ JMODS_SUPPORT_DIR=$(INTERIM_JMODS_DIR)/support \
INTERIM_JMOD=true \ INTERIM_JMOD=true \
) )
endef endef
@ -1120,7 +1120,8 @@ ALL_TARGETS += $(RUN_TEST_TARGETS) run-test exploded-run-test check \
# file. # file.
CLEAN_DIRS += hotspot jdk bootcycle-build test buildtools support \ CLEAN_DIRS += hotspot jdk bootcycle-build test buildtools support \
images make-support test-make bundles buildjdk test-results test-support images make-support test-make bundles buildjdk test-results test-support \
support/images
CLEAN_DIR_TARGETS := $(addprefix clean-, $(CLEAN_DIRS)) CLEAN_DIR_TARGETS := $(addprefix clean-, $(CLEAN_DIRS))
CLEAN_SUPPORT_DIRS += demos CLEAN_SUPPORT_DIRS += demos
CLEAN_SUPPORT_DIR_TARGETS := $(addprefix clean-, $(CLEAN_SUPPORT_DIRS)) CLEAN_SUPPORT_DIR_TARGETS := $(addprefix clean-, $(CLEAN_SUPPORT_DIRS))
@ -1170,6 +1171,9 @@ clean-support: clean-jdk
clean-test: clean-test-results clean-test-support clean-test: clean-test-results clean-test-support
# When cleaning images, also clean the support/images directory.
clean-images: clean-support/images
# Remove everything, including configure configuration. If the output # Remove everything, including configure configuration. If the output
# directory was created by configure and now becomes empty, remove it as well. # directory was created by configure and now becomes empty, remove it as well.
dist-clean: clean dist-clean: clean

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -29,6 +29,7 @@ default: all
include $(SPEC) include $(SPEC)
include MakeBase.gmk include MakeBase.gmk
include Execute.gmk
include NativeCompilation.gmk include NativeCompilation.gmk
include ToolsJdk.gmk include ToolsJdk.gmk
@ -47,17 +48,21 @@ ifeq ($(COMPILE_TYPE), cross)
endif endif
X11WRAPPERS_OUTPUT := $(SUPPORT_OUTPUTDIR)/x11wrappers X11WRAPPERS_OUTPUT := $(SUPPORT_OUTPUTDIR)/x11wrappers
GENERATOR_SOURCE_FILE := $(X11WRAPPERS_OUTPUT)/src/data_generator.c
GENSRC_X11WRAPPERS_DATADIR := $(TOPDIR)/make/data/x11wrappergen GENSRC_X11WRAPPERS_DATADIR := $(TOPDIR)/make/data/x11wrappergen
WRAPPER_OUTPUT_FILE := $(GENSRC_X11WRAPPERS_DATADIR)/sizes-$(BITS).txt
BITS := $(OPENJDK_TARGET_CPU_BITS) BITS := $(OPENJDK_TARGET_CPU_BITS)
# Generate the C code for the program that will output the offset file. # Generate the C code for the program that will output the offset file.
$(X11WRAPPERS_OUTPUT)/src/data_generator.c: $(GENSRC_X11WRAPPERS_DATADIR)/xlibtypes.txt $(BUILD_TOOLS_JDK) $(eval $(call SetupExecute, gensrc_generator, \
$(call LogInfo, Generating X11 wrapper data generator source code) INFO := Generating X11 wrapper data generator source code, \
$(call MakeDir, $(@D)) DEPS := $(GENSRC_X11WRAPPERS_DATADIR)/xlibtypes.txt $(BUILD_TOOLS_JDK), \
$(call ExecuteWithLog, $@, \ OUTPUT_FILE := $(GENERATOR_SOURCE_FILE), \
$(TOOL_WRAPPERGENERATOR) gen_c_source $@ $(GENSRC_X11WRAPPERS_DATADIR)/xlibtypes.txt $(BITS)) COMMAND := $(TOOL_WRAPPERGENERATOR) gen_c_source $(GENERATOR_SOURCE_FILE) \
$(GENSRC_X11WRAPPERS_DATADIR)/xlibtypes.txt $(BITS), \
))
DATA_GENERATOR_INCLUDES := \ DATA_GENERATOR_INCLUDES := \
-I$(TOPDIR)/src/hotspot/share/include \ -I$(TOPDIR)/src/hotspot/share/include \
@ -75,7 +80,7 @@ DATA_GENERATOR_INCLUDES := \
$(eval $(call SetupNativeCompilation, BUILD_DATA_GENERATOR, \ $(eval $(call SetupNativeCompilation, BUILD_DATA_GENERATOR, \
PROGRAM := data_generator, \ PROGRAM := data_generator, \
OUTPUT_DIR := $(X11WRAPPERS_OUTPUT)/bin, \ OUTPUT_DIR := $(X11WRAPPERS_OUTPUT)/bin, \
EXTRA_FILES := $(X11WRAPPERS_OUTPUT)/src/data_generator.c, \ EXTRA_FILES := $(GENERATOR_SOURCE_FILE), \
CFLAGS := $(X_CFLAGS) $(DATA_GENERATOR_INCLUDES) $(CFLAGS_JDKEXE), \ CFLAGS := $(X_CFLAGS) $(DATA_GENERATOR_INCLUDES) $(CFLAGS_JDKEXE), \
LDFLAGS := $(LDFLAGS_JDKEXE), \ LDFLAGS := $(LDFLAGS_JDKEXE), \
LIBS := $(X_LIBS), \ LIBS := $(X_LIBS), \
@ -83,16 +88,19 @@ $(eval $(call SetupNativeCompilation, BUILD_DATA_GENERATOR, \
)) ))
# Run the executable to create the data file. # Run the executable to create the data file.
$(GENSRC_X11WRAPPERS_DATADIR)/sizes-$(BITS).txt: $(BUILD_DATA_GENERATOR_TARGET) $(eval $(call SetupExecute, run_wrappergen, \
$(call LogInfo, Generating X11 wrapper data files) INFO := Generating X11 wrapper data files, \
$(call MakeDir, $(@D)) DEPS := $(BUILD_DATA_GENERATOR), \
$(call ExecuteWithLog, $(X11WRAPPERS_OUTPUT)/generation, \ OUTPUT_FILE := $(WRAPPER_OUTPUT_FILE), \
$(BUILD_DATA_GENERATOR_TARGET) | $(SORT) > $@) COMMAND := $(BUILD_DATA_GENERATOR_TARGET) | $(SORT) > $(WRAPPER_OUTPUT_FILE), \
))
wrapper-information: $(run_wrappergen)
$(ECHO) IMPORTANT: If you update the X11 wrapper data files, they most certainly $(ECHO) IMPORTANT: If you update the X11 wrapper data files, they most certainly
$(ECHO) need to be updated for both 32 and 64 bit platforms. You have now $(ECHO) need to be updated for both 32 and 64 bit platforms. You have now
$(ECHO) updated them for $(BITS) bit platforms only. $(ECHO) updated them for $(BITS) bit platforms only.
TARGETS += $(GENSRC_X11WRAPPERS_DATADIR)/sizes-$(BITS).txt TARGETS += $(run_wrappergen) wrapper-information
################################################################################ ################################################################################

198
make/common/Execute.gmk Normal file
View File

@ -0,0 +1,198 @@
#
# Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
ifeq (,$(_MAKEBASE_GMK))
$(error You must include MakeBase.gmk prior to including Execute.gmk)
endif
################################################################################
#
# Code for handling the SetupExecute macro.
#
################################################################################
################################################################################
# Setup make rules for executing an arbitrary command.
#
# Parameter 1 is the name of the rule. This name is used as variable prefix,
# and the targets generated are listed in a variable by that name.
#
# You need to specify a COMMAND, the actual command line to execute. You are
# strongly recommended to provide a INFO with the text to display for LOG=info
# on what operation is performed. You can use DEPS to provide additional
# dependencies for your command to run. You can optionally include a PRE_COMMAND
# and a POST_COMMAND, intended for simple pre- and post-processing. The latter
# might be e.g. a mv from a temporary file to the final destination, the former
# e.g. a simple sed replacement on the input file. If the operations are
# unrelated to the main COMMAND, this is not a suitable solution.
#
# If your command outputs a variety of files, or if it's really a single file
# but you don't really care about the output from the perspective, you can just
# supply an OUTPUT_DIR. You are supposed to make sure the command creates files
# in this directory (which will be created for you if it does not exist), but
# this can't be enforced by SetupExecute. Additional support files (like logs
# and markers) are created in this directory. If you want support files in a
# separate directory (e.g. if you're targeting an OUTPUT_DIR in the image
# directly), you can specify a SUPPORT_DIR. If your command outputs only a
# single file, you can get rid of the marker files (but not the log files) by
# specifying OUTPUT_FILE. Note that if you specify an OUTPUT_FILE, support log
# files will be placed in the same directory as the OUTPUT_FILE. If you do not
# want that, use SUPPORT_DIR as well.
#
# After the call to SetupExecute, $1 will contain references to all generated
# files (that make knows about), and $1_TARGET will contain a reference to the
# final target (that is OUTPUT_FILE if it exists, or the $1_exec.marker file
# otherwise).
#
# All the above keep functioning as expected even if PRE_COMMAND and
# POST_COMMAND are given. One special case worth noting is that if OUTPUT_FILE
# and POST_COMMAND is both given, the actual OUTPUT_FILE is considered to be a
# result of running the POST_COMMAND.
#
# Remaining parameters are named arguments. These include:
# COMMAND : The command to execute
# PRE_COMMAND : A helper command to execute before COMMAND
# POST_COMMAND: A helper command to execute after COMMAND
# OUTPUT_DIR : The directory that will contain the result from the command
# OUTPUT_FILE : Use this if the command results in a single output file
# SUPPORT_DIR : Where to store generated support files
# INFO : Message to display at LOG=info level when running command (optional)
# WARN : Message to display at LOG=warn level when running command (optional)
# DEPS : Dependencies for the execution to take place
#
# Setup make rules for copying files, with an option to do more complex
SetupExecute = $(NamedParamsMacroTemplate)
define SetupExecuteBody
ifeq ($$($1_COMMAND), )
$$(error COMMAND is missing in SetupExecute $1)
endif
ifneq ($$($1_OUTPUT_FILE), )
ifneq ($$($1_OUTPUT_DIR), )
$$(error Cannot specify both OUTPUT_DIR and OUTPUT_FILE in SetupExecute $1)
endif
# We need to know output dir since we will make sure it is created.
$1_OUTPUT_DIR := $$(patsubst %/,%, $$(dir $$($1_OUTPUT_FILE)))
ifeq ($$($1_SUPPORT_DIR), )
# If support dir is not given, use base dir of output file.
$1_SUPPORT_DIR := $$($1_OUTPUT_DIR)
endif
else ifneq ($$($1_OUTPUT_DIR), )
ifeq ($$($1_SUPPORT_DIR), )
# If support dir is not given, use output dir.
$1_SUPPORT_DIR := $$($1_OUTPUT_DIR)
endif
else
$$(error OUTPUT_DIR or OUTPUT_FILE is required in SetupExecute $1)
endif
$1_BASE := $$($1_SUPPORT_DIR)/_$1
$1_PRE_MARKER := $$($1_BASE)_pre.marker
$1_EXEC_MARKER := $$($1_BASE)_exec.marker
$1_POST_MARKER := $$($1_BASE)_post.marker
ifeq ($$($1_OUTPUT_FILE), )
# No specified output file, use markers everywhere
$1_EXEC_RESULT := $$($1_EXEC_MARKER)
ifeq ($$($1_POST_COMMAND), )
$1_FINAL_RESULT := $$($1_EXEC_MARKER)
else
$1_FINAL_RESULT := $$($1_POST_MARKER)
endif
else
# If we have a single output file, we don't need a separate marker
ifeq ($$($1_POST_COMMAND), )
$1_EXEC_RESULT := $$($1_OUTPUT_FILE)
$1_FINAL_RESULT := $$($1_EXEC_RESULT)
else
$1_EXEC_RESULT := $$($1_EXEC_MARKER)
$1_FINAL_RESULT := $$($1_OUTPUT_FILE)
endif
endif
ifeq ($$($1_INFO)$$($1_WARN), )
# If neither info nor warn is provided, add basic info text.
$1_INFO := Running commands for $1
endif
ifneq ($$($1_PRE_COMMAND), )
$$($1_PRE_MARKER): $$($1_DEPS)
ifneq ($$($1_WARN), )
$$(call LogWarn, $$($1_WARN))
endif
ifneq ($$($1_INFO), )
$$(call LogInfo, $$($1_INFO))
endif
$$(call MakeDir, $$($1_SUPPORT_DIR) $$($1_OUTPUT_DIR))
$$(call ExecuteWithLog, $$($1_BASE)_pre, \
$$($1_PRE_COMMAND))
$$(TOUCH) $$@
$$($1_EXEC_RESULT): $$($1_PRE_MARKER)
$$(call ExecuteWithLog, $$($1_BASE)_exec, \
$$($1_COMMAND))
ifeq ($$($1_EXEC_RESULT), $$($1_EXEC_MARKER))
$$(TOUCH) $$@
endif
$1 := $$($1_PRE_MARKER) $$($1_EXEC_RESULT)
else
$$($1_EXEC_RESULT): $$($1_DEPS)
ifneq ($$($1_WARN), )
$$(call LogWarn, $$($1_WARN))
endif
ifneq ($$($1_INFO), )
$$(call LogInfo, $$($1_INFO))
endif
$$(call MakeDir, $$(call EncodeSpace, $$($1_SUPPORT_DIR)) $$(call EncodeSpace, $$($1_OUTPUT_DIR)))
$$(call ExecuteWithLog, $$($1_BASE)_exec, \
$$($1_COMMAND))
ifeq ($$($1_EXEC_RESULT), $$($1_EXEC_MARKER))
$$(TOUCH) $$@
endif
$1 := $$($1_EXEC_RESULT)
endif
ifneq ($$($1_POST_COMMAND), )
$$($1_FINAL_RESULT): $$($1_EXEC_RESULT)
$$(call ExecuteWithLog, $$($1_BASE)_post, \
$$($1_POST_COMMAND))
$$(TOUCH) $$@
$1 += $$($1_FINAL_RESULT)
endif
# Export all our generated targets in $1, and the final target in $1_TARGET.
$1_TARGET := $$($1_FINAL_RESULT)
endef

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -27,6 +27,7 @@ default: all
include $(SPEC) include $(SPEC)
include MakeBase.gmk include MakeBase.gmk
include Execute.gmk
include JavaCompilation.gmk include JavaCompilation.gmk
include NativeCompilation.gmk include NativeCompilation.gmk
include TextFileProcessing.gmk include TextFileProcessing.gmk

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -26,27 +26,22 @@
# Generate java sources using the X11 offsets that are precalculated in files # Generate java sources using the X11 offsets that are precalculated in files
# make/data/x11wrappergen/sizes-<address size>.txt. # make/data/x11wrappergen/sizes-<address size>.txt.
GENSRC_X11WRAPPERS_OUTPUT_TOP := $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop
GENSRC_X11WRAPPERS_MARKER := $(GENSRC_X11WRAPPERS_OUTPUT_TOP)/_x11wrappers.marker
# Put the generated Java classes used to interface X11 from awt here. # Put the generated Java classes used to interface X11 from awt here.
GENSRC_X11WRAPPERS_OUTPUTDIR := $(GENSRC_X11WRAPPERS_OUTPUT_TOP)/sun/awt/X11 GENSRC_X11WRAPPERS_OUTPUTDIR := $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/sun/awt/X11
# The pre-calculated offset file are stored here: # The pre-calculated offset file are stored here:
GENSRC_X11WRAPPERS_DATADIR := $(TOPDIR)/make/data/x11wrappergen GENSRC_X11WRAPPERS_DATADIR := $(TOPDIR)/make/data/x11wrappergen
GENSRC_X11WRAPPERS_DATA := $(GENSRC_X11WRAPPERS_DATADIR)/sizes-$(OPENJDK_TARGET_CPU_BITS).txt GENSRC_X11WRAPPERS_DATA := $(GENSRC_X11WRAPPERS_DATADIR)/sizes-$(OPENJDK_TARGET_CPU_BITS).txt
# Run the tool on the offset files to generate several Java classes used in awt. # Run the tool on the offset files to generate several Java classes used in awt.
$(GENSRC_X11WRAPPERS_MARKER): $(BUILD_TOOLS_JDK) $(GENSRC_X11WRAPPERS_DATA) \ $(eval $(call SetupExecute, gen_x11wrappers, \
$(GENSRC_X11WRAPPERS_DATADIR)/xlibtypes.txt INFO := Generating X11 wrapper source files, \
$(call MakeDir, $(GENSRC_X11WRAPPERS_OUTPUTDIR)) DEPS := $(BUILD_TOOLS_JDK) $(GENSRC_X11WRAPPERS_DATA) \
$(call LogInfo, Generating X11 wrapper source files) $(GENSRC_X11WRAPPERS_DATADIR)/xlibtypes.txt, \
$(call ExecuteWithLog, $@, \ OUTPUT_DIR := $(GENSRC_X11WRAPPERS_OUTPUTDIR), \
$(TOOL_WRAPPERGENERATOR) gen_java $(GENSRC_X11WRAPPERS_OUTPUTDIR) \ COMMAND := $(TOOL_WRAPPERGENERATOR) gen_java $(GENSRC_X11WRAPPERS_OUTPUTDIR) \
$(GENSRC_X11WRAPPERS_DATADIR)/xlibtypes.txt $(GENSRC_X11WRAPPERS_DATA) \ $(GENSRC_X11WRAPPERS_DATADIR)/xlibtypes.txt $(GENSRC_X11WRAPPERS_DATA) \
$(OPENJDK_TARGET_CPU_BITS)) $(OPENJDK_TARGET_CPU_BITS), \
$(TOUCH) $@ ))
GENSRC_JAVA_DESKTOP += $(gen_x11wrappers_TARGET)
GENSRC_JAVA_DESKTOP += $(GENSRC_X11WRAPPERS_MARKER)

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -27,6 +27,7 @@ default: all
include $(SPEC) include $(SPEC)
include MakeBase.gmk include MakeBase.gmk
include Execute.gmk
include JavaCompilation.gmk include JavaCompilation.gmk
include NativeCompilation.gmk include NativeCompilation.gmk
include TextFileProcessing.gmk include TextFileProcessing.gmk
@ -35,10 +36,10 @@ include HotspotCommon.gmk
# The real work is done in these files # The real work is done in these files
include gensrc/GensrcJfr.gmk
include gensrc/GensrcAdlc.gmk include gensrc/GensrcAdlc.gmk
include gensrc/GensrcDtrace.gmk include gensrc/GensrcDtrace.gmk
include gensrc/GensrcJvmti.gmk include gensrc/GensrcJvmti.gmk
include gensrc/GensrcJfr.gmk
$(eval $(call IncludeCustomExtension, hotspot/gensrc/GenerateSources.gmk)) $(eval $(call IncludeCustomExtension, hotspot/gensrc/GenerateSources.gmk))

View File

@ -166,18 +166,16 @@ ifeq ($(call check-jvm-feature, compiler2), true)
############################################################################## ##############################################################################
# Run the adlc tool on the single concatenated ad source file, and store the # Run the adlc tool on the single concatenated ad source file, and store the
# output in support/adlc for further processing. # output in support/adlc for further processing.
ADLC_RUN_MARKER := $(ADLC_SUPPORT_DIR)/_adlc_run.marker $(eval $(call SetupExecute, adlc_run, \
INFO := Generating adlc files, \
$(ADLC_RUN_MARKER): $(BUILD_ADLC) $(SINGLE_AD_SRCFILE) DEPS := $(BUILD_ADLC) $(SINGLE_AD_SRCFILE), \
$(call LogInfo, Generating adlc files) OUTPUT_DIR := $(ADLC_SUPPORT_DIR), \
$(call MakeDir, $(@D)) COMMAND := $(FIXPATH) $(ADLC_TOOL) $(ADLCFLAGS) $(SINGLE_AD_SRCFILE) \
$(call ExecuteWithLog, $(ADLC_SUPPORT_DIR)/adlc_run, \ -c$(ADLC_SUPPORT_DIR)/ad_$(HOTSPOT_TARGET_CPU_ARCH).cpp \
$(FIXPATH) $(ADLC_TOOL) $(ADLCFLAGS) $(SINGLE_AD_SRCFILE) \ -h$(ADLC_SUPPORT_DIR)/ad_$(HOTSPOT_TARGET_CPU_ARCH).hpp \
-c$(ADLC_SUPPORT_DIR)/ad_$(HOTSPOT_TARGET_CPU_ARCH).cpp \ -a$(ADLC_SUPPORT_DIR)/dfa_$(HOTSPOT_TARGET_CPU_ARCH).cpp \
-h$(ADLC_SUPPORT_DIR)/ad_$(HOTSPOT_TARGET_CPU_ARCH).hpp \ -v$(ADLC_SUPPORT_DIR)/adGlobals_$(HOTSPOT_TARGET_CPU_ARCH).hpp, \
-a$(ADLC_SUPPORT_DIR)/dfa_$(HOTSPOT_TARGET_CPU_ARCH).cpp \ ))
-v$(ADLC_SUPPORT_DIR)/adGlobals_$(HOTSPOT_TARGET_CPU_ARCH).hpp)
$(TOUCH) $@
############################################################################## ##############################################################################
# Finally copy the generated files from support/adlc into gensrc/adfiles, # Finally copy the generated files from support/adlc into gensrc/adfiles,
@ -197,7 +195,7 @@ ifeq ($(call check-jvm-feature, compiler2), true)
dfa_$(HOTSPOT_TARGET_CPU_ARCH).cpp \ dfa_$(HOTSPOT_TARGET_CPU_ARCH).cpp \
) )
$(JVM_VARIANT_OUTPUTDIR)/gensrc/adfiles/%: $(ADLC_RUN_MARKER) $(JVM_VARIANT_OUTPUTDIR)/gensrc/adfiles/%: $(adlc_run_TARGET)
$(call LogInfo, Postprocessing adlc file $*) $(call LogInfo, Postprocessing adlc file $*)
$(call MakeDir, $(@D)) $(call MakeDir, $(@D))
$(NAWK) \ $(NAWK) \

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -64,9 +64,9 @@ ifeq ($(call check-jvm-feature, dtrace), true)
include lib/JvmFeatures.gmk include lib/JvmFeatures.gmk
include lib/JvmFlags.gmk include lib/JvmFlags.gmk
# We cannot compile until the JVMTI and JFR gensrc has finished # We cannot compile until the JVMTI and JFR gensrc has finished.
# JFR_FILES is defined in GensrcJfr.gmk.
JVMTI_H := $(JVM_VARIANT_OUTPUTDIR)/gensrc/jvmtifiles/jvmti.h JVMTI_H := $(JVM_VARIANT_OUTPUTDIR)/gensrc/jvmtifiles/jvmti.h
JFR_FILES := $(JVM_VARIANT_OUTPUTDIR)/gensrc/jfrfiles/jfrEventClasses.hpp
$(eval $(call SetupNativeCompilation, BUILD_DTRACE_GEN_OFFSETS, \ $(eval $(call SetupNativeCompilation, BUILD_DTRACE_GEN_OFFSETS, \
NAME := dtraceGenOffsets, \ NAME := dtraceGenOffsets, \
@ -87,12 +87,14 @@ ifeq ($(call check-jvm-feature, dtrace), true)
# Argument 1: Output filename # Argument 1: Output filename
# Argument 2: dtrace-gen-offset tool command line option # Argument 2: dtrace-gen-offset tool command line option
define SetupDtraceOffsetsGeneration define SetupDtraceOffsetsGeneration
$1: $$(BUILD_DTRACE_GEN_OFFSETS) $$(eval $$(call SetupExecute, dtrace_offset_$$(strip $2), \
$$(call LogInfo, Generating dtrace $2 file $$(@F)) INFO := Generating dtrace $2 file, \
$$(call MakeDir, $$(@D)) DEPS := $$(BUILD_DTRACE_GEN_OFFSETS), \
$$(call ExecuteWithLog, $$@, ( $$(DTRACE_GEN_OFFSETS_TOOL) -$$(strip $2) > $$@ ) ) OUTPUT_FILE := $1, \
COMMAND := ( $$(DTRACE_GEN_OFFSETS_TOOL) -$$(strip $2) > $1 ), \
))
TARGETS += $1 TARGETS += $$(dtrace_offset_$$(strip $2)_TARGET)
endef endef
JVM_OFFSETS_H := $(DTRACE_GENSRC_DIR)/JvmOffsets.h JVM_OFFSETS_H := $(DTRACE_GENSRC_DIR)/JvmOffsets.h

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -57,11 +57,12 @@ JFR_SRCDIR := $(TOPDIR)/src/hotspot/share/jfr/metadata
METADATA_XML := $(JFR_SRCDIR)/metadata.xml METADATA_XML := $(JFR_SRCDIR)/metadata.xml
METADATA_XSD := $(JFR_SRCDIR)/metadata.xsd METADATA_XSD := $(JFR_SRCDIR)/metadata.xsd
$(JFR_OUTPUTDIR)/jfrEventClasses.hpp: $(METADATA_XML) $(METADATA_XSD) \ $(eval $(call SetupExecute, jfr_gen, \
$(BUILD_JFR_TOOLS) INFO := Generating JFR header files, \
$(call LogInfo, Generating $(@F)) DEPS := $(METADATA_XML) $(METADATA_XSD) $(BUILD_JFR_TOOLS), \
$(call MakeDir, $(@D)) OUTPUT_DIR := $(JFR_OUTPUTDIR), \
$(call ExecuteWithLog, $@, $(TOOL_JFR_GEN) $(METADATA_XML) $(METADATA_XSD) $(JFR_OUTPUTDIR)) COMMAND := $(TOOL_JFR_GEN) $(METADATA_XML) $(METADATA_XSD) $(JFR_OUTPUTDIR), \
test -f $@ ))
TARGETS += $(JFR_OUTPUTDIR)/jfrEventClasses.hpp JFR_FILES := $(jfr_gen_TARGET)
TARGETS += $(JFR_FILES)

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -28,6 +28,7 @@ $(eval $(call IncludeCustomExtension, hotspot/gensrc/GensrcJvmti.gmk))
################################################################################ ################################################################################
# Build tools needed for the JVMTI source code generation # Build tools needed for the JVMTI source code generation
# FIXME: jvmtiGen.java should move to make/src, jvmtiEnvFill.java should be removed.
JVMTI_TOOLS_SRCDIR := $(TOPDIR)/src/hotspot/share/prims JVMTI_TOOLS_SRCDIR := $(TOPDIR)/src/hotspot/share/prims
JVMTI_TOOLS_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/tools/jvmti JVMTI_TOOLS_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/tools/jvmti
@ -64,16 +65,17 @@ TOOL_JVMTI_ENV_FILL := $(JAVA_SMALL) -cp $(JVMTI_TOOLS_OUTPUTDIR) jvmtiEnvFill
# DEPS -- Additional dependencies # DEPS -- Additional dependencies
SetupXslTransform = $(NamedParamsMacroTemplate) SetupXslTransform = $(NamedParamsMacroTemplate)
define SetupXslTransformBody define SetupXslTransformBody
$$($1_OUTPUT_DIR)/$1: $$($1_XML_FILE) $$($1_XSL_FILE) $$($1_DEPS) $$(BUILD_JVMTI_TOOLS) $1_OUTPUT_FILE := $$($1_OUTPUT_DIR)/$1
$$(call LogInfo, Generating $$(@F))
$$(call MakeDir, $$(@D))
$$(call ExecuteWithLog, $$@, $$(TOOL_JVMTI_GEN) -IN $$($1_XML_FILE) \
-XSL $$($1_XSL_FILE) -OUT $$@ $$($1_ARGS))
# jvmtiGen does not return error code properly on fail.
# NOTE: We should really fix jvmtiGen.java instead.
test -f $$@
TARGETS += $$($1_OUTPUT_DIR)/$1 $$(eval $$(call SetupExecute, jvmti_gen_$1, \
INFO := Generating jvmti file $1, \
DEPS := $$($1_XML_FILE) $$($1_XSL_FILE) $$($1_DEPS) $$(BUILD_JVMTI_TOOLS), \
OUTPUT_FILE := $$($1_OUTPUT_FILE), \
COMMAND := $$(TOOL_JVMTI_GEN) -IN $$($1_XML_FILE) \
-XSL $$($1_XSL_FILE) -OUT $$($1_OUTPUT_FILE) $$($1_ARGS), \
))
TARGETS += $$(jvmti_gen_$1_TARGET)
endef endef
################################################################################ ################################################################################

View File

@ -144,14 +144,16 @@ ifeq ($(call isTargetOs, windows), true)
VCPROJ_VARDEPS_FILE := $(call DependOnVariable, VCPROJ_VARDEPS, \ VCPROJ_VARDEPS_FILE := $(call DependOnVariable, VCPROJ_VARDEPS, \
$(VCPROJ_FILE).vardeps) $(VCPROJ_FILE).vardeps)
$(VCPROJ_FILE): $(BUILD_PROJECT_CREATOR) $(VCPROJ_VARDEPS_FILE) $(eval $(call SetupExecute, vcproj_file, \
$(call MakeDir, $(@D)) INFO := Generating Visual Studio project file, \
$(call ExecuteWithLog, $@, \ DEPS := $(BUILD_PROJECT_CREATOR) $(VCPROJ_VARDEPS_FILE), \
$(PROJECT_CREATOR_TOOL) $(PROJECT_CREATOR_CLASS) \ OUTPUT_FILE := $(VCPROJ_FILE), \
$(PROJECT_CREATOR_ARGS) -projectFileName $(call FixPath, $@)) \ COMMAND := $(PROJECT_CREATOR_TOOL) $(PROJECT_CREATOR_CLASS) \
$(LOG_INFO) $(PROJECT_CREATOR_ARGS) -projectFileName $(call FixPath, $(VCPROJ_FILE))) \
$(LOG_INFO), \
))
TARGETS += $(VCPROJ_FILE) TARGETS += $(vcproj_file_TARGET)
all: $(TARGETS) all: $(TARGETS)