version.mk 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #
  2. # Copyright (C) 2012-2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. # Substituted by SDK, do not remove
  8. # REVISION:=x
  9. PKG_CONFIG_DEPENDS += \
  10. CONFIG_VERSION_NUMBER \
  11. CONFIG_VERSION_NICK \
  12. CONFIG_VERSION_REPO \
  13. CONFIG_VERSION_DIST \
  14. CONFIG_VERSION_MANUFACTURER \
  15. CONFIG_VERSION_MANUFACTURER_URL \
  16. CONFIG_VERSION_PRODUCT \
  17. CONFIG_VERSION_HWREV \
  18. qstrip_escape=$(subst ','\'',$(call qstrip,$(1)))
  19. #'
  20. VERSION_NUMBER:=$(call qstrip_escape,$(CONFIG_VERSION_NUMBER))
  21. VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),$(REVISION))
  22. VERSION_CODE:=$(call qstrip_escape,$(CONFIG_VERSION_NUMBER))
  23. VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),Bleeding Edge)
  24. VERSION_NICK:=$(call qstrip_escape,$(CONFIG_VERSION_NICK))
  25. VERSION_NICK:=$(if $(VERSION_NICK),$(VERSION_NICK),$(RELEASE))
  26. VERSION_REPO:=$(call qstrip_escape,$(CONFIG_VERSION_REPO))
  27. VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.openwrt.org/snapshots/trunk/%S/packages)
  28. VERSION_DIST:=$(call qstrip_escape,$(CONFIG_VERSION_DIST))
  29. VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)
  30. VERSION_MANUFACTURER:=$(call qstrip_escape,$(CONFIG_VERSION_MANUFACTURER))
  31. VERSION_MANUFACTURER:=$(if $(VERSION_MANUFACTURER),$(VERSION_MANUFACTURER),OpenWrt)
  32. VERSION_MANUFACTURER_URL:=$(call qstrip_escape,$(CONFIG_VERSION_MANUFACTURER_URL))
  33. VERSION_MANUFACTURER_URL:=$(if $(VERSION_MANUFACTURER_URL),$(VERSION_MANUFACTURER_URL),http://www.openwrt.org/)
  34. VERSION_PRODUCT:=$(call qstrip_escape,$(CONFIG_VERSION_PRODUCT))
  35. VERSION_PRODUCT:=$(if $(VERSION_PRODUCT),$(VERSION_PRODUCT),Generic)
  36. VERSION_HWREV:=$(call qstrip_escape,$(CONFIG_VERSION_HWREV))
  37. VERSION_HWREV:=$(if $(VERSION_HWREV),$(VERSION_HWREV),v0)
  38. define taint2sym
  39. $(CONFIG_$(firstword $(subst :, ,$(subst +,,$(subst -,,$(1))))))
  40. endef
  41. define taint2name
  42. $(lastword $(subst :, ,$(1)))
  43. endef
  44. VERSION_TAINT_SPECS := \
  45. -ALL_KMODS:no-all \
  46. -IPV6:no-ipv6 \
  47. +USE_GLIBC:glibc \
  48. +USE_MKLIBS:mklibs \
  49. +BUSYBOX_CUSTOM:busybox \
  50. +OVERRIDE_PKGS:override \
  51. VERSION_TAINTS := $(strip $(foreach taint,$(VERSION_TAINT_SPECS), \
  52. $(if $(findstring +,$(taint)), \
  53. $(if $(call taint2sym,$(taint)),$(call taint2name,$(taint))), \
  54. $(if $(call taint2sym,$(taint)),,$(call taint2name,$(taint))) \
  55. )))
  56. PKG_CONFIG_DEPENDS += $(foreach taint,$(VERSION_TAINT_SPECS),$(call taint2sym,$(taint)))
  57. VERSION_SED:=$(SED) 's,%U,$(VERSION_REPO),g' \
  58. -e 's,%V,$(VERSION_NUMBER),g' \
  59. -e 's,%v,\L$(subst $(space),_,$(VERSION_NUMBER)),g' \
  60. -e 's,%C,$(VERSION_CODE),g' \
  61. -e 's,%c,\L$(subst $(space),_,$(VERSION_CODE)),g' \
  62. -e 's,%N,$(VERSION_NICK),g' \
  63. -e 's,%n,\L$(subst $(space),_,$(VERSION_NICK)),g' \
  64. -e 's,%D,$(VERSION_DIST),g' \
  65. -e 's,%d,\L$(subst $(space),_,$(VERSION_DIST)),g' \
  66. -e 's,%R,$(REVISION),g' \
  67. -e 's,%T,$(BOARD),g' \
  68. -e 's,%S,$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic),g' \
  69. -e 's,%t,$(VERSION_TAINTS),g' \
  70. -e 's,%M,$(VERSION_MANUFACTURER),g' \
  71. -e 's,%m,$(VERSION_MANUFACTURER_URL),g' \
  72. -e 's,%P,$(VERSION_PRODUCT),g' \
  73. -e 's,%h,$(VERSION_HWREV),g'
  74. VERSION_SED_SCRIPT:=$(subst '\'','\'\\\\\'\'',$(VERSION_SED))