version.mk 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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_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),Elegant Eleanor)
  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.librecmc.org/snapshots/%v/%S/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_KMODS:no-all \
  43. -IPV6:no-ipv6 \
  44. +USE_GLIBC:glibc \
  45. +USE_MKLIBS:mklibs \
  46. +BUSYBOX_CUSTOM:busybox \
  47. +OVERRIDE_PKGS:override \
  48. VERSION_TAINTS := $(strip $(foreach taint,$(VERSION_TAINT_SPECS), \
  49. $(if $(findstring +,$(taint)), \
  50. $(if $(call taint2sym,$(taint)),$(call taint2name,$(taint))), \
  51. $(if $(call taint2sym,$(taint)),,$(call taint2name,$(taint))) \
  52. )))
  53. PKG_CONFIG_DEPENDS += $(foreach taint,$(VERSION_TAINT_SPECS),$(call taint2sym,$(taint)))
  54. VERSION_SED:=$(SED) 's,%U,$(VERSION_REPO),g' \
  55. -e 's,%V,$(VERSION_NUMBER),g' \
  56. -e 's,%v,\L$(subst $(space),_,$(VERSION_NUMBER)),g' \
  57. -e 's,%C,$(VERSION_CODE),g' \
  58. -e 's,%c,\L$(subst $(space),_,$(VERSION_CODE)),g' \
  59. -e 's,%N,$(VERSION_NICK),g' \
  60. -e 's,%n,\L$(subst $(space),_,$(VERSION_NICK)),g' \
  61. -e 's,%D,$(VERSION_DIST),g' \
  62. -e 's,%d,\L$(subst $(space),_,$(VERSION_DIST)),g' \
  63. -e 's,%R,$(REVISION),g' \
  64. -e 's,%T,$(BOARD),g' \
  65. -e 's,%S,$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic),g' \
  66. -e 's,%t,$(VERSION_TAINTS),g' \
  67. -e 's,%M,$(VERSION_MANUFACTURER),g' \
  68. -e 's,%P,$(VERSION_PRODUCT),g' \
  69. -e 's,%h,$(VERSION_HWREV),g'
  70. VERSION_SED_SCRIPT:=$(subst '\'','\'\\\\\'\'',$(VERSION_SED))