gluon.mk 1.7 KB

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