version.mk 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. # 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_PRODUCT \
  16. CONFIG_VERSION_HWREV \
  17. qstrip_escape=$(subst ','\'',$(call qstrip,$(1)))
  18. #'
  19. VERSION_NUMBER:=$(call qstrip_escape,$(CONFIG_VERSION_NUMBER))
  20. VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),$(REVISION))
  21. VERSION_CODE:=$(call qstrip_escape,$(CONFIG_VERSION_NUMBER))
  22. VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),Bleeding Edge)
  23. VERSION_NICK:=$(call qstrip_escape,$(CONFIG_VERSION_NICK))
  24. VERSION_NICK:=$(if $(VERSION_NICK),$(VERSION_NICK),$(RELEASE))
  25. VERSION_REPO:=$(call qstrip_escape,$(CONFIG_VERSION_REPO))
  26. VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.openwrt.org/snapshots/trunk/%T/packages)
  27. VERSION_DIST:=$(call qstrip_escape,$(CONFIG_VERSION_DIST))
  28. VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),libreCMC)
  29. VERSION_MANUFACTURER:=$(call qstrip_escape,$(CONFIG_VERSION_MANUFACTURER))
  30. VERSION_MANUFACTURER:=$(if $(VERSION_MANUFACTURER),$(VERSION_MANUFACTURER),libreCMC)
  31. VERSION_PRODUCT:=$(call qstrip_escape,$(CONFIG_VERSION_PRODUCT))
  32. VERSION_PRODUCT:=$(if $(VERSION_PRODUCT),$(VERSION_PRODUCT),Generic)
  33. VERSION_HWREV:=$(call qstrip_escape,$(CONFIG_VERSION_HWREV))
  34. VERSION_HWREV:=$(if $(VERSION_HWREV),$(VERSION_HWREV),v0)
  35. define taint2sym
  36. $(CONFIG_$(firstword $(subst :, ,$(subst +,,$(subst -,,$(1))))))
  37. endef
  38. define taint2name
  39. $(lastword $(subst :, ,$(1)))
  40. endef
  41. VERSION_TAINT_SPECS := \
  42. -ALL:no-all \
  43. -IPV6:no-ipv6 \
  44. +USE_EGLIBC:eglibc \
  45. +USE_MKLIBS:mklibs \
  46. +BUSYBOX_CUSTOM:busybox \
  47. VERSION_TAINTS := $(strip $(foreach taint,$(VERSION_TAINT_SPECS), \
  48. $(if $(findstring +,$(taint)), \
  49. $(if $(call taint2sym,$(taint)),$(call taint2name,$(taint))), \
  50. $(if $(call taint2sym,$(taint)),,$(call taint2name,$(taint))) \
  51. )))
  52. PKG_CONFIG_DEPENDS += $(foreach taint,$(VERSION_TAINT_SPECS),$(call taint2sym,$(taint)))
  53. VERSION_SED:=$(SED) 's,%U,$(VERSION_REPO),g' \
  54. -e 's,%V,$(VERSION_NUMBER),g' \
  55. -e 's,%v,\L$(subst $(space),_,$(VERSION_NUMBER)),g' \
  56. -e 's,%C,$(VERSION_CODE),g' \
  57. -e 's,%c,\L$(subst $(space),_,$(VERSION_CODE)),g' \
  58. -e 's,%N,$(VERSION_NICK),g' \
  59. -e 's,%n,\L$(subst $(space),_,$(VERSION_NICK)),g' \
  60. -e 's,%D,$(VERSION_DIST),g' \
  61. -e 's,%d,\L$(subst $(space),_,$(VERSION_DIST)),g' \
  62. -e 's,%R,$(REVISION),g' \
  63. -e 's,%T,$(BOARD),g' \
  64. -e 's,%S,$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic),g' \
  65. -e 's,%t,$(VERSION_TAINTS),g' \
  66. -e 's,%M,$(VERSION_MANUFACTURER),g' \
  67. -e 's,%P,$(VERSION_PRODUCT),g' \
  68. -e 's,%h,$(VERSION_HWREV),g'
  69. VERSION_SED_SCRIPT:=$(subst '\'','\'\\\\\'\'',$(VERSION_SED))