< prev index next >

make/Main.gmk

Print this page
rev 53723 : 8218807: Compilation database (compile_commands.json) may contain obsolete items


 749   endif
 750   $(foreach m, $(GENDATA_MODULES), $(eval $m_JMOD_DEPS += $m-gendata))
 751   $(foreach m, $(RMIC_MODULES), $(eval $m_JMOD_DEPS += $m-rmic))
 752   $(foreach m, $(LIBS_MODULES), $(eval $m_JMOD_DEPS += $m-libs))
 753   $(foreach m, $(LAUNCHER_MODULES), $(eval $m_JMOD_DEPS += $m-launchers))
 754   $(foreach m, $(COPY_MODULES), $(eval $m_JMOD_DEPS += $m-copy))
 755   $(foreach m, $(ALL_MODULES), $(eval $m-jmod: $($(m)_JMOD_DEPS)))
 756   $(foreach m, $(INTERIM_IMAGE_MODULES), $(eval $m-interim-jmod: $($(m)_JMOD_DEPS)))
 757 
 758   # Setup the minimal set of generated native source dependencies for hotspot
 759   $(foreach v, $(JVM_VARIANTS), \
 760     $(eval hotspot-$v-libs-compile-commands: hotspot-$v-gensrc) \
 761     $(foreach m, $(filter java.desktop jdk.hotspot.agent, $(GENSRC_MODULES)), \
 762       $(eval hotspot-$v-libs-compile-commands: $m-gensrc)) \
 763   )
 764 
 765   # For the full JDK compile commands, create all possible generated sources
 766   $(foreach m, $(GENSRC_MODULES), $(eval $m-libs-compile-commands: $m-gensrc))
 767   $(foreach m, $(filter $(JAVA_MODULES), $(LIBS_MODULES)), $(eval $m-libs-compile-commands: $m-java))
 768 


 769   compile-commands-hotspot: $(COMPILE_COMMANDS_TARGETS_HOTSPOT)
 770   compile-commands: $(COMPILE_COMMANDS_TARGETS_HOTSPOT) $(COMPILE_COMMANDS_TARGETS_JDK)
 771 
 772   # Jmods cannot be created until we have the jmod tool ready to run. During
 773   # a normal build we run it from the exploded image, but when cross compiling
 774   # it's run from the buildjdk, which is either created at build time or user
 775   # supplied.
 776   #
 777   # For the exploded image to be runnable, all java modules and
 778   # jdk.jlink-launchers need to be built. We also need to copy jvm.cfg (done
 779   # in java.base-copy) and tzdb.dat (done in java.base-gendata) to the
 780   # appropriate location otherwise jimage, jlink and jmod won't start. This
 781   # also applies when creating the buildjdk.
 782   DEFAULT_JMOD_DEPS += java.base-libs java.base-copy java.base-gendata \
 783       jdk.jlink-launchers
 784   # When cross compiling and buildjdk is to be created, depend on creating the
 785   # buildjdk instead of the default dependencies.
 786   ifeq ($(CREATE_BUILDJDK), true)
 787     # Avoid calling create-buildjdk from within a create-buildjdk call.
 788     ifneq ($(CREATING_BUILDJDK), true)


1122 CLEAN_DIR_TARGETS := $(addprefix clean-, $(CLEAN_DIRS))
1123 CLEAN_SUPPORT_DIRS += demos
1124 CLEAN_SUPPORT_DIR_TARGETS := $(addprefix clean-, $(CLEAN_SUPPORT_DIRS))
1125 CLEAN_TESTS += hotspot-jtreg-native jdk-jtreg-native lib
1126 CLEAN_TEST_TARGETS += $(addprefix clean-test-, $(CLEAN_TESTS))
1127 CLEAN_PHASES := gensrc java native include
1128 CLEAN_PHASE_TARGETS := $(addprefix clean-, $(CLEAN_PHASES))
1129 CLEAN_MODULE_TARGETS := $(addprefix clean-, $(ALL_MODULES))
1130 # Construct targets of the form clean-$module-$phase
1131 CLEAN_MODULE_PHASE_TARGETS := $(addprefix clean-, $(foreach m, $(ALL_MODULES), \
1132     $(addprefix $m-, $(CLEAN_PHASES))))
1133 
1134 # Remove everything, except the output from configure.
1135 clean: $(CLEAN_DIR_TARGETS)
1136         ($(CD) $(OUTPUTDIR) && $(RM) -r build*.log* compile_commands.json)
1137         $(ECHO) Cleaned all build artifacts.
1138 
1139 clean-docs:
1140         $(call CleanDocs)
1141 



