140
141 # Hook to be called when finish executing a top-level target
142 define TargetExit
143 $(call RecordEndTime,$(patsubst %-only,%,$@))
144 $(BUILD_LOG_WRAPPER) $(PRINTF) "## Finished $(patsubst %-only,%,$@) (build time %s)\n\n" \
145 "`$(CAT) $(BUILDTIMESDIR)/build_time_diff_$(patsubst %-only,%,$@) | $(CUT) -f 1 -d " "`"
146 $(call CheckIfMakeAtEnd)
147 endef
148
149 # Hook to be called as the very first thing when running a normal build
150 define AtMakeStart
151 $(if $(findstring --jobserver,$(MAKEFLAGS)),$(error make -j is not supported, use make JOBS=n))
152 $(call CheckEnvironment)
153 @$(PRINTF) $(LOG_INFO) "Running make as '$(MAKE) $(MFLAGS) $(MAKE_ARGS)'\n"
154 @$(PRINTF) "Building $(PRODUCT_NAME) for target '$(call GetRealTarget)' in configuration '$(CONF_NAME)'\n\n"
155 $(call StartGlobalTimer)
156 endef
157
158 # Hook to be called as the very last thing for targets that are "top level" targets
159 define AtMakeEnd
160 $(if $(SJAVAC_SERVER_DIR),@$(RM) -rf $(SJAVAC_SERVER_DIR)/*.port)
161 $(call StopGlobalTimer)
162 $(call ReportBuildTimes)
163 @$(PRINTF) "Finished building $(PRODUCT_NAME) for target '$(call GetRealTarget)'\n"
164 $(call CheckEnvironment)
165 endef
166
167 ### Functions for parsing and setting up make options from command-line
168
169 define FatalError
170 # If the user specificed a "global" target (e.g. 'help'), do not exit but continue running
171 $$(if $$(filter-out $(global_targets),$$(call GetRealTarget)),$$(error Cannot continue))
172 endef
173
174 define ParseLogLevel
175 ifeq ($$(origin VERBOSE),undefined)
176 # Setup logging according to LOG (but only if VERBOSE is not given)
177
178 # If the "nofile" argument is given, act on it and strip it away
179 ifneq ($$(findstring nofile,$$(LOG)),)
180 # Reset the build log wrapper, regardless of other values
|
140
141 # Hook to be called when finish executing a top-level target
142 define TargetExit
143 $(call RecordEndTime,$(patsubst %-only,%,$@))
144 $(BUILD_LOG_WRAPPER) $(PRINTF) "## Finished $(patsubst %-only,%,$@) (build time %s)\n\n" \
145 "`$(CAT) $(BUILDTIMESDIR)/build_time_diff_$(patsubst %-only,%,$@) | $(CUT) -f 1 -d " "`"
146 $(call CheckIfMakeAtEnd)
147 endef
148
149 # Hook to be called as the very first thing when running a normal build
150 define AtMakeStart
151 $(if $(findstring --jobserver,$(MAKEFLAGS)),$(error make -j is not supported, use make JOBS=n))
152 $(call CheckEnvironment)
153 @$(PRINTF) $(LOG_INFO) "Running make as '$(MAKE) $(MFLAGS) $(MAKE_ARGS)'\n"
154 @$(PRINTF) "Building $(PRODUCT_NAME) for target '$(call GetRealTarget)' in configuration '$(CONF_NAME)'\n\n"
155 $(call StartGlobalTimer)
156 endef
157
158 # Hook to be called as the very last thing for targets that are "top level" targets
159 define AtMakeEnd
160 [ -f $(SJAVAC_SERVER_DIR)/server.port ] && echo Stopping sjavac server && $(TOUCH) $(SJAVAC_SERVER_DIR)/server.port.stop; true
161 $(call StopGlobalTimer)
162 $(call ReportBuildTimes)
163 @$(PRINTF) "Finished building $(PRODUCT_NAME) for target '$(call GetRealTarget)'\n"
164 $(call CheckEnvironment)
165 endef
166
167 ### Functions for parsing and setting up make options from command-line
168
169 define FatalError
170 # If the user specificed a "global" target (e.g. 'help'), do not exit but continue running
171 $$(if $$(filter-out $(global_targets),$$(call GetRealTarget)),$$(error Cannot continue))
172 endef
173
174 define ParseLogLevel
175 ifeq ($$(origin VERBOSE),undefined)
176 # Setup logging according to LOG (but only if VERBOSE is not given)
177
178 # If the "nofile" argument is given, act on it and strip it away
179 ifneq ($$(findstring nofile,$$(LOG)),)
180 # Reset the build log wrapper, regardless of other values
|