209 else # HAS_SPEC=true 210 211 ############################################################################## 212 # Now we have a spec. This part provides the "main" target that acts as a 213 # trampoline to call the Main.gmk with the value of $(MAKE) found in the spec 214 # file. 215 ############################################################################## 216 217 include $(SPEC) 218 219 # Our helper functions. 220 include $(TOPDIR)/make/InitSupport.gmk 221 222 # Verify that the spec file we included seems okay. 223 $(eval $(call CheckSpecSanity)) 224 225 # Parse COMPARE_BUILD (for makefile development) 226 $(eval $(call ParseCompareBuild)) 227 228 ifeq ($(LOG_NOFILE), true) 229 # Disable log wrapper if LOG=[level,]nofile was given 230 override BUILD_LOG_WRAPPER := 231 endif 232 233 ifeq ($(OUTPUT_SYNC_SUPPORTED), true) 234 OUTPUT_SYNC_FLAG := -O$(OUTPUT_SYNC) 235 endif 236 237 ############################################################################## 238 # Init targets 239 ############################################################################## 240 241 print-modules: 242 ( cd $(TOPDIR) && \ 243 $(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \ 244 NO_RECIPES=true print-modules ) 245 246 print-targets: 247 ( cd $(TOPDIR) && \ 248 $(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \ 249 NO_RECIPES=true print-targets ) 250 260 ( cd $(OUTPUT_ROOT) && PATH="$(ORIGINAL_PATH)" \ 261 $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) ) 262 263 ############################################################################## 264 # The main target, for delegating into Main.gmk 265 ############################################################################## 266 267 MAIN_TARGETS := $(SEQUENTIAL_TARGETS) $(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE) 268 TARGET_DESCRIPTION := target$(if $(word 2, $(MAIN_TARGETS)),s) \ 269 '$(strip $(MAIN_TARGETS))' in configuration '$(CONF_NAME)' 270 271 # MAKEOVERRIDES is automatically set and propagated by Make to sub-Make calls. 272 # We need to clear it of the init-specific variables. The user-specified 273 # variables are explicitely propagated using $(USER_MAKE_VARS). 274 main: MAKEOVERRIDES := 275 276 main: $(INIT_TARGETS) 277 ifneq ($(SEQUENTIAL_TARGETS)$(PARALLEL_TARGETS), ) 278 $(call RotateLogFiles) 279 $(call PrepareFailureLogs) 280 $(BUILD_LOG_WRAPPER) $(PRINTF) "Building $(TARGET_DESCRIPTION)\n" 281 ifneq ($(SEQUENTIAL_TARGETS), ) 282 # Don't touch build output dir since we might be cleaning. That 283 # means no log wrapper. 284 ( cd $(TOPDIR) && \ 285 $(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \ 286 $(SEQUENTIAL_TARGETS) ) 287 endif 288 ifneq ($(PARALLEL_TARGETS), ) 289 $(call StartGlobalTimer) 290 $(call PrepareSmartJavac) 291 ( cd $(TOPDIR) && \ 292 $(BUILD_LOG_WRAPPER) $(NICE) $(MAKE) $(MAKE_ARGS) $(OUTPUT_SYNC_FLAG) \ 293 -j $(JOBS) -f make/Main.gmk $(USER_MAKE_VARS) \ 294 $(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE) || \ 295 ( exitcode=$$? && $(BUILD_LOG_WRAPPER) \ 296 $(PRINTF) "\nERROR: Build failed for $(TARGET_DESCRIPTION) (exit code $$exitcode) \n" && \ 297 cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -j 1 -f make/Init.gmk \ 298 HAS_SPEC=true on-failure ; \ 299 exit $$exitcode ) ) 300 $(call CleanupSmartJavac) 301 $(call StopGlobalTimer) 302 $(call ReportBuildTimes) 303 endif 304 $(BUILD_LOG_WRAPPER) $(PRINTF) "Finished building $(TARGET_DESCRIPTION)\n" 305 endif 306 307 on-failure: 308 $(call PrintFailureReports) 309 $(call PrintBuildLogFailures) 310 $(PRINTF) "Hint: If caused by a warning, try configure --disable-warnings-as-errors.\n\n" 311 ifneq ($(COMPARE_BUILD), ) 312 $(call CleanupCompareBuild) 313 endif 314 315 # Support targets for COMPARE_BUILD, used for makefile development 316 pre-compare-build: 317 $(call PrepareCompareBuild) 318 319 post-compare-build: 320 $(call CleanupCompareBuild) 321 $(call CompareBuildDoComparison) 322 323 .PHONY: print-targets print-modules reconfigure main on-failure 324 endif | 209 else # HAS_SPEC=true 210 211 ############################################################################## 212 # Now we have a spec. This part provides the "main" target that acts as a 213 # trampoline to call the Main.gmk with the value of $(MAKE) found in the spec 214 # file. 215 ############################################################################## 216 217 include $(SPEC) 218 219 # Our helper functions. 220 include $(TOPDIR)/make/InitSupport.gmk 221 222 # Verify that the spec file we included seems okay. 223 $(eval $(call CheckSpecSanity)) 224 225 # Parse COMPARE_BUILD (for makefile development) 226 $(eval $(call ParseCompareBuild)) 227 228 ifeq ($(LOG_NOFILE), true) 229 # Disable build log if LOG=[level,]nofile was given 230 override BUILD_LOG_PIPE := 231 endif 232 233 ifeq ($(OUTPUT_SYNC_SUPPORTED), true) 234 OUTPUT_SYNC_FLAG := -O$(OUTPUT_SYNC) 235 endif 236 237 ############################################################################## 238 # Init targets 239 ############################################################################## 240 241 print-modules: 242 ( cd $(TOPDIR) && \ 243 $(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \ 244 NO_RECIPES=true print-modules ) 245 246 print-targets: 247 ( cd $(TOPDIR) && \ 248 $(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \ 249 NO_RECIPES=true print-targets ) 250 260 ( cd $(OUTPUT_ROOT) && PATH="$(ORIGINAL_PATH)" \ 261 $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) ) 262 263 ############################################################################## 264 # The main target, for delegating into Main.gmk 265 ############################################################################## 266 267 MAIN_TARGETS := $(SEQUENTIAL_TARGETS) $(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE) 268 TARGET_DESCRIPTION := target$(if $(word 2, $(MAIN_TARGETS)),s) \ 269 '$(strip $(MAIN_TARGETS))' in configuration '$(CONF_NAME)' 270 271 # MAKEOVERRIDES is automatically set and propagated by Make to sub-Make calls. 272 # We need to clear it of the init-specific variables. The user-specified 273 # variables are explicitely propagated using $(USER_MAKE_VARS). 274 main: MAKEOVERRIDES := 275 276 main: $(INIT_TARGETS) 277 ifneq ($(SEQUENTIAL_TARGETS)$(PARALLEL_TARGETS), ) 278 $(call RotateLogFiles) 279 $(call PrepareFailureLogs) 280 $(PRINTF) "Building $(TARGET_DESCRIPTION)\n" $(BUILD_LOG_PIPE) 281 ifneq ($(SEQUENTIAL_TARGETS), ) 282 # Don't touch build output dir since we might be cleaning. That 283 # means no log pipe. 284 ( cd $(TOPDIR) && \ 285 $(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \ 286 $(SEQUENTIAL_TARGETS) ) 287 endif 288 ifneq ($(PARALLEL_TARGETS), ) 289 $(call StartGlobalTimer) 290 $(call PrepareSmartJavac) 291 ( cd $(TOPDIR) && \ 292 $(NICE) $(MAKE) $(MAKE_ARGS) $(OUTPUT_SYNC_FLAG) \ 293 -j $(JOBS) -f make/Main.gmk $(USER_MAKE_VARS) \ 294 $(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE) $(BUILD_LOG_PIPE) || \ 295 ( exitcode=$$? && \ 296 $(PRINTF) "\nERROR: Build failed for $(TARGET_DESCRIPTION) (exit code $$exitcode) \n" \ 297 $(BUILD_LOG_PIPE) && \ 298 cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -j 1 -f make/Init.gmk \ 299 HAS_SPEC=true on-failure ; \ 300 exit $$exitcode ) ) 301 $(call CleanupSmartJavac) 302 $(call StopGlobalTimer) 303 $(call ReportBuildTimes) 304 endif 305 $(PRINTF) "Finished building $(TARGET_DESCRIPTION)\n" $(BUILD_LOG_PIPE) 306 endif 307 308 on-failure: 309 $(call PrintFailureReports) 310 $(call PrintBuildLogFailures) 311 $(PRINTF) "Hint: If caused by a warning, try configure --disable-warnings-as-errors.\n\n" 312 ifneq ($(COMPARE_BUILD), ) 313 $(call CleanupCompareBuild) 314 endif 315 316 # Support targets for COMPARE_BUILD, used for makefile development 317 pre-compare-build: 318 $(call PrepareCompareBuild) 319 320 post-compare-build: 321 $(call CleanupCompareBuild) 322 $(call CompareBuildDoComparison) 323 324 .PHONY: print-targets print-modules reconfigure main on-failure 325 endif |