2 # Copyright (C) 2012-2015 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 # Substituted by SDK, do not remove
11 PKG_CONFIG_DEPENDS
+= \
12 CONFIG_VERSION_NUMBER \
16 CONFIG_VERSION_MANUFACTURER \
17 CONFIG_VERSION_MANUFACTURER_URL \
18 CONFIG_VERSION_PRODUCT \
19 CONFIG_VERSION_HWREV \
21 qstrip_escape
=$(subst ','\'',$(call qstrip,$(1)))
24 VERSION_NUMBER
:=$(call qstrip_escape
,$(CONFIG_VERSION_NUMBER
))
25 VERSION_NUMBER
:=$(if
$(VERSION_NUMBER
),$(VERSION_NUMBER
),$(REVISION
))
27 VERSION_CODE
:=$(call qstrip_escape
,$(CONFIG_VERSION_NUMBER
))
28 VERSION_CODE
:=$(if
$(VERSION_CODE
),$(VERSION_CODE
),Bleeding Edge
)
30 VERSION_NICK
:=$(call qstrip_escape
,$(CONFIG_VERSION_NICK
))
31 VERSION_NICK
:=$(if
$(VERSION_NICK
),$(VERSION_NICK
),$(RELEASE
))
33 VERSION_REPO
:=$(call qstrip_escape
,$(CONFIG_VERSION_REPO
))
34 VERSION_REPO
:=$(if
$(VERSION_REPO
),$(VERSION_REPO
),http
://downloads.openwrt.org
/snapshots
/trunk
/%S
/packages
)
36 VERSION_DIST
:=$(call qstrip_escape
,$(CONFIG_VERSION_DIST
))
37 VERSION_DIST
:=$(if
$(VERSION_DIST
),$(VERSION_DIST
),OpenWrt
)
39 VERSION_MANUFACTURER
:=$(call qstrip_escape
,$(CONFIG_VERSION_MANUFACTURER
))
40 VERSION_MANUFACTURER
:=$(if
$(VERSION_MANUFACTURER
),$(VERSION_MANUFACTURER
),OpenWrt
)
42 VERSION_MANUFACTURER_URL
:=$(call qstrip_escape
,$(CONFIG_VERSION_MANUFACTURER_URL
))
43 VERSION_MANUFACTURER_URL
:=$(if
$(VERSION_MANUFACTURER_URL
),$(VERSION_MANUFACTURER_URL
),http
://www.openwrt.org
/)
45 VERSION_PRODUCT
:=$(call qstrip_escape
,$(CONFIG_VERSION_PRODUCT
))
46 VERSION_PRODUCT
:=$(if
$(VERSION_PRODUCT
),$(VERSION_PRODUCT
),Generic
)
48 VERSION_HWREV
:=$(call qstrip_escape
,$(CONFIG_VERSION_HWREV
))
49 VERSION_HWREV
:=$(if
$(VERSION_HWREV
),$(VERSION_HWREV
),v0
)
52 $(CONFIG_
$(firstword $(subst :, ,$(subst +,,$(subst -,,$(1))))))
56 $(lastword
$(subst :, ,$(1)))
59 VERSION_TAINT_SPECS
:= \
64 +BUSYBOX_CUSTOM
:busybox \
65 +OVERRIDE_PKGS
:override \
67 VERSION_TAINTS
:= $(strip $(foreach taint
,$(VERSION_TAINT_SPECS
), \
68 $(if
$(findstring +,$(taint
)), \
69 $(if
$(call taint2sym
,$(taint
)),$(call taint2name
,$(taint
))), \
70 $(if
$(call taint2sym
,$(taint
)),,$(call taint2name
,$(taint
))) \
73 PKG_CONFIG_DEPENDS
+= $(foreach taint
,$(VERSION_TAINT_SPECS
),$(call taint2sym
,$(taint
)))
75 VERSION_SED
:=$(SED
) 's,%U,$(VERSION_REPO),g' \
76 -e
's,%V,$(VERSION_NUMBER),g' \
77 -e
's,%v,\L$(subst $(space),_,$(VERSION_NUMBER)),g' \
78 -e
's,%C,$(VERSION_CODE),g' \
79 -e
's,%c,\L$(subst $(space),_,$(VERSION_CODE)),g' \
80 -e
's,%N,$(VERSION_NICK),g' \
81 -e
's,%n,\L$(subst $(space),_,$(VERSION_NICK)),g' \
82 -e
's,%D,$(VERSION_DIST),g' \
83 -e
's,%d,\L$(subst $(space),_,$(VERSION_DIST)),g' \
84 -e
's,%R,$(REVISION),g' \
85 -e
's,%T,$(BOARD),g' \
86 -e
's,%S,$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic),g' \
87 -e
's,%t,$(VERSION_TAINTS),g' \
88 -e
's,%M,$(VERSION_MANUFACTURER),g' \
89 -e
's,%m,$(VERSION_MANUFACTURER_URL),g' \
90 -e
's,%P,$(VERSION_PRODUCT),g' \
91 -e
's,%h,$(VERSION_HWREV),g'
93 VERSION_SED_SCRIPT
:=$(subst '\'','\'\\\\\'\'',$(VERSION_SED
))