1142 $(CLEAN_DIR_TARGETS):
1143         $(call CleanDir,$(patsubst clean-%, %, $@))
1144 
1145 $(CLEAN_SUPPORT_DIR_TARGETS):
1146         $(call CleanSupportDir,$(patsubst clean-%, %, $@))
1147 
1148 $(CLEAN_TEST_TARGETS):
1149         $(call CleanTest,$(patsubst clean-test-%, %, $@))
1150 
1151 $(CLEAN_PHASE_TARGETS):
1152         $(call Clean-$(patsubst clean-%,%, $@))
1153 
1154 $(CLEAN_MODULE_TARGETS):
1155         $(call CleanModule,$(patsubst clean-%, %, $@))
1156 
1157 $(CLEAN_MODULE_PHASE_TARGETS):
1158         $(call Clean-$(word 3, $(subst -,$(SPACE),$@)), \
1159             $(word 2, $(subst -,$(SPACE),$@)))
1160 
1161 # When removing the support dir, we must also remove jdk. Building classes has


1164 clean-support: clean-jdk
1165 
1166 clean-test: clean-test-results clean-test-support
1167 
1168 # Remove everything, including configure configuration. If the output
1169 # directory was created by configure and now becomes empty, remove it as well.
1170 dist-clean: clean
1171         ($(CD) $(OUTPUTDIR) && \
1172             $(RM) -r *spec.gmk $(CONFIGURESUPPORT_OUTPUTDIR) Makefile compare.sh ide \
1173             configure.log* build.log*)
1174         $(if $(filter $(CONF_NAME),$(notdir $(OUTPUTDIR))), \
1175           if test "x`$(LS) $(OUTPUTDIR)`" != x; then \
1176             $(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ; \
1177           else \
1178             ($(CD) $(TOPDIR) && $(ECHO) "Removing configuration directory for '$(CONF_NAME)'" \
1179                 && $(RM) -r $(OUTPUTDIR)) \
1180           fi \
1181         )
1182         $(ECHO) Cleaned everything, you will have to re-run configure.
1183 
1184 ALL_TARGETS += clean clean-docs dist-clean $(CLEAN_DIR_TARGETS) $(CLEAN_SUPPORT_DIR_TARGETS) \
1185     $(CLEAN_TEST_TARGETS) $(CLEAN_PHASE_TARGETS) $(CLEAN_MODULE_TARGETS) \
1186     $(CLEAN_MODULE_PHASE_TARGETS)
1187 
1188 ################################################################################
1189 # Declare *-only targets for each normal target
1190 $(foreach t, $(ALL_TARGETS), $(eval $(t)-only: $(t)))
1191 
1192 ALL_TARGETS += $(addsuffix -only, $(filter-out dist-clean clean%, $(ALL_TARGETS)))
1193 
1194 ################################################################################
1195 
1196 # The following targets are intentionally not added to ALL_TARGETS since they
1197 # are internal only, to support Init.gmk.
1198 
1199 print-targets:
1200           @$(ECHO) $(sort $(ALL_TARGETS))
1201 
1202 print-modules:
1203           @$(ECHO) $(sort $(ALL_MODULES))
1204 
1205 print-tests:
1206           @$(ECHO) $(sort $(ALL_NAMED_TESTS))


 749   endif
 750   $(foreach m, $(GENDATA_MODULES), $(eval $m_JMOD_DEPS += $m-gendata))
 751   $(foreach m, $(RMIC_MODULES), $(eval $m_JMOD_DEPS += $m-rmic))
 752   $(foreach m, $(LIBS_MODULES), $(eval $m_JMOD_DEPS += $m-libs))
 753   $(foreach m, $(LAUNCHER_MODULES), $(eval $m_JMOD_DEPS += $m-launchers))
 754   $(foreach m, $(COPY_MODULES), $(eval $m_JMOD_DEPS += $m-copy))
 755   $(foreach m, $(ALL_MODULES), $(eval $m-jmod: $($(m)_JMOD_DEPS)))
 756   $(foreach m, $(INTERIM_IMAGE_MODULES), $(eval $m-interim-jmod: $($(m)_JMOD_DEPS)))
 757 
 758   # Setup the minimal set of generated native source dependencies for hotspot
 759   $(foreach v, $(JVM_VARIANTS), \
 760     $(eval hotspot-$v-libs-compile-commands: hotspot-$v-gensrc) \
 761     $(foreach m, $(filter java.desktop jdk.hotspot.agent, $(GENSRC_MODULES)), \
 762       $(eval hotspot-$v-libs-compile-commands: $m-gensrc)) \
 763   )
 764 
 765   # For the full JDK compile commands, create all possible generated sources
 766   $(foreach m, $(GENSRC_MODULES), $(eval $m-libs-compile-commands: $m-gensrc))
 767   $(foreach m, $(filter $(JAVA_MODULES), $(LIBS_MODULES)), $(eval $m-libs-compile-commands: $m-java))
 768 
 769   $(COMPILE_COMMANDS_TARGETS_HOTSPOT): clean-compile-commands
 770   $(COMPILE_COMMANDS_TARGETS_JDK): clean-compile-commands
 771   compile-commands-hotspot: $(COMPILE_COMMANDS_TARGETS_HOTSPOT)
 772   compile-commands: $(COMPILE_COMMANDS_TARGETS_HOTSPOT) $(COMPILE_COMMANDS_TARGETS_JDK)
 773 
 774   # Jmods cannot be created until we have the jmod tool ready to run. During
 775   # a normal build we run it from the exploded image, but when cross compiling
 776   # it's run from the buildjdk, which is either created at build time or user
 777   # supplied.
 778   #
 779   # For the exploded image to be runnable, all java modules and
 780   # jdk.jlink-launchers need to be built. We also need to copy jvm.cfg (done
 781   # in java.base-copy) and tzdb.dat (done in java.base-gendata) to the
 782   # appropriate location otherwise jimage, jlink and jmod won't start. This
 783   # also applies when creating the buildjdk.
 784   DEFAULT_JMOD_DEPS += java.base-libs java.base-copy java.base-gendata \
 785       jdk.jlink-launchers
 786   # When cross compiling and buildjdk is to be created, depend on creating the
 787   # buildjdk instead of the default dependencies.
 788   ifeq ($(CREATE_BUILDJDK), true)
 789     # Avoid calling create-buildjdk from within a create-buildjdk call.
 790     ifneq ($(CREATING_BUILDJDK), true)


1124 CLEAN_DIR_TARGETS := $(addprefix clean-, $(CLEAN_DIRS))
1125 CLEAN_SUPPORT_DIRS += demos
1126 CLEAN_SUPPORT_DIR_TARGETS := $(addprefix clean-, $(CLEAN_SUPPORT_DIRS))
1127 CLEAN_TESTS += hotspot-jtreg-native jdk-jtreg-native lib
1128 CLEAN_TEST_TARGETS += $(addprefix clean-test-, $(CLEAN_TESTS))
1129 CLEAN_PHASES := gensrc java native include
1130 CLEAN_PHASE_TARGETS := $(addprefix clean-, $(CLEAN_PHASES))
1131 CLEAN_MODULE_TARGETS := $(addprefix clean-, $(ALL_MODULES))
1132 # Construct targets of the form clean-$module-$phase
1133 CLEAN_MODULE_PHASE_TARGETS := $(addprefix clean-, $(foreach m, $(ALL_MODULES), \
1134     $(addprefix $m-, $(CLEAN_PHASES))))
1135 
1136 # Remove everything, except the output from configure.
1137 clean: $(CLEAN_DIR_TARGETS)
1138         ($(CD) $(OUTPUTDIR) && $(RM) -r build*.log* compile_commands.json)
1139         $(ECHO) Cleaned all build artifacts.
1140 
1141 clean-docs:
1142         $(call CleanDocs)
1143 
1144 clean-compile-commands:
1145         $(call CleanMakeSupportDir,compile-commands)
1146 
1147 $(CLEAN_DIR_TARGETS):
1148         $(call CleanDir,$(patsubst clean-%, %, $@))
1149 
1150 $(CLEAN_SUPPORT_DIR_TARGETS):
1151         $(call CleanSupportDir,$(patsubst clean-%, %, $@))
1152 
1153 $(CLEAN_TEST_TARGETS):
1154         $(call CleanTest,$(patsubst clean-test-%, %, $@))
1155 
1156 $(CLEAN_PHASE_TARGETS):
1157         $(call Clean-$(patsubst clean-%,%, $@))
1158 
1159 $(CLEAN_MODULE_TARGETS):
1160         $(call CleanModule,$(patsubst clean-%, %, $@))
1161 
1162 $(CLEAN_MODULE_PHASE_TARGETS):
1163         $(call Clean-$(word 3, $(subst -,$(SPACE),$@)), \
1164             $(word 2, $(subst -,$(SPACE),$@)))
1165 
1166 # When removing the support dir, we must also remove jdk. Building classes has


1169 clean-support: clean-jdk
1170 
1171 clean-test: clean-test-results clean-test-support
1172 
1173 # Remove everything, including configure configuration. If the output
1174 # directory was created by configure and now becomes empty, remove it as well.
1175 dist-clean: clean
1176         ($(CD) $(OUTPUTDIR) && \
1177             $(RM) -r *spec.gmk $(CONFIGURESUPPORT_OUTPUTDIR) Makefile compare.sh ide \
1178             configure.log* build.log*)
1179         $(if $(filter $(CONF_NAME),$(notdir $(OUTPUTDIR))), \
1180           if test "x`$(LS) $(OUTPUTDIR)`" != x; then \
1181             $(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ; \
1182           else \
1183             ($(CD) $(TOPDIR) && $(ECHO) "Removing configuration directory for '$(CONF_NAME)'" \
1184                 && $(RM) -r $(OUTPUTDIR)) \
1185           fi \
1186         )
1187         $(ECHO) Cleaned everything, you will have to re-run configure.
1188 
1189 ALL_TARGETS += clean clean-docs clean-compile-commands dist-clean $(CLEAN_DIR_TARGETS) \
1190     $(CLEAN_SUPPORT_DIR_TARGETS) $(CLEAN_TEST_TARGETS) $(CLEAN_PHASE_TARGETS) \
1191     $(CLEAN_MODULE_TARGETS) $(CLEAN_MODULE_PHASE_TARGETS)
1192 
1193 ################################################################################
1194 # Declare *-only targets for each normal target
1195 $(foreach t, $(ALL_TARGETS), $(eval $(t)-only: $(t)))
1196 
1197 ALL_TARGETS += $(addsuffix -only, $(filter-out dist-clean clean%, $(ALL_TARGETS)))
1198 
1199 ################################################################################
1200 
1201 # The following targets are intentionally not added to ALL_TARGETS since they
1202 # are internal only, to support Init.gmk.
1203 
1204 print-targets:
1205           @$(ECHO) $(sort $(ALL_TARGETS))
1206 
1207 print-modules:
1208           @$(ECHO) $(sort $(ALL_MODULES))
1209 
1210 print-tests:
1211           @$(ECHO) $(sort $(ALL_NAMED_TESTS))
< prev index next >