common/makefiles/MakeHelpers.gmk

changeset 478
2ba6f4da4bf3
parent 459
3156dff953b1
child 494
e64f2cb57d05
     1.1 --- a/common/makefiles/MakeHelpers.gmk	Thu Sep 06 17:27:20 2012 -0700
     1.2 +++ b/common/makefiles/MakeHelpers.gmk	Tue Sep 18 11:29:16 2012 -0700
     1.3 @@ -57,9 +57,25 @@
     1.4  define ParseLogLevel
     1.5      ifeq ($$(origin VERBOSE),undefined)
     1.6          # Setup logging according to LOG (but only if VERBOSE is not given)
     1.7 +        
     1.8 +       # If the "nofile" argument is given, act on it and strip it away
     1.9 +        ifneq ($$(findstring nofile,$$(LOG)),)
    1.10 +          # Reset the build log wrapper, regardless of other values
    1.11 +          override BUILD_LOG_WRAPPER=
    1.12 +          # COMMA is defined in spec.gmk, but that is not included yet
    1.13 +          COMMA=,
    1.14 +          # First try to remove ",nofile" if it exists
    1.15 +          LOG_STRIPPED1=$$(subst $$(COMMA)nofile,,$$(LOG))
    1.16 +          # Otherwise just remove "nofile"
    1.17 +          LOG_STRIPPED2=$$(subst nofile,,$$(LOG_STRIPPED1))
    1.18 +          # We might have ended up with a leading comma. Remove it
    1.19 +          LOG_STRIPPED3=$$(strip $$(patsubst $$(COMMA)%,%,$$(LOG_STRIPPED2)))
    1.20 +          override LOG:=$$(LOG_STRIPPED3)
    1.21 +        endif
    1.22 +
    1.23          ifeq ($$(LOG),)
    1.24              # Set LOG to "warn" as default if not set (and no VERBOSE given)
    1.25 -            LOG=warn
    1.26 +            override LOG=warn
    1.27          endif
    1.28          ifeq ($$(LOG),warn)
    1.29              VERBOSE=-s
    1.30 @@ -182,4 +198,11 @@
    1.31      $(call CheckEnvironment)
    1.32  endef
    1.33  
    1.34 +# Cleans the component given as $1
    1.35 +define CleanComponent
    1.36 +    @$(PRINTF) "Cleaning $1 build artifacts ..."
    1.37 +    @($(CD) $(OUTPUT_ROOT) && $(RM) -r $1)
    1.38 +    @$(PRINTF) " done\n"
    1.39 +endef
    1.40 +
    1.41  endif # _MAKEHELPERS_GMK

mercurial