# -*- makefile -*- # vim:set ts=8 sw=8 sts=8 noet: # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/.
# Access up to 9 arguments passed, option needed to emulate $* # Inline for function expansion, do not use $(call )
argv =$(strip
argv +=$(if $(1), $(1))$(if $(2), $(2))$(if $(3), $(3))$(if $(4), $(4))
argv +=$(if $(5), $(5))$(if $(6), $(6))$(if $(7), $(7))$(if $(8), $(8))
argv +=$(if $(9), $(9))
argv +=$(if $(10), $(error makeutils.mk::argv can only handle 9 arguments))
argv +=)
########################################################################### ## Access function args as a simple list, inline within user functions. ## Usage: $(info ** $(call banner,$(getargv))) ## $(call banner,scalar) ## $(call banner,list0 list1 list2) ## $(call banner,ref) ; ref=foo bar tans ## getarglist() would be a more accurate name but is longer to type
getargv = $(if $(call isvar,$(1)),$($(1)),$(argv))
########################################################################### # Strip [n] leading options from an argument list. This will allow passing # extra args to user functions that will not propogate to sub-$(call )'s # Usage: $(call subargv,2)
subargv =$(wordlist $(1),$(words $(getargv)),$(getargv))
########################################################################### # Intent: Display a distinct banner heading in the output stream # Usage: $(call banner,BUILDING: foo bar tans) # Debug: # target-preqs = \ # $(call banner,target-preqs-BEGIN) \ # foo bar tans \ # $(call banner,target-preqs-END) \ # $(NULL) # target: $(target-preqs)
##################################################################### # Intent: Determine if a string or pattern is contained in a list # Usage: strcmp - $(call if_XinY,clean,$(MAKECMDGOALS)) # : pattern - $(call if_XinY,clean%,$(MAKECMDGOALS))
is_XinY =$(filter $(1),$(call subargv,3,$(getargv)))
##################################################################### # Provide an alternate var to support testing
ifdef MAKEUTILS_UNIT_TEST
mcg_goals=TEST_MAKECMDGOALS else
mcg_goals=MAKECMDGOALS endif
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.