./Makefile

Print this page




  53 
  54 $(eval $(call ParseLogLevel))
  55 $(eval $(call ParseConfAndSpec))
  56 
  57 # Now determine if we have zero, one or several configurations to build.
  58 ifeq ($(SPEC),)
  59   # Since we got past ParseConfAndSpec, we must be building a global target. Do nothing.
  60 else
  61   # In Cygwin, the MAKE variable gets messed up if the make executable is called with
  62   # a Windows mixed path (c:/cygwin/bin/make.exe). If that's the case, fix it by removing
  63   # the prepended root_dir.
  64   ifneq ($(findstring :, $(MAKE)), )
  65     MAKE := $(patsubst $(root_dir)%, %, $(MAKE))
  66   endif
  67 
  68   # We are potentially building multiple configurations.
  69   # First, find out the valid targets
  70   # Run the makefile with an arbitrary SPEC using -p -q (quiet dry-run and dump rules) to find
  71   # available PHONY targets. Use this list as valid targets to pass on to the repeated calls.
  72   all_phony_targets := $(sort $(filter-out $(global_targets), $(strip $(shell \
  73       cd $(root_dir)/make && $(MAKE) -f Main.gmk -p -q FRC SPEC=$(firstword $(SPEC)) | \
  74       grep "^.PHONY:" | head -n 1 | cut -d " " -f 2-))))
  75 
  76   # Loop through the configurations and call the main-wrapper for each one. The wrapper
  77   # target will execute with a single configuration loaded.
  78   $(all_phony_targets):
  79         @$(if $(TARGET_RUN),,\
  80           $(foreach spec,$(SPEC),\
  81             (cd $(root_dir) && $(MAKE) SPEC=$(spec) MAIN_TARGETS="$(call GetRealTarget)" \
  82             $(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) main-wrapper) &&) true)
  83         @echo > /dev/null
  84         $(eval TARGET_RUN=true)
  85 
  86   .PHONY: $(all_phony_targets)
  87 
  88   ifneq ($(MAIN_TARGETS), )
  89     # The wrapper target was called so we now have a single configuration. Load the spec file
  90     # and call the real Main.gmk.
  91     include $(SPEC)
  92 
  93     ### Clean up from previous run
  94     # Remove any build.log from a previous run, if they exist


  98         $(shell $(RM) $(BUILD_LOG_PREVIOUS) 2> /dev/null)
  99         $(shell $(MV) $(BUILD_LOG) $(BUILD_LOG_PREVIOUS) 2> /dev/null)
 100       else
 101         $(shell $(RM) $(BUILD_LOG) 2> /dev/null)
 102       endif
 103       $(shell $(RM) $(OUTPUT_ROOT)/build-trace-time.log 2> /dev/null)
 104     endif
 105     # Remove any javac server logs and port files. This
 106     # prevents a new make run to reuse the previous servers.
 107     ifneq (,$(SJAVAC_SERVER_DIR))
 108       $(shell $(MKDIR) -p $(SJAVAC_SERVER_DIR) && $(RM) -rf $(SJAVAC_SERVER_DIR)/*)
 109     endif
 110 
 111     # Split out the targets requiring sequential execution. Run these targets separately
 112     # from the rest so that the rest may still enjoy full parallel execution.
 113     SEQUENTIAL_TARGETS := $(filter dist-clean clean% reconfigure, $(MAIN_TARGETS))
 114     PARALLEL_TARGETS := $(filter-out $(SEQUENTIAL_TARGETS), $(MAIN_TARGETS))
 115 
 116     main-wrapper:
 117         ifneq ($(SEQUENTIAL_TARGETS), )
 118           (cd $(root_dir)/make && $(MAKE) -f Main.gmk SPEC=$(SPEC) -j 1 \
 119               $(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) $(SEQUENTIAL_TARGETS))
 120         endif
 121         ifneq ($(PARALLEL_TARGETS), )
 122           @$(call AtMakeStart)
 123           (cd $(root_dir)/make && $(BUILD_LOG_WRAPPER) $(MAKE) -f Main.gmk SPEC=$(SPEC) -j $(JOBS) \
 124               $(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) $(PARALLEL_TARGETS) \
 125               $(if $(filter true, $(OUTPUT_SYNC_SUPPORTED)), -O$(OUTPUT_SYNC)))
 126           @$(call AtMakeEnd)
 127         endif
 128 
 129      .PHONY: main-wrapper
 130 
 131    endif
 132 endif
 133 
 134 # Here are "global" targets, i.e. targets that can be executed without specifying a single configuration.
 135 # If you add more global targets, please update the variable global_targets in MakeHelpers.
 136 
 137 help:
 138         $(info )
 139         $(info OpenJDK Makefile help)
 140         $(info =====================)
 141         $(info )
 142         $(info Common make targets)
 143         $(info .  make [default]         # Compile all modules in langtools, hotspot, jaxp, jaxws,)




  53 
  54 $(eval $(call ParseLogLevel))
  55 $(eval $(call ParseConfAndSpec))
  56 
  57 # Now determine if we have zero, one or several configurations to build.
  58 ifeq ($(SPEC),)
  59   # Since we got past ParseConfAndSpec, we must be building a global target. Do nothing.
  60 else
  61   # In Cygwin, the MAKE variable gets messed up if the make executable is called with
  62   # a Windows mixed path (c:/cygwin/bin/make.exe). If that's the case, fix it by removing
  63   # the prepended root_dir.
  64   ifneq ($(findstring :, $(MAKE)), )
  65     MAKE := $(patsubst $(root_dir)%, %, $(MAKE))
  66   endif
  67 
  68   # We are potentially building multiple configurations.
  69   # First, find out the valid targets
  70   # Run the makefile with an arbitrary SPEC using -p -q (quiet dry-run and dump rules) to find
  71   # available PHONY targets. Use this list as valid targets to pass on to the repeated calls.
  72   all_phony_targets := $(sort $(filter-out $(global_targets), $(strip $(shell \
  73       cd $(root_dir)/make && $(MAKE) -f Main.gmk -p -q FRC SPEC=$(firstword $(SPEC)) \
  74       -I $(root_dir)/make/common | grep "^.PHONY:" | head -n 1 | cut -d " " -f 2-))))
  75 
  76   # Loop through the configurations and call the main-wrapper for each one. The wrapper
  77   # target will execute with a single configuration loaded.
  78   $(all_phony_targets):
  79         @$(if $(TARGET_RUN),,\
  80           $(foreach spec,$(SPEC),\
  81             (cd $(root_dir) && $(MAKE) SPEC=$(spec) MAIN_TARGETS="$(call GetRealTarget)" \
  82             $(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) main-wrapper) &&) true)
  83         @echo > /dev/null
  84         $(eval TARGET_RUN=true)
  85 
  86   .PHONY: $(all_phony_targets)
  87 
  88   ifneq ($(MAIN_TARGETS), )
  89     # The wrapper target was called so we now have a single configuration. Load the spec file
  90     # and call the real Main.gmk.
  91     include $(SPEC)
  92 
  93     ### Clean up from previous run
  94     # Remove any build.log from a previous run, if they exist


  98         $(shell $(RM) $(BUILD_LOG_PREVIOUS) 2> /dev/null)
  99         $(shell $(MV) $(BUILD_LOG) $(BUILD_LOG_PREVIOUS) 2> /dev/null)
 100       else
 101         $(shell $(RM) $(BUILD_LOG) 2> /dev/null)
 102       endif
 103       $(shell $(RM) $(OUTPUT_ROOT)/build-trace-time.log 2> /dev/null)
 104     endif
 105     # Remove any javac server logs and port files. This
 106     # prevents a new make run to reuse the previous servers.
 107     ifneq (,$(SJAVAC_SERVER_DIR))
 108       $(shell $(MKDIR) -p $(SJAVAC_SERVER_DIR) && $(RM) -rf $(SJAVAC_SERVER_DIR)/*)
 109     endif
 110 
 111     # Split out the targets requiring sequential execution. Run these targets separately
 112     # from the rest so that the rest may still enjoy full parallel execution.
 113     SEQUENTIAL_TARGETS := $(filter dist-clean clean% reconfigure, $(MAIN_TARGETS))
 114     PARALLEL_TARGETS := $(filter-out $(SEQUENTIAL_TARGETS), $(MAIN_TARGETS))
 115 
 116     main-wrapper:
 117         ifneq ($(SEQUENTIAL_TARGETS), )
 118           (cd $(SRC_ROOT)/make && $(MAKE) -f Main.gmk SPEC=$(SPEC) -j 1 \
 119               $(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) $(SEQUENTIAL_TARGETS))
 120         endif
 121         ifneq ($(PARALLEL_TARGETS), )
 122           @$(call AtMakeStart)
 123           (cd $(SRC_ROOT)/make && $(BUILD_LOG_WRAPPER) $(MAKE) -f Main.gmk SPEC=$(SPEC) -j $(JOBS) \
 124               $(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) $(PARALLEL_TARGETS) \
 125               $(if $(filter true, $(OUTPUT_SYNC_SUPPORTED)), -O$(OUTPUT_SYNC)))
 126           @$(call AtMakeEnd)
 127         endif
 128 
 129      .PHONY: main-wrapper
 130 
 131    endif
 132 endif
 133 
 134 # Here are "global" targets, i.e. targets that can be executed without specifying a single configuration.
 135 # If you add more global targets, please update the variable global_targets in MakeHelpers.
 136 
 137 help:
 138         $(info )
 139         $(info OpenJDK Makefile help)
 140         $(info =====================)
 141         $(info )
 142         $(info Common make targets)
 143         $(info .  make [default]         # Compile all modules in langtools, hotspot, jaxp, jaxws,)