gluon.mk 2.1 KB

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