Further flesh out build system
This commit is contained in:
parent
426a868bb4
commit
d297ec7b08
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,4 @@
|
||||
*~
|
||||
/build
|
||||
/images
|
||||
/site
|
||||
|
36
Makefile
36
Makefile
@ -1,17 +1,33 @@
|
||||
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
|
||||
|
||||
all :
|
||||
mkdir -p $(IMAGEDIR)
|
||||
$(LN_S) $(BUILDERDIR)/feeds.conf $(OPENWRTDIR)/feeds.conf
|
||||
$(LN_S) $(BUILDERDIR)/config-$(BOARD) $(OPENWRTDIR)/.config
|
||||
null :=
|
||||
space := ${null} ${null}
|
||||
${space} := ${space}
|
||||
|
||||
$(MAKE) -C $(OPENWRTDIR) package/symlinks prepare package/compile
|
||||
$(MAKE) -C $(BUILDERDIR) image BIN_DIR=$(IMAGEDIR) PACKAGE_DIR=$(OPENWRTDIR)/bin/$(BOARD)/packages PROFILE=TLWR741
|
||||
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-,,$@)
|
||||
|
||||
images: $(patsubst %,image-%,$(PROFILES))
|
||||
|
||||
.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
|
||||
|
File diff suppressed because it is too large
Load Diff
22
builder/gluon.mk
Normal file
22
builder/gluon.mk
Normal 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
|
@ -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
|
Loading…
Reference in New Issue
Block a user