24 # |
24 # |
25 |
25 |
26 ################################################################################ |
26 ################################################################################ |
27 # This is the main makefile containing most actual top level targets. It needs |
27 # This is the main makefile containing most actual top level targets. It needs |
28 # to be called with a SPEC file defined. |
28 # to be called with a SPEC file defined. |
|
29 ################################################################################ |
29 |
30 |
30 # Declare default target |
31 # Declare default target |
31 default: |
32 default: |
32 |
33 |
|
34 ifeq ($(wildcard $(SPEC)),) |
|
35 $(error Main.gmk needs SPEC set to a proper spec.gmk) |
|
36 endif |
|
37 |
33 # Now load the spec |
38 # Now load the spec |
34 include $(SPEC) |
39 include $(SPEC) |
35 |
40 |
36 include $(SRC_ROOT)/make/MakeHelpers.gmk |
41 include $(SRC_ROOT)/make/MainSupport.gmk |
37 |
42 |
38 # Load the vital tools for all the makefiles. |
43 # Load the vital tools for all the makefiles. |
39 include $(SRC_ROOT)/make/common/MakeBase.gmk |
44 include $(SRC_ROOT)/make/common/MakeBase.gmk |
40 include $(SRC_ROOT)/make/common/Modules.gmk |
45 include $(SRC_ROOT)/make/common/Modules.gmk |
41 |
46 |
213 @$(call GetSourceTips) |
218 @$(call GetSourceTips) |
214 |
219 |
215 BOOTCYCLE_TARGET := product-images |
220 BOOTCYCLE_TARGET := product-images |
216 bootcycle-images: |
221 bootcycle-images: |
217 @$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image |
222 @$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image |
218 +$(MAKE) $(MAKE_ARGS) -f Main.gmk SPEC=$(dir $(SPEC))bootcycle-spec.gmk $(BOOTCYCLE_TARGET) |
223 +$(MAKE) $(MAKE_ARGS) -f $(SRC_ROOT)/make/Main.gmk \ |
|
224 SPEC=$(dir $(SPEC))bootcycle-spec.gmk $(BOOTCYCLE_TARGET) |
219 |
225 |
220 zip-security: |
226 zip-security: |
221 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSecurity.gmk) |
227 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSecurity.gmk) |
222 |
228 |
223 zip-source: |
229 zip-source: |
590 |
596 |
591 ALL_TARGETS += clean dist-clean $(CLEAN_DIR_TARGETS) $(CLEAN_TEST_TARGETS) \ |
597 ALL_TARGETS += clean dist-clean $(CLEAN_DIR_TARGETS) $(CLEAN_TEST_TARGETS) \ |
592 $(CLEAN_PHASE_TARGETS) $(CLEAN_MODULE_TARGETS) $(CLEAN_MODULE_PHASE_TARGETS) |
598 $(CLEAN_PHASE_TARGETS) $(CLEAN_MODULE_TARGETS) $(CLEAN_MODULE_PHASE_TARGETS) |
593 |
599 |
594 ################################################################################ |
600 ################################################################################ |
595 |
|
596 # Setup a rule for SPEC file that fails if executed. This check makes sure the |
|
597 # configuration is up to date after changes to configure. |
|
598 ifeq ($(findstring reconfigure, $(MAKECMDGOALS)), ) |
|
599 $(SPEC): $(wildcard $(SRC_ROOT)/common/autoconf/*) |
|
600 @$(ECHO) "ERROR: $(SPEC) is not up to date." |
|
601 @$(ECHO) "Please rerun configure! Easiest way to do this is by running" |
|
602 @$(ECHO) "'make reconfigure'." |
|
603 @$(ECHO) "It may also be ignored by setting IGNORE_OLD_CONFIG=true" |
|
604 @if test "x$(IGNORE_OLD_CONFIG)" != "xtrue"; then exit 1; fi |
|
605 endif |
|
606 |
|
607 # The reconfigure target is automatically run serially from everything else |
|
608 # by the Makefile calling this file. |
|
609 |
|
610 reconfigure: |
|
611 ifneq ($(CONFIGURE_COMMAND_LINE), ) |
|
612 @$(ECHO) "Re-running configure using arguments '$(CONFIGURE_COMMAND_LINE)'" |
|
613 else |
|
614 @$(ECHO) "Re-running configure using default settings" |
|
615 endif |
|
616 @( cd $(OUTPUT_ROOT) && PATH="$(ORIGINAL_PATH)" \ |
|
617 $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) ) |
|
618 |
|
619 ALL_TARGETS += reconfigure |
|
620 |
|
621 ################################################################################ |
|
622 # Declare *-only targets for each normal target |
601 # Declare *-only targets for each normal target |
623 $(foreach t, $(ALL_TARGETS), $(eval $(t)-only: $(t))) |
602 $(foreach t, $(ALL_TARGETS), $(eval $(t)-only: $(t))) |
624 |
603 |
625 ALL_TARGETS += $(addsuffix -only, $(filter-out clean%, $(ALL_TARGETS))) |
604 ALL_TARGETS += $(addsuffix -only, $(filter-out dist-clean clean%, $(ALL_TARGETS))) |
|
605 |
|
606 ################################################################################ |
|
607 |
|
608 # Include JPRT targets |
|
609 include $(SRC_ROOT)/make/Jprt.gmk |
|
610 |
|
611 ################################################################################ |
|
612 |
|
613 print-targets: |
|
614 @$(ECHO) $(sort $(ALL_TARGETS)) |
|
615 |
|
616 print-modules: |
|
617 @$(ECHO) $(sort $(ALL_MODULES)) |
|
618 |
|
619 # print-* targets intentionally not added to ALL_TARGETS since they are internal only. |
|
620 # The corresponding external targets are in Help.gmk |
626 |
621 |
627 ################################################################################ |
622 ################################################################################ |
628 |
623 |
629 .PHONY: $(ALL_TARGETS) |
624 .PHONY: $(ALL_TARGETS) |
630 |
625 |
631 include $(SRC_ROOT)/make/Jprt.gmk |
|
632 |
|
633 FRC: # Force target |
626 FRC: # Force target |