gluon.mk 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. GLUON_OPENWRTDIR = $(BOARD_BUILDDIR)/openwrt
  12. $(GLUON_SITEDIR)/site.mk:
  13. $(error There was no site configuration found. Please check out a site configuration to $(GLUON_SITEDIR))
  14. -include $(GLUON_SITEDIR)/site.mk
  15. GLUON_VERSION := $(shell cd $(GLUONDIR) && git describe --always 2>/dev/null || echo unknown)
  16. export GLUON_VERSION
  17. ifeq ($(OPENWRT_BUILD),1)
  18. ifeq ($(GLUON_TOOLS),1)
  19. CONFIG_VERSION_REPO := $(shell $(GLUONDIR)/scripts/site.sh opkg_repo || echo http://downloads.openwrt.org/barrier_breaker/14.07/%S/packages)
  20. export CONFIG_VERSION_REPO
  21. GLUON_SITE_CODE := $(shell $(GLUONDIR)/scripts/site.sh site_code)
  22. export GLUON_SITE_CODE
  23. ifeq ($(GLUON_RELEASE),)
  24. $(error GLUON_RELEASE not set. GLUON_RELEASE can be set in site.mk or on the command line.)
  25. endif
  26. export GLUON_RELEASE
  27. endif
  28. endif
  29. define merge-lists
  30. $(1) :=
  31. $(foreach var,$(2),$(1) := $$(filter-out -% $$(patsubst -%,%,$$(filter -%,$$($(var)))),$$($(1)) $$($(var)))
  32. )
  33. endef
  34. GLUON_TARGETS :=
  35. define GluonTarget
  36. gluon_target := $(1)$$(if $(2),-$(2))
  37. GLUON_TARGETS += $$(gluon_target)
  38. GLUON_TARGET_$$(gluon_target)_BOARD := $(1)
  39. GLUON_TARGET_$$(gluon_target)_SUBTARGET := $(2)
  40. endef
  41. GLUON_DEFAULT_PACKAGES := gluon-core kmod-ipv6 firewall ip6tables -uboot-envtools
  42. override DEFAULT_PACKAGES.router :=
  43. endif #__gluon_inc