gluon.mk 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. ifneq ($(__gluon_inc),1)
  2. __gluon_inc=1
  3. GLUON_SITEDIR ?= $(GLUONDIR)/site
  4. GLUON_BUILDDIR ?= $(GLUONDIR)/build
  5. GLUON_ORIGOPENWRTDIR := $(GLUONDIR)/openwrt
  6. GLUON_SITE_CONFIG := $(GLUON_SITEDIR)/site.conf
  7. GLUON_OUTPUTDIR ?= $(GLUONDIR)/output
  8. GLUON_IMAGEDIR ?= $(GLUON_OUTPUTDIR)/images
  9. GLUON_MODULEDIR ?= $(GLUON_OUTPUTDIR)/modules
  10. GLUON_OPKG_KEY ?= $(GLUON_BUILDDIR)/gluon-opkg-key
  11. export GLUONDIR GLUON_SITEDIR GLUON_BUILDDIR GLUON_SITE_CONFIG GLUON_OUTPUTDIR GLUON_IMAGEDIR GLUON_MODULEDIR
  12. BOARD_BUILDDIR = $(GLUON_BUILDDIR)/$(GLUON_TARGET)
  13. BOARD_KDIR = $(BOARD_BUILDDIR)/kernel
  14. export BOARD_BUILDDIR
  15. LINUX_RELEASE := 2
  16. export LINUX_RELEASE
  17. GLUON_OPENWRTDIR = $(BOARD_BUILDDIR)/openwrt
  18. $(GLUON_SITEDIR)/site.mk:
  19. $(error There was no site configuration found. Please check out a site configuration to $(GLUON_SITEDIR))
  20. -include $(GLUON_SITEDIR)/site.mk
  21. GLUON_VERSION := $(shell cd $(GLUONDIR) && git describe --always --dirty=+ 2>/dev/null || echo unknown)
  22. export GLUON_VERSION
  23. GLUON_SITE_VERSION := $(shell cd $(GLUON_SITEDIR) && git --git-dir=.git describe --always --dirty=+ 2>/dev/null || echo unknown)
  24. export GLUON_SITE_VERSION
  25. GLUON_LANGS ?= en
  26. export GLUON_LANGS
  27. ifeq ($(OPENWRT_BUILD),1)
  28. ifeq ($(GLUON_TOOLS),1)
  29. GLUON_OPENWRT_FEEDS := base packages luci routing telephony management
  30. export GLUON_OPENWRT_FEEDS
  31. GLUON_SITE_CODE := $(shell $(GLUONDIR)/scripts/site.sh site_code)
  32. export GLUON_SITE_CODE
  33. ifeq ($(GLUON_RELEASE),)
  34. $(error GLUON_RELEASE not set. GLUON_RELEASE can be set in site.mk or on the command line.)
  35. endif
  36. export GLUON_RELEASE
  37. endif
  38. endif
  39. define merge-lists
  40. $(1) :=
  41. $(foreach var,$(2),$(1) := $$(filter-out -% $$(patsubst -%,%,$$(filter -%,$$($(var)))),$$($(1)) $$($(var)))
  42. )
  43. endef
  44. GLUON_TARGETS :=
  45. define GluonTarget
  46. gluon_target := $(1)$$(if $(2),-$(2))
  47. GLUON_TARGETS += $$(gluon_target)
  48. GLUON_TARGET_$$(gluon_target)_BOARD := $(1)
  49. GLUON_TARGET_$$(gluon_target)_SUBTARGET := $(2)
  50. endef
  51. GLUON_DEFAULT_PACKAGES := gluon-core firewall ip6tables -uboot-envtools -wpad-mini hostapd-mini
  52. override DEFAULT_PACKAGES.router :=
  53. endif #__gluon_inc