261 |
261 |
262 ALL_TARGETS += $(HOTSPOT_VARIANT_TARGETS) $(HOTSPOT_VARIANT_GENSRC_TARGETS) \ |
262 ALL_TARGETS += $(HOTSPOT_VARIANT_TARGETS) $(HOTSPOT_VARIANT_GENSRC_TARGETS) \ |
263 $(HOTSPOT_VARIANT_LIBS_TARGETS) hotspot-ide-project |
263 $(HOTSPOT_VARIANT_LIBS_TARGETS) hotspot-ide-project |
264 |
264 |
265 ################################################################################ |
265 ################################################################################ |
|
266 # Generate libs and launcher targets for creating compile_commands.json fragments |
|
267 define DeclareCompileCommandsRecipe |
|
268 $1-compile-commands: |
|
269 $$(call LogInfo, Generating compile_commands.json fragments for $1) |
|
270 +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Main.gmk $1-only \ |
|
271 GENERATE_COMPILE_COMMANDS_ONLY=true) |
|
272 |
|
273 COMPILE_COMMANDS_TARGETS_$2 += $1-compile-commands |
|
274 endef |
|
275 |
|
276 $(foreach t, $(HOTSPOT_VARIANT_LIBS_TARGETS), \ |
|
277 $(eval $(call DeclareCompileCommandsRecipe,$t,HOTSPOT)) \ |
|
278 ) |
|
279 |
|
280 $(foreach t, $(LIBS_TARGETS) $(LAUNCHER_TARGETS), \ |
|
281 $(eval $(call DeclareCompileCommandsRecipe,$t,JDK)) \ |
|
282 ) |
|
283 |
|
284 compile-commands compile-commands-hotspot: |
|
285 +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileCommands.gmk) |
|
286 |
|
287 ALL_TARGETS += $(COMPILE_COMMANDS_TARGETS_HOTSPOT) $(COMPILE_COMMANDS_TARGETS_JDK) |
|
288 ALL_TARGETS += compile-commands compile-commands-hotspot |
|
289 |
|
290 ################################################################################ |
266 # Build demos targets |
291 # Build demos targets |
267 |
292 |
268 demos-jdk: |
293 demos-jdk: |
269 +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileDemos.gmk) |
294 +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileDemos.gmk) |
270 |
295 |
560 $(call RunTests, "jdk_native_sanity", $(JDK_IMAGE_DIR)) |
585 $(call RunTests, "jdk_native_sanity", $(JDK_IMAGE_DIR)) |
561 |
586 |
562 test-make: |
587 test-make: |
563 ($(CD) $(TOPDIR)/test/make && $(MAKE) $(MAKE_ARGS) -f TestMake.gmk $(TEST_TARGET)) |
588 ($(CD) $(TOPDIR)/test/make && $(MAKE) $(MAKE_ARGS) -f TestMake.gmk $(TEST_TARGET)) |
564 |
589 |
|
590 test-compile-commands: |
|
591 ($(CD) $(TOPDIR)/test/make && $(MAKE) $(MAKE_ARGS) -f TestMake.gmk test-compile-commands) |
|
592 |
565 ALL_TARGETS += test test-hotspot-jtreg test-hotspot-jtreg-native \ |
593 ALL_TARGETS += test test-hotspot-jtreg test-hotspot-jtreg-native \ |
566 test-hotspot-internal test-hotspot-gtest test-jdk-jtreg-native test-make |
594 test-hotspot-internal test-hotspot-gtest test-jdk-jtreg-native test-make \ |
|
595 test-compile-commands |
567 |
596 |
568 ################################################################################ |
597 ################################################################################ |
569 # Bundles |
598 # Bundles |
570 |
599 |
571 product-bundles: |
600 product-bundles: |
735 $(foreach m, $(LIBS_MODULES), $(eval $m_JMOD_DEPS += $m-libs)) |
764 $(foreach m, $(LIBS_MODULES), $(eval $m_JMOD_DEPS += $m-libs)) |
736 $(foreach m, $(LAUNCHER_MODULES), $(eval $m_JMOD_DEPS += $m-launchers)) |
765 $(foreach m, $(LAUNCHER_MODULES), $(eval $m_JMOD_DEPS += $m-launchers)) |
737 $(foreach m, $(COPY_MODULES), $(eval $m_JMOD_DEPS += $m-copy)) |
766 $(foreach m, $(COPY_MODULES), $(eval $m_JMOD_DEPS += $m-copy)) |
738 $(foreach m, $(ALL_MODULES), $(eval $m-jmod: $($(m)_JMOD_DEPS))) |
767 $(foreach m, $(ALL_MODULES), $(eval $m-jmod: $($(m)_JMOD_DEPS))) |
739 $(foreach m, $(INTERIM_IMAGE_MODULES), $(eval $m-interim-jmod: $($(m)_JMOD_DEPS))) |
768 $(foreach m, $(INTERIM_IMAGE_MODULES), $(eval $m-interim-jmod: $($(m)_JMOD_DEPS))) |
|
769 |
|
770 # Setup the minimal set of generated native source dependencies for hotspot |
|
771 $(foreach v, $(JVM_VARIANTS), \ |
|
772 $(eval hotspot-$v-libs-compile-commands: hotspot-$v-gensrc) \ |
|
773 $(foreach m, $(filter java.desktop jdk.hotspot.agent, $(GENSRC_MODULES)), \ |
|
774 $(eval hotspot-$v-libs-compile-commands: $m-gensrc)) \ |
|
775 ) |
|
776 |
|
777 # For the full JDK compile commands, create all possible generated sources |
|
778 $(foreach m, $(GENSRC_MODULES), $(eval $m-libs-compile-commands: $m-gensrc)) |
|
779 $(foreach m, $(filter $(JAVA_MODULES), $(LIBS_MODULES)), $(eval $m-libs-compile-commands: $m-java)) |
|
780 |
|
781 compile-commands-hotspot: $(COMPILE_COMMANDS_TARGETS_HOTSPOT) |
|
782 compile-commands: $(COMPILE_COMMANDS_TARGETS_HOTSPOT) $(COMPILE_COMMANDS_TARGETS_JDK) |
740 |
783 |
741 # Jmods cannot be created until we have the jmod tool ready to run. During |
784 # Jmods cannot be created until we have the jmod tool ready to run. During |
742 # a normal build we run it from the exploded image, but when cross compiling |
785 # a normal build we run it from the exploded image, but when cross compiling |
743 # it's run from the buildjdk, which is either created at build time or user |
786 # it's run from the buildjdk, which is either created at build time or user |
744 # supplied. |
787 # supplied. |
852 |
895 |
853 interim-image: $(INTERIM_JMOD_TARGETS) |
896 interim-image: $(INTERIM_JMOD_TARGETS) |
854 |
897 |
855 test-make: clean-test-make |
898 test-make: clean-test-make |
856 |
899 |
|
900 test-compile-commands: compile-commands |
|
901 |
857 build-test-lib: exploded-image-optimize |
902 build-test-lib: exploded-image-optimize |
858 |
903 |
859 build-test-failure-handler: interim-langtools |
904 build-test-failure-handler: interim-langtools |
860 |
905 |
861 test-failure-handler: build-test-failure-handler |
906 test-failure-handler: build-test-failure-handler |
1078 CLEAN_MODULE_PHASE_TARGETS := $(addprefix clean-, $(foreach m, $(ALL_MODULES), \ |
1123 CLEAN_MODULE_PHASE_TARGETS := $(addprefix clean-, $(foreach m, $(ALL_MODULES), \ |
1079 $(addprefix $m-, $(CLEAN_PHASES)))) |
1124 $(addprefix $m-, $(CLEAN_PHASES)))) |
1080 |
1125 |
1081 # Remove everything, except the output from configure. |
1126 # Remove everything, except the output from configure. |
1082 clean: $(CLEAN_DIR_TARGETS) |
1127 clean: $(CLEAN_DIR_TARGETS) |
1083 ($(CD) $(OUTPUTDIR) && $(RM) -r build*.log*) |
1128 ($(CD) $(OUTPUTDIR) && $(RM) -r build*.log* compile_commands.json) |
1084 $(ECHO) Cleaned all build artifacts. |
1129 $(ECHO) Cleaned all build artifacts. |
1085 |
1130 |
1086 clean-docs: |
1131 clean-docs: |
1087 $(call CleanDocs) |
1132 $(call CleanDocs) |
1088 |
1133 |