gluon.mk 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ifneq ($(__gluon_inc),1)
  2. __gluon_inc=1
  3. GLUON_ORIGOPENWRTDIR := $(GLUONDIR)/openwrt
  4. GLUON_SITEDIR := $(GLUONDIR)/site
  5. GLUON_SITE_CONFIG := $(GLUON_SITEDIR)/site.conf
  6. GLUON_IMAGEDIR ?= $(GLUONDIR)/images
  7. GLUON_BUILDDIR ?= $(GLUONDIR)/build
  8. GLUON_OPENWRTDIR = $(GLUON_BUILDDIR)/$(GLUON_TARGET)/openwrt
  9. BOARD_BUILDDIR = $(GLUON_BUILDDIR)/$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))
  10. BOARD_KDIR = $(BOARD_BUILDDIR)/kernel
  11. export GLUONDIR GLUON_SITEDIR GLUON_SITE_CONFIG GLUON_IMAGEDIR GLUON_OPENWRTDIR GLUON_BUILDDIR
  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/attitude_adjustment/12.09/%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) := $$(sort $$(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. regex-escape = $(shell echo '$(1)' | sed -e 's/[]\/()$*.^|[]/\\&/g')
  42. GLUON_DEFAULT_PACKAGES := gluon-core kmod-ipv6 firewall ip6tables -uboot-envtools -kmod-usb-core -kmod-usb2 -kmod-ledtrig-usbdev
  43. override DEFAULT_PACKAGES.router :=
  44. endif #__gluon_inc