25
26 ################################################################################
27 # This is the main makefile containing most actual top level targets. It needs
28 # to be called with a SPEC file defined.
29 ################################################################################
30
31 # Declare default target
32 default:
33
34 ifeq ($(wildcard $(SPEC)),)
35 $(error Main.gmk needs SPEC set to a proper spec.gmk)
36 endif
37
38 # Now load the spec
39 include $(SPEC)
40
41 include $(SRC_ROOT)/make/MainSupport.gmk
42
43 # Load the vital tools for all the makefiles.
44 include $(SRC_ROOT)/make/common/MakeBase.gmk
45 include $(SRC_ROOT)/make/common/Modules.gmk
46
47 # Declare ALL_TARGETS as an immediate variable. This variable is a list of all
48 # valid top level targets. It's used to declare them all as PHONY and to
49 # generate the -only targets.
50 ALL_TARGETS :=
51
52 # Hook to include the corresponding custom file, if present.
53 $(eval $(call IncludeCustomExtension, , Main.gmk))
54
55 # All modules for the current target platform.
56 ALL_MODULES := $(call FindAllModules)
57
58 ################################################################################
59 ################################################################################
60 #
61 # Recipes for all targets. Only recipes, dependencies are declared later.
62 #
63 ################################################################################
64
65 ################################################################################
66 # Interim/build tools targets, compiling tools used during the build
67
68 buildtools-langtools:
69 +($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Tools.gmk)
70
71 interim-langtools:
72 +($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterim.gmk)
73
74 interim-rmic:
75 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterimRmic.gmk)
76
77 interim-cldrconverter:
78 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopyInterimCLDRConverter.gmk)
79
80 buildtools-jdk:
81 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Tools.gmk java-tools)
82
83 ALL_TARGETS += buildtools-langtools interim-langtools \
84 interim-rmic interim-cldrconverter buildtools-jdk
85
86 ################################################################################
87 # Special targets for certain modules
88
89 import-hotspot:
90 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Import.gmk)
91
92 unpack-sec:
93 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f UnpackSecurity.gmk)
94
95 generate-exported-symbols:
96 +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f BuildStatic.gmk)
97
98 ALL_TARGETS += import-hotspot unpack-sec generate-exported-symbols
99
100 ################################################################################
101 # Gensrc targets, generating source before java compilation can be done
201 ALL_TARGETS += hotspot
202
203 ################################################################################
204 # Build demos and samples targets
205
206 demos-jdk:
207 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileDemos.gmk)
208
209 samples-jdk:
210 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopySamples.gmk)
211
212 ALL_TARGETS += demos-jdk samples-jdk
213
214 ################################################################################
215 # Image targets
216
217 # Stores the tips for each repository. This file is be used when constructing the jdk image and can be
218 # used to track the exact sources used to build that image.
219 source-tips: $(SUPPORT_OUTPUTDIR)/source_tips
220 $(SUPPORT_OUTPUTDIR)/source_tips: FRC
221 @$(MKDIR) -p $(@D)
222 @$(RM) $@
223 @$(call GetSourceTips)
224
225 BOOTCYCLE_TARGET := product-images
226 bootcycle-images:
227 @$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image
228 +$(MAKE) -f $(SRC_ROOT)/make/Init.gmk PARALLEL_TARGETS=$(BOOTCYCLE_TARGET) \
229 JOBS= SPEC=$(dir $(SPEC))bootcycle-spec.gmk main
230
231 zip-security:
232 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSecurity.gmk)
233
234 zip-source:
235 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSource.gmk)
236
237 strip-binaries:
238 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f StripBinaries.gmk)
239
240 jrtfs-jar:
241 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f JrtfsJar.gmk)
639
640 ALL_TARGETS += $(addsuffix -only, $(filter-out dist-clean clean%, $(ALL_TARGETS)))
641
642 ################################################################################
643
644 # Include JPRT targets
645 include $(SRC_ROOT)/make/Jprt.gmk
646
647 ################################################################################
648
649 # The following targets are intentionally not added to ALL_TARGETS since they
650 # are internal only, to support Init.gmk.
651
652 print-targets:
653 @$(ECHO) $(sort $(ALL_TARGETS))
654
655 print-modules:
656 @$(ECHO) $(sort $(ALL_MODULES))
657
658 create-main-targets-include:
659 @$(ECHO) $(LOG_INFO) Generating main target list
660 @$(ECHO) ALL_MAIN_TARGETS := $(sort $(ALL_TARGETS)) > \
661 $(MAKESUPPORT_OUTPUTDIR)/main-targets.gmk
662
663 ################################################################################
664
665 .PHONY: $(ALL_TARGETS)
666
667 FRC: # Force target
|
25
26 ################################################################################
27 # This is the main makefile containing most actual top level targets. It needs
28 # to be called with a SPEC file defined.
29 ################################################################################
30
31 # Declare default target
32 default:
33
34 ifeq ($(wildcard $(SPEC)),)
35 $(error Main.gmk needs SPEC set to a proper spec.gmk)
36 endif
37
38 # Now load the spec
39 include $(SPEC)
40
41 include $(SRC_ROOT)/make/MainSupport.gmk
42
43 # Load the vital tools for all the makefiles.
44 include $(SRC_ROOT)/make/common/MakeBase.gmk
45 # Explicitly generate module deps makefile data
46 include $(SRC_ROOT)/make/GenerateModuleDeps.gmk
47 include $(SRC_ROOT)/make/common/Modules.gmk
48
49 # Declare ALL_TARGETS as an immediate variable. This variable is a list of all
50 # valid top level targets. It's used to declare them all as PHONY and to
51 # generate the -only targets.
52 ALL_TARGETS :=
53
54 # Hook to include the corresponding custom file, if present.
55 $(eval $(call IncludeCustomExtension, , Main.gmk))
56
57 # All modules for the current target platform.
58 ALL_MODULES := $(call FindAllModules)
59
60 ################################################################################
61 ################################################################################
62 #
63 # Recipes for all targets. Only recipes, dependencies are declared later.
64 #
65 ################################################################################
66
67 ################################################################################
68 # Interim/build tools targets, compiling tools used during the build
69
70 buildtools-langtools:
71 +($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Tools.gmk)
72
73 interim-langtools:
74 +($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterim.gmk)
75
76 interim-rmic:
77 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterimRmic.gmk)
78
79 interim-cldrconverter:
80 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopyInterimCLDRConverter.gmk)
81
82 buildtools-jdk:
83 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileTools.gmk)
84
85 ALL_TARGETS += buildtools-langtools interim-langtools \
86 interim-rmic interim-cldrconverter buildtools-jdk
87
88 ################################################################################
89 # Special targets for certain modules
90
91 import-hotspot:
92 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Import.gmk)
93
94 unpack-sec:
95 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f UnpackSecurity.gmk)
96
97 generate-exported-symbols:
98 +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f BuildStatic.gmk)
99
100 ALL_TARGETS += import-hotspot unpack-sec generate-exported-symbols
101
102 ################################################################################
103 # Gensrc targets, generating source before java compilation can be done
203 ALL_TARGETS += hotspot
204
205 ################################################################################
206 # Build demos and samples targets
207
208 demos-jdk:
209 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileDemos.gmk)
210
211 samples-jdk:
212 +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopySamples.gmk)
213
214 ALL_TARGETS += demos-jdk samples-jdk
215
216 ################################################################################
217 # Image targets
218
219 # Stores the tips for each repository. This file is be used when constructing the jdk image and can be
220 # used to track the exact sources used to build that image.
221 source-tips: $(SUPPORT_OUTPUTDIR)/source_tips
222 $(SUPPORT_OUTPUTDIR)/source_tips: FRC
223 $(call MakeDir, $(@D))
224 @$(RM) $@
225 @$(call GetSourceTips)
226
227 BOOTCYCLE_TARGET := product-images
228 bootcycle-images:
229 @$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image
230 +$(MAKE) -f $(SRC_ROOT)/make/Init.gmk PARALLEL_TARGETS=$(BOOTCYCLE_TARGET) \
231 JOBS= SPEC=$(dir $(SPEC))bootcycle-spec.gmk main
232
233 zip-security:
234 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSecurity.gmk)
235
236 zip-source:
237 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSource.gmk)
238
239 strip-binaries:
240 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f StripBinaries.gmk)
241
242 jrtfs-jar:
243 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f JrtfsJar.gmk)
641
642 ALL_TARGETS += $(addsuffix -only, $(filter-out dist-clean clean%, $(ALL_TARGETS)))
643
644 ################################################################################
645
646 # Include JPRT targets
647 include $(SRC_ROOT)/make/Jprt.gmk
648
649 ################################################################################
650
651 # The following targets are intentionally not added to ALL_TARGETS since they
652 # are internal only, to support Init.gmk.
653
654 print-targets:
655 @$(ECHO) $(sort $(ALL_TARGETS))
656
657 print-modules:
658 @$(ECHO) $(sort $(ALL_MODULES))
659
660 create-main-targets-include:
661 $(call LogInfo, Generating main target list)
662 @$(ECHO) ALL_MAIN_TARGETS := $(sort $(ALL_TARGETS)) > \
663 $(MAKESUPPORT_OUTPUTDIR)/main-targets.gmk
664
665 ################################################################################
666
667 .PHONY: $(ALL_TARGETS)
668
669 FRC: # Force target
|