include, base-files, opkg: introduce version configuration to override the embedded...
[openwrt/staging/mkresin.git] / include / version.mk
1 #
2 # Copyright (C) 2012 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 PKG_CONFIG_DEPENDS += \
9 CONFIG_VERSION_NUMBER \
10 CONFIG_VERSION_NICK \
11 CONFIG_VERSION_REPO \
12 CONFIG_VERSION_DIST
13
14 VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
15 VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),$(REVISION))
16
17 VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
18 VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),Bleeding Edge)
19
20 VERSION_NICK:=$(call qstrip,$(CONFIG_VERSION_NICK))
21 VERSION_NICK:=$(if $(VERSION_NICK),$(VERSION_NICK),$(RELEASE))
22
23 VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
24 VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.openwrt.org/snapshots/trunk/%T/packages)
25
26 VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
27 VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)
28
29 VERSION_SED:=$(SED) 's,%U,$(VERSION_REPO),g' \
30 -e 's,%V,$(VERSION_NUMBER),g' \
31 -e 's,%v,\L$(subst $(space),_,$(VERSION_NUMBER)),g' \
32 -e 's,%C,$(VERSION_CODE),g' \
33 -e 's,%c,\L$(subst $(space),_,$(VERSION_CODE)),g' \
34 -e 's,%N,$(VERSION_NICK),g' \
35 -e 's,%n,\L$(subst $(space),_,$(VERSION_NICK)),g' \
36 -e 's,%D,$(VERSION_DIST),g' \
37 -e 's,%d,\L$(subst $(space),_,$(VERSION_DIST)),g' \
38 -e 's,%R,$(REVISION),g' \
39 -e 's,%T,$(BOARD),g' \
40 -e 's,%S,$(BOARD)$(if $(SUBTARGET),/$(SUBTARGET)),g' \