2 # Copyright (C) 2012 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_PRODUCT \
18 CONFIG_VERSION_HWREV \
20 qstrip_escape=$(subst ','\'',$(call qstrip,$(1)))
23 VERSION_NUMBER:=$(call qstrip_escape,$(CONFIG_VERSION_NUMBER))
24 VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),$(REVISION))
26 VERSION_CODE:=$(call qstrip_escape,$(CONFIG_VERSION_NUMBER))
27 VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),Bleeding Edge)
29 VERSION_NICK:=$(call qstrip_escape,$(CONFIG_VERSION_NICK))
30 VERSION_NICK:=$(if $(VERSION_NICK),$(VERSION_NICK),$(RELEASE))
32 VERSION_REPO:=$(call qstrip_escape,$(CONFIG_VERSION_REPO))
33 VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.openwrt.org/snapshots/trunk/%T/packages)
35 VERSION_DIST:=$(call qstrip_escape,$(CONFIG_VERSION_DIST))
36 VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)
38 VERSION_MANUFACTURER:=$(call qstrip_escape,$(CONFIG_VERSION_MANUFACTURER))
39 VERSION_MANUFACTURER:=$(if $(VERSION_MANUFACTURER),$(VERSION_MANUFACTURER),OpenWrt)
41 VERSION_PRODUCT:=$(call qstrip_escape,$(CONFIG_VERSION_PRODUCT))
42 VERSION_PRODUCT:=$(if $(VERSION_PRODUCT),$(VERSION_PRODUCT),Generic)
44 VERSION_HWREV:=$(call qstrip_escape,$(CONFIG_VERSION_HWREV))
45 VERSION_HWREV:=$(if $(VERSION_HWREV),$(VERSION_HWREV),v0)
48 $(CONFIG_$(firstword $(subst :, ,$(subst +,,$(subst -,,$(1))))))
52 $(lastword $(subst :, ,$(1)))
55 VERSION_TAINT_SPECS := \
60 +BUSYBOX_CUSTOM:busybox \
62 VERSION_TAINTS := $(strip $(foreach taint,$(VERSION_TAINT_SPECS), \
63 $(if $(findstring +,$(taint)), \
64 $(if $(call taint2sym,$(taint)),$(call taint2name,$(taint))), \
65 $(if $(call taint2sym,$(taint)),,$(call taint2name,$(taint))) \
68 PKG_CONFIG_DEPENDS += $(foreach taint,$(VERSION_TAINT_SPECS),$(call taint2sym,$(taint)))
70 VERSION_SED:=$(SED) 's,%U,$(VERSION_REPO),g' \
71 -e 's,%V,$(VERSION_NUMBER),g' \
72 -e 's,%v,\L$(subst $(space),_,$(VERSION_NUMBER)),g' \
73 -e 's,%C,$(VERSION_CODE),g' \
74 -e 's,%c,\L$(subst $(space),_,$(VERSION_CODE)),g' \
75 -e 's,%N,$(VERSION_NICK),g' \
76 -e 's,%n,\L$(subst $(space),_,$(VERSION_NICK)),g' \
77 -e 's,%D,$(VERSION_DIST),g' \
78 -e 's,%d,\L$(subst $(space),_,$(VERSION_DIST)),g' \
79 -e 's,%R,$(REVISION),g' \
80 -e 's,%T,$(BOARD),g' \
81 -e 's,%S,$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic),g' \
82 -e 's,%t,$(VERSION_TAINTS),g' \
83 -e 's,%M,$(VERSION_MANUFACTURER),g' \
84 -e 's,%P,$(VERSION_PRODUCT),g' \
85 -e 's,%h,$(VERSION_HWREV),g'
87 VERSION_SED_SCRIPT:=$(subst '\'','\'\\\\\'\'',$(VERSION_SED))