< prev index next >

make/common/MakeBase.gmk

Print this page




 143       SHELL :=  $$(BASH) $$(TOPDIR)/make/scripts/shell-profiler.sh \
 144                 gnutime $$(TIME) \
 145                 $$(OUTPUTDIR)/build-profile.log $$(SHELL)
 146     else ifneq ($$(FLOCK), )
 147       SHELL :=  $$(BASH) $$(TOPDIR)/make/scripts/shell-profiler.sh \
 148                 flock $$(FLOCK) \
 149                 $$(OUTPUTDIR)/build-profile.log $$(SHELL)
 150     endif
 151   endif
 152 
 153   ifeq ($$(LOG_LEVEL), trace)
 154     SHELL_NO_RECURSE := $$(SHELL)
 155     # Shell redefinition trick inspired by http://www.cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make
 156     # For each target executed, will print
 157     # Building <TARGET> (from <FIRST PREREQUISITE>) (<ALL NEWER PREREQUISITES> newer)
 158     # but with a limit of 20 on <ALL NEWER PREREQUISITES>, to avoid cluttering logs too much
 159     # (and causing a crash on Cygwin).
 160     SHELL = $$(warning $$(if $$@,Building $$@,Running shell command) $$(if $$<, (from $$<))$$(if $$?, ($$(wordlist 1, 20, $$?) $$(if $$(wordlist 21, 22, $$?), ... [in total $$(words $$?) files]) newer)))$$(SHELL_NO_RECURSE) -x
 161   endif
 162 
 163   # The LOG_PREFIX is set for sub recursive calls like buildjdk and bootcycle.
 164   # The warn level can never be turned off
 165   LogWarn = $$(info $(LOG_PREFIX)$$(strip $$1))
 166   LOG_WARN :=
 167   ifneq ($$(findstring $$(LOG_LEVEL), info debug trace),)
 168     LogInfo = $$(info $(LOG_PREFIX)$$(strip $$1))
 169     LOG_INFO :=
 170   else
 171     LogInfo =
 172     LOG_INFO := > /dev/null
 173   endif
 174   ifneq ($$(findstring $$(LOG_LEVEL), debug trace),)
 175     LogDebug = $$(info $(LOG_PREFIX)$$(strip $$1))
 176     LOG_DEBUG :=
 177   else
 178     LogDebug =
 179     LOG_DEBUG := > /dev/null
 180   endif
 181   ifneq ($$(findstring $$(LOG_LEVEL), trace),)
 182     LogTrace = $$(info $(LOG_PREFIX)$$(strip $$1))
 183     LOG_TRACE :=
 184   else
 185     LogTrace =
 186     LOG_TRACE := > /dev/null
 187   endif
 188 endef
 189 
 190 # Make sure logging is setup for everyone that includes MakeBase.gmk.
 191 $(eval $(call SetupLogging))
 192 
 193 ################################################################################
 194 
 195 MAX_PARAMS := 36
 196 PARAM_SEQUENCE := $(call sequence, 2, $(MAX_PARAMS))
 197 
 198 # Template for creating a macro taking named parameters. To use it, assign the
 199 # template to a variable with the name you want for your macro, using '='
 200 # assignment. Then define a macro body with the suffix "Body". The Body macro
 201 # should take 1 parameter which should be a unique string for that invocation
 202 # of the macro.


 452 #      standard file wildcards (* and ?) and should not be quoted.
 453 ifeq ($(DISABLE_CACHE_FIND), true)
 454   FindFiles = $(DirectFindFiles)
 455 else
 456   FindFiles = $(CacheFindFiles)
 457 endif
 458 
 459 ################################################################################
 460 # FixPath
 461 #
 462 # On Windows, converts a path from cygwin/unix style (e.g. /bin/foo) into
 463 # "mixed mode" (e.g. c:/cygwin/bin/foo). On other platforms, return the path
 464 # unchanged.
 465 # This is normally not needed since we use the FIXPATH prefix for command lines,
 466 # but might be needed in certain circumstances.
 467 ifeq ($(call isTargetOs, windows), true)
 468   FixPath = \
 469       $(shell $(CYGPATH) -m $1)
 470 else
 471   FixPath = \
 472       $1
 473 endif
 474 
 475 ################################################################################
 476 # FixPathList
 477 #
 478 # On Windows, converts a cygwin/unix style path list (colon-separated) into
 479 # the native format (mixed mode, semicolon-separated). On other platforms,
 480 # return the path list unchanged.
 481 ################################################################################
 482 ifeq ($(call isTargetOs, windows), true)
 483   FixPathList = \
 484       $(subst @,$(SPACE),$(subst $(SPACE),;,$(foreach entry,$(subst :,$(SPACE),\
 485       $(subst $(SPACE),@,$(strip $1))),$(call FixPath, $(entry)))))
 486 else
 487   FixPathList = \
 488       $1
 489 endif
 490 
 491 ################################################################################
 492 # DependOnVariable
 493 #
 494 # This macro takes a variable name and puts the value in a file only if the
 495 # value has changed since last. The name of the file is returned. This can be
 496 # used to create rule dependencies on make variable values. The following
 497 # example would get rebuilt if the value of SOME_VAR was changed:
 498 #
 499 # path/to/some-file: $(call DependOnVariable, SOME_VAR)
 500 #         echo $(SOME_VAR) > $@
 501 #
 502 # Note that leading and trailing white space in the value is ignored.
 503 #
 504 
 505 # Defines the sub directory structure to store variable value file in
 506 DependOnVariableDirName = \
 507     $(strip $(addsuffix $(if $(MODULE),/$(MODULE)), \




 143       SHELL :=  $$(BASH) $$(TOPDIR)/make/scripts/shell-profiler.sh \
 144                 gnutime $$(TIME) \
 145                 $$(OUTPUTDIR)/build-profile.log $$(SHELL)
 146     else ifneq ($$(FLOCK), )
 147       SHELL :=  $$(BASH) $$(TOPDIR)/make/scripts/shell-profiler.sh \
 148                 flock $$(FLOCK) \
 149                 $$(OUTPUTDIR)/build-profile.log $$(SHELL)
 150     endif
 151   endif
 152 
 153   ifeq ($$(LOG_LEVEL), trace)
 154     SHELL_NO_RECURSE := $$(SHELL)
 155     # Shell redefinition trick inspired by http://www.cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make
 156     # For each target executed, will print
 157     # Building <TARGET> (from <FIRST PREREQUISITE>) (<ALL NEWER PREREQUISITES> newer)
 158     # but with a limit of 20 on <ALL NEWER PREREQUISITES>, to avoid cluttering logs too much
 159     # (and causing a crash on Cygwin).
 160     SHELL = $$(warning $$(if $$@,Building $$@,Running shell command) $$(if $$<, (from $$<))$$(if $$?, ($$(wordlist 1, 20, $$?) $$(if $$(wordlist 21, 22, $$?), ... [in total $$(words $$?) files]) newer)))$$(SHELL_NO_RECURSE) -x
 161   endif
 162 

 163   # The warn level can never be turned off
 164   LogWarn = $$(info $$(strip $$1))
 165   LOG_WARN :=
 166   ifneq ($$(findstring $$(LOG_LEVEL), info debug trace),)
 167     LogInfo = $$(info $$(strip $$1))
 168     LOG_INFO :=
 169   else
 170     LogInfo =
 171     LOG_INFO := > /dev/null
 172   endif
 173   ifneq ($$(findstring $$(LOG_LEVEL), debug trace),)
 174     LogDebug = $$(info $$(strip $$1))
 175     LOG_DEBUG :=
 176   else
 177     LogDebug =
 178     LOG_DEBUG := > /dev/null
 179   endif
 180   ifneq ($$(findstring $$(LOG_LEVEL), trace),)
 181     LogTrace = $$(info $$(strip $$1))
 182     LOG_TRACE :=
 183   else
 184     LogTrace =
 185     LOG_TRACE := > /dev/null
 186   endif
 187 endef
 188 
 189 # Make sure logging is setup for everyone that includes MakeBase.gmk.
 190 $(eval $(call SetupLogging))
 191 
 192 ################################################################################
 193 
 194 MAX_PARAMS := 36
 195 PARAM_SEQUENCE := $(call sequence, 2, $(MAX_PARAMS))
 196 
 197 # Template for creating a macro taking named parameters. To use it, assign the
 198 # template to a variable with the name you want for your macro, using '='
 199 # assignment. Then define a macro body with the suffix "Body". The Body macro
 200 # should take 1 parameter which should be a unique string for that invocation
 201 # of the macro.


 451 #      standard file wildcards (* and ?) and should not be quoted.
 452 ifeq ($(DISABLE_CACHE_FIND), true)
 453   FindFiles = $(DirectFindFiles)
 454 else
 455   FindFiles = $(CacheFindFiles)
 456 endif
 457 
 458 ################################################################################
 459 # FixPath
 460 #
 461 # On Windows, converts a path from cygwin/unix style (e.g. /bin/foo) into
 462 # "mixed mode" (e.g. c:/cygwin/bin/foo). On other platforms, return the path
 463 # unchanged.
 464 # This is normally not needed since we use the FIXPATH prefix for command lines,
 465 # but might be needed in certain circumstances.
 466 ifeq ($(call isTargetOs, windows), true)
 467   FixPath = \
 468       $(shell $(CYGPATH) -m $1)
 469 else
 470   FixPath = \
















 471       $1
 472 endif
 473 
 474 ################################################################################
 475 # DependOnVariable
 476 #
 477 # This macro takes a variable name and puts the value in a file only if the
 478 # value has changed since last. The name of the file is returned. This can be
 479 # used to create rule dependencies on make variable values. The following
 480 # example would get rebuilt if the value of SOME_VAR was changed:
 481 #
 482 # path/to/some-file: $(call DependOnVariable, SOME_VAR)
 483 #         echo $(SOME_VAR) > $@
 484 #
 485 # Note that leading and trailing white space in the value is ignored.
 486 #
 487 
 488 # Defines the sub directory structure to store variable value file in
 489 DependOnVariableDirName = \
 490     $(strip $(addsuffix $(if $(MODULE),/$(MODULE)), \


< prev index next >