Skip to content
Snippets Groups Projects
Commit d297ec7b authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

Further flesh out build system

parent 426a868b
No related branches found
No related tags found
No related merge requests found
*~
/build
/images
/site
TOPDIR:=${CURDIR}
GLUONDIR:=${CURDIR}
LN_S:=ln -sf
IMAGEDIR:=$(TOPDIR)/images
OPENWRTDIR:=$(TOPDIR)/openwrt
BUILDERDIR:=$(TOPDIR)/builder
all: images
include $(GLUONDIR)/builder/gluon.mk
BOARD:=ar71xx
PROFILES:=TLWR741
null :=
space := ${null} ${null}
${space} := ${space}
prepare:
mkdir -p $(GLUON_IMAGEDIR) $(GLUON_BUILDDIR)
$(LN_S) $(GLUON_BUILDERDIR)/feeds.conf $(GLUON_OPENWRTDIR)/feeds.conf
echo 'src packages file:../openwrt/bin/$(BOARD)/packages' > $(GLUON_BUILDDIR)/opkg-$(BOARD).conf
echo 'CONFIG_TARGET_$(BOARD)=y' > $(GLUON_OPENWRTDIR)/.config
echo -e "$(subst ${ },\n,$(patsubst %,CONFIG_PACKAGE_%=m,$(GLUON_PACKAGES)))" >> $(GLUON_OPENWRTDIR)/.config
$(MAKE) -C $(GLUON_OPENWRTDIR) defconfig package/symlinks prepare package/compile
image-%: prepare
$(MAKE) -C $(GLUON_BUILDERDIR) image \
BIN_DIR=$(GLUON_IMAGEDIR) \
PACKAGE_DIR=$(GLUON_OPENWRTDIR)/bin/$(BOARD)/packages \
PROFILE=$(subst image-,,$@)
all :
mkdir -p $(IMAGEDIR)
$(LN_S) $(BUILDERDIR)/feeds.conf $(OPENWRTDIR)/feeds.conf
$(LN_S) $(BUILDERDIR)/config-$(BOARD) $(OPENWRTDIR)/.config
images: $(patsubst %,image-%,$(PROFILES))
$(MAKE) -C $(OPENWRTDIR) package/symlinks prepare package/compile
$(MAKE) -C $(BUILDERDIR) image BIN_DIR=$(IMAGEDIR) PACKAGE_DIR=$(OPENWRTDIR)/bin/$(BOARD)/packages PROFILE=TLWR741
.PHONY: all images prepare
......@@ -6,9 +6,11 @@
# See /LICENSE for more information.
#
BUILDERDIR:=${CURDIR}
GLUONDIR:=$(BUILDERDIR)/..
TOPDIR:=$(GLUONDIR)/openwrt
GLUONDIR:=${CURDIR}/..
include ${CURDIR}/gluon.mk
TOPDIR:=$(GLUON_OPENWRTDIR)
LC_ALL:=C
LANG:=C
export TOPDIR LC_ALL LANG
......@@ -28,7 +30,7 @@ include $(INCLUDE_DIR)/depends.mk
include $(INCLUDE_DIR)/version.mk
REVISION:=$(shell $(BUILDERDIR)/openwrt_rev.sh $(GLUONDIR))
REVISION:=$(shell $(GLUON_BUILDERDIR)/openwrt_rev.sh $(GLUONDIR))
export REVISION
define Helptext
......@@ -64,7 +66,7 @@ OPKG:= \
IPKG_CONF_DIR="$(TOPDIR)/tmp" \
IPKG_OFFLINE_ROOT="$(TARGET_DIR)" \
$(STAGING_DIR_HOST)/bin/opkg \
-f $(BUILDERDIR)/repositories.conf \
-f $(GLUONDIR)/build/opkg-$(BOARD).conf \
--force-depends \
--force-overwrite \
--force-postinstall \
......@@ -183,7 +185,7 @@ image:
$(if $(PROFILE),USER_PROFILE="$(PROFILE)") \
$(if $(FILES),USER_FILES="$(FILES)") \
$(if $(PACKAGES),USER_PACKAGES="$(PACKAGES)") \
$(if $(BIN_DIR),BIN_DIR="$(BIN_DIR)") \
BIN_DIR="$(GLUON_IMAGEDIR)" \
$(if $(PACKAGE_DIR),PACKAGE_DIR="$(PACKAGE_DIR)"))
.SILENT: help info image
......
This diff is collapsed.
ifneq ($(__gluon_inc),1)
__gluon_inc=1
GLUON_SITEDIR:=$(GLUONDIR)/site
GLUON_IMAGEDIR:=$(GLUONDIR)/images
GLUON_OPENWRTDIR:=$(GLUONDIR)/openwrt
GLUON_BUILDERDIR:=$(GLUONDIR)/builder
GLUON_BUILDDIR:=$(GLUONDIR)/build
$(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
GLUON_DEFAULT_PACKAGES:=gluon-core
GLUON_PACKAGES:=$(GLUON_DEFAULT_PACKAGES) $(GLUON_SITE_PACKAGES)
DEFAULT_PACKAGES.gluon:=$(GLUON_PACKAGES)
DEVICE_TYPE:=gluon
endif #__gluon_inc
## Place your custom repositories here, they must match the architecture and version.
# src/gz attitude_adjustment http://downloads.openwrt.org/attitude_adjustment/12.09-rc1/ar71xx/generic/packages
# src custom file:///usr/src/openwrt/bin/ar71xx/packages
## This is the local package repository, do not remove!
src packages file:../openwrt/bin/ar71xx/packages
Subproject commit 3a1b6541b43d4801608c391d64582af41e7a155a
Subproject commit 374302cae2f6117a445d962f5771b7ed75bed9d5
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment