gluon/include/gluon.mk

73 lines
2.1 KiB
Makefile
Raw Normal View History

2013-02-11 22:06:19 +00:00
ifneq ($(__gluon_inc),1)
__gluon_inc=1
GLUON_ORIGOPENWRTDIR := $(GLUONDIR)/openwrt
GLUON_SITEDIR := $(GLUONDIR)/site
GLUON_SITE_CONFIG := $(GLUON_SITEDIR)/site.conf
GLUON_IMAGEDIR ?= $(GLUONDIR)/images
GLUON_BUILDDIR ?= $(GLUONDIR)/build
2013-02-11 22:06:19 +00:00
GLUON_OPENWRTDIR = $(GLUON_BUILDDIR)/$(GLUON_TARGET)/openwrt
BOARD_BUILDDIR = $(GLUON_BUILDDIR)/$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))
BOARD_KDIR = $(BOARD_BUILDDIR)/kernel
export GLUONDIR GLUON_SITEDIR GLUON_SITE_CONFIG GLUON_IMAGEDIR GLUON_OPENWRTDIR GLUON_BUILDDIR
2013-02-17 15:30:59 +00:00
2013-02-11 22:06:19 +00:00
$(GLUON_SITEDIR)/site.mk:
$(error There was no site configuration found. Please check out a site configuration to $(GLUON_SITEDIR))
-include $(GLUON_SITEDIR)/site.mk
2014-02-25 10:23:52 +00:00
GLUON_VERSION := $(shell cd $(GLUONDIR) && git describe --always 2>/dev/null || echo unknown)
export GLUON_VERSION
ifeq ($(OPENWRT_BUILD),1)
ifeq ($(GLUON_TOOLS),1)
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))
export GLUON_CONFIG_VERSION
CONFIG_VERSION_REPO := $(shell $(GLUONDIR)/scripts/site.sh opkg_repo || echo http://downloads.openwrt.org/attitude_adjustment/12.09/%S/packages)
export CONFIG_VERSION_REPO
GLUON_SITE_CODE := $(shell $(GLUONDIR)/scripts/site.sh site_code)
export GLUON_SITE_CODE
2014-05-13 14:49:22 +00:00
ifeq ($(GLUON_RELEASE),)
$(error GLUON_RELEASE not set. GLUON_RELEASE can be set in site.mk or on the command line.)
endif
export GLUON_RELEASE
endif
endif
2013-02-18 23:12:23 +00:00
define merge-lists
$(1) :=
$(foreach var,$(2),$(1) := $$(sort $$(filter-out -% $$(patsubst -%,%,$$(filter -%,$$($(var)))),$$($(1)) $$($(var))))
)
endef
GLUON_TARGETS :=
define GluonTarget
gluon_target := $(1)$$(if $(2),-$(2))
GLUON_TARGETS += $$(gluon_target)
GLUON_TARGET_$$(gluon_target)_BOARD := $(1)
GLUON_TARGET_$$(gluon_target)_SUBTARGET := $(2)
include $$(GLUONDIR)/targets/$$(gluon_target)/profiles.mk
endef
regex-escape = $(shell echo '$(1)' | sed -e 's/[]\/()$*.^|[]/\\&/g')
2014-02-09 22:15:19 +00:00
GLUON_DEFAULT_PACKAGES := gluon-core kmod-ipv6 firewall ip6tables -uboot-envtools
2013-02-11 22:06:19 +00:00
2013-02-18 23:12:23 +00:00
override DEFAULT_PACKAGES.router :=
2013-02-11 22:06:19 +00:00
endif #__gluon_inc