gluon.mk 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. DEFAULT_OPKG_REPO := http://downloads.openwrt.org/chaos_calmer/15.05/%S/packages
  23. CONFIG_VERSION_REPO := $(shell $(GLUONDIR)/scripts/site.sh opkg_repo || echo '$(DEFAULT_OPKG_REPO)')
  24. export CONFIG_VERSION_REPO
  25. GLUON_SITE_CODE := $(shell $(GLUONDIR)/scripts/site.sh site_code)
  26. export GLUON_SITE_CODE
  27. ifeq ($(GLUON_RELEASE),)
  28. $(error GLUON_RELEASE not set. GLUON_RELEASE can be set in site.mk or on the command line.)
  29. endif
  30. export GLUON_RELEASE
  31. endif
  32. endif
  33. define merge-lists
  34. $(1) :=
  35. $(foreach var,$(2),$(1) := $$(filter-out -% $$(patsubst -%,%,$$(filter -%,$$($(var)))),$$($(1)) $$($(var)))
  36. )
  37. endef
  38. GLUON_TARGETS :=
  39. define GluonTarget
  40. gluon_target := $(1)$$(if $(2),-$(2))
  41. GLUON_TARGETS += $$(gluon_target)
  42. GLUON_TARGET_$$(gluon_target)_BOARD := $(1)
  43. GLUON_TARGET_$$(gluon_target)_SUBTARGET := $(2)
  44. endef
  45. GLUON_DEFAULT_PACKAGES := gluon-core kmod-ipv6 firewall ip6tables -uboot-envtools -wpad-mini hostapd-mini
  46. override DEFAULT_PACKAGES.router :=
  47. endif #__gluon_inc