common/makefiles/MakeHelpers.gmk

changeset 673
2ef28c12d649
parent 559
ef6adbf511cc
child 839
174a54ce39c4
equal deleted inserted replaced
672:2f43964043c2 673:2ef28c12d649
182 LOG_STRIPPED1=$$(subst $$(COMMA)nofile,,$$(LOG)) 182 LOG_STRIPPED1=$$(subst $$(COMMA)nofile,,$$(LOG))
183 # Otherwise just remove "nofile" 183 # Otherwise just remove "nofile"
184 LOG_STRIPPED2=$$(subst nofile,,$$(LOG_STRIPPED1)) 184 LOG_STRIPPED2=$$(subst nofile,,$$(LOG_STRIPPED1))
185 # We might have ended up with a leading comma. Remove it 185 # We might have ended up with a leading comma. Remove it
186 LOG_STRIPPED3=$$(strip $$(patsubst $$(COMMA)%,%,$$(LOG_STRIPPED2))) 186 LOG_STRIPPED3=$$(strip $$(patsubst $$(COMMA)%,%,$$(LOG_STRIPPED2)))
187 override LOG:=$$(LOG_STRIPPED3) 187 LOG_LEVEL:=$$(LOG_STRIPPED3)
188 endif 188 else
189 189 LOG_LEVEL:=$$(LOG)
190 ifeq ($$(LOG),) 190 endif
191
192 ifeq ($$(LOG_LEVEL),)
191 # Set LOG to "warn" as default if not set (and no VERBOSE given) 193 # Set LOG to "warn" as default if not set (and no VERBOSE given)
192 override LOG=warn 194 override LOG_LEVEL=warn
193 endif 195 endif
194 ifeq ($$(LOG),warn) 196 ifeq ($$(LOG_LEVEL),warn)
195 VERBOSE=-s 197 VERBOSE=-s
196 else ifeq ($$(LOG),info) 198 else ifeq ($$(LOG_LEVEL),info)
197 VERBOSE=-s 199 VERBOSE=-s
198 else ifeq ($$(LOG),debug) 200 else ifeq ($$(LOG_LEVEL),debug)
199 VERBOSE= 201 VERBOSE=
200 else ifeq ($$(LOG),trace) 202 else ifeq ($$(LOG_LEVEL),trace)
201 VERBOSE= 203 VERBOSE=
202 else 204 else
203 $$(info Error: LOG must be one of: warn, info, debug or trace.) 205 $$(info Error: LOG must be one of: warn, info, debug or trace.)
204 $$(eval $$(call FatalError)) 206 $$(eval $$(call FatalError))
205 endif 207 endif
206 else 208 else
209 # Provide resonable interpretations of LOG_LEVEL if VERBOSE is given.
210 ifeq ($(VERBOSE),)
211 LOG_LEVEL:=debug
212 else
213 LOG_LEVEL:=warn
214 endif
207 ifneq ($$(LOG),) 215 ifneq ($$(LOG),)
208 # We have both a VERBOSE and a LOG argument. This is OK only if this is a repeated call by ourselves, 216 # We have both a VERBOSE and a LOG argument. This is OK only if this is a repeated call by ourselves,
209 # but complain if this is the top-level make call. 217 # but complain if this is the top-level make call.
210 ifeq ($$(MAKELEVEL),0) 218 ifeq ($$(MAKELEVEL),0)
211 $$(info Cannot use LOG=$$(LOG) and VERBOSE=$$(VERBOSE) at the same time. Choose one.) 219 $$(info Cannot use LOG=$$(LOG) and VERBOSE=$$(VERBOSE) at the same time. Choose one.)

mercurial