summaryrefslogtreecommitdiffstats
path: root/rules/other/Definitions.make
blob: da61322883f0618b447b3ab3cab05ddfb47021fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# -*-makefile-*-
#
# Copyright (C) 2004, 2005, 2006, 2007, 2008 by the PTXdist project
#               2009 by Marc Kleine-Budde <mkl@pengutronix.de>
#
# See CREDITS for details about who has contributed to this project.
#
# For further information about the PTXdist project and license conditions
# see the README file.
#

PTXCONFIG		:= $(PTXDIST_PTXCONFIG)
PLATFORMCONFIG		:= $(PTXDIST_PLATFORMCONFIG)
SRCDIR			:= $(PTXDIST_SRCDIR)
PARALLELMFLAGS		:= $(PTXDIST_PARALLELMFLAGS_INTERN)
PARALLELMFLAGS_BROKEN	:= -j1

#
# provide defines for some unusual chars
#
ptx/def/comma		:=,
ptx/def/nullstring	:=
ptx/def/space		:=$(ptx/def/nullstring) $(ptx/def/nullstring)
ptx/def/dquote		:="#"
ptx/def/squote		:='#'
ptx/def/dollar		:=$$

define ptx/escape/1
$(subst $(1),\$(1),$(2))
endef

define ptx/escape/2
$(subst $(1),\\$(1),$(2))
endef

define ptx/escape
$(strip $(call ptx/escape/2,$(ptx/def/dollar),$(call ptx/escape/1,$(ptx/def/dquote),$(1))))
endef


# backwards compat
comma		:=,
nullstring	:=
space		:=$(nullstring) $(nullstring)
quote		:="#"

define remove_quotes
$(strip $(subst $(quote),,$(1)))
endef

define add_quote
$(subst $(quote),\$(quote),$(1))
endef

define tr_sh
$(strip $(shell echo $(1) | sed 'y%*+%pp%;s%[^_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]%_%g'))
endef

define reverse
$(if $(1),$(call reverse,$(wordlist 2,$(words $(1)),$(1)))) $(firstword $(1))
endef

# vim600:set foldmethod=marker:
# vim600:set syntax=make: