Further flesh out build system

This commit is contained in:
Matthias Schiffer 2013-02-11 23:06:19 +01:00
parent 426a868bb4
commit d297ec7b08
7 changed files with 59 additions and 3908 deletions

2
.gitignore vendored
View File

@ -1,2 +1,4 @@
*~ *~
/build
/images /images
/site

View File

@ -1,17 +1,33 @@
TOPDIR:=${CURDIR} GLUONDIR:=${CURDIR}
LN_S:=ln -sf LN_S:=ln -sf
IMAGEDIR:=$(TOPDIR)/images all: images
OPENWRTDIR:=$(TOPDIR)/openwrt
BUILDERDIR:=$(TOPDIR)/builder include $(GLUONDIR)/builder/gluon.mk
BOARD:=ar71xx BOARD:=ar71xx
PROFILES:=TLWR741
all : null :=
mkdir -p $(IMAGEDIR) space := ${null} ${null}
$(LN_S) $(BUILDERDIR)/feeds.conf $(OPENWRTDIR)/feeds.conf ${space} := ${space}
$(LN_S) $(BUILDERDIR)/config-$(BOARD) $(OPENWRTDIR)/.config
$(MAKE) -C $(OPENWRTDIR) package/symlinks prepare package/compile prepare:
$(MAKE) -C $(BUILDERDIR) image BIN_DIR=$(IMAGEDIR) PACKAGE_DIR=$(OPENWRTDIR)/bin/$(BOARD)/packages PROFILE=TLWR741 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-,,$@)
images: $(patsubst %,image-%,$(PROFILES))
.PHONY: all images prepare

View File

@ -6,9 +6,11 @@
# See /LICENSE for more information. # See /LICENSE for more information.
# #
BUILDERDIR:=${CURDIR} GLUONDIR:=${CURDIR}/..
GLUONDIR:=$(BUILDERDIR)/..
TOPDIR:=$(GLUONDIR)/openwrt include ${CURDIR}/gluon.mk
TOPDIR:=$(GLUON_OPENWRTDIR)
LC_ALL:=C LC_ALL:=C
LANG:=C LANG:=C
export TOPDIR LC_ALL LANG export TOPDIR LC_ALL LANG
@ -28,7 +30,7 @@ include $(INCLUDE_DIR)/depends.mk
include $(INCLUDE_DIR)/version.mk include $(INCLUDE_DIR)/version.mk
REVISION:=$(shell $(BUILDERDIR)/openwrt_rev.sh $(GLUONDIR)) REVISION:=$(shell $(GLUON_BUILDERDIR)/openwrt_rev.sh $(GLUONDIR))
export REVISION export REVISION
define Helptext define Helptext
@ -64,7 +66,7 @@ OPKG:= \
IPKG_CONF_DIR="$(TOPDIR)/tmp" \ IPKG_CONF_DIR="$(TOPDIR)/tmp" \
IPKG_OFFLINE_ROOT="$(TARGET_DIR)" \ IPKG_OFFLINE_ROOT="$(TARGET_DIR)" \
$(STAGING_DIR_HOST)/bin/opkg \ $(STAGING_DIR_HOST)/bin/opkg \
-f $(BUILDERDIR)/repositories.conf \ -f $(GLUONDIR)/build/opkg-$(BOARD).conf \
--force-depends \ --force-depends \
--force-overwrite \ --force-overwrite \
--force-postinstall \ --force-postinstall \
@ -183,7 +185,7 @@ image:
$(if $(PROFILE),USER_PROFILE="$(PROFILE)") \ $(if $(PROFILE),USER_PROFILE="$(PROFILE)") \
$(if $(FILES),USER_FILES="$(FILES)") \ $(if $(FILES),USER_FILES="$(FILES)") \
$(if $(PACKAGES),USER_PACKAGES="$(PACKAGES)") \ $(if $(PACKAGES),USER_PACKAGES="$(PACKAGES)") \
$(if $(BIN_DIR),BIN_DIR="$(BIN_DIR)") \ BIN_DIR="$(GLUON_IMAGEDIR)" \
$(if $(PACKAGE_DIR),PACKAGE_DIR="$(PACKAGE_DIR)")) $(if $(PACKAGE_DIR),PACKAGE_DIR="$(PACKAGE_DIR)"))
.SILENT: help info image .SILENT: help info image

File diff suppressed because it is too large Load Diff

22
builder/gluon.mk Normal file
View File

@ -0,0 +1,22 @@
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

View File

@ -1,6 +0,0 @@
## 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

@ -1 +1 @@
Subproject commit 3a1b6541b43d4801608c391d64582af41e7a155a Subproject commit 374302cae2f6117a445d962f5771b7ed75bed9d5