2013-02-17 15:30:59 +00:00
|
|
|
all:
|
|
|
|
|
|
|
|
LC_ALL:=C
|
|
|
|
LANG:=C
|
|
|
|
export LC_ALL LANG
|
|
|
|
|
2013-02-17 20:29:20 +00:00
|
|
|
empty:=
|
|
|
|
space:= $(empty) $(empty)
|
|
|
|
|
2013-02-17 15:30:59 +00:00
|
|
|
GLUONMAKE = $(SUBMAKE) -C $(GLUON_OPENWRTDIR) -f $(GLUONDIR)/Makefile
|
|
|
|
|
|
|
|
ifneq ($(OPENWRT_BUILD),1)
|
|
|
|
|
2013-02-11 22:06:19 +00:00
|
|
|
GLUONDIR:=${CURDIR}
|
2013-02-11 03:52:16 +00:00
|
|
|
|
2013-04-04 19:00:15 +00:00
|
|
|
include $(GLUONDIR)/include/gluon.mk
|
2013-02-11 03:52:16 +00:00
|
|
|
|
2013-02-17 15:30:59 +00:00
|
|
|
TOPDIR:=$(GLUON_OPENWRTDIR)
|
|
|
|
export TOPDIR
|
|
|
|
|
|
|
|
include $(TOPDIR)/include/host.mk
|
|
|
|
|
|
|
|
_SINGLE=export MAKEFLAGS=$(space);
|
|
|
|
|
|
|
|
override OPENWRT_BUILD=1
|
2013-04-04 19:00:15 +00:00
|
|
|
override REVISION:=$(shell $(GLUONDIR)/scripts/openwrt_rev.sh $(GLUONDIR))
|
2013-02-17 15:30:59 +00:00
|
|
|
GREP_OPTIONS=
|
2013-02-17 23:39:44 +00:00
|
|
|
export OPENWRT_BUILD GREP_OPTIONS REVISION
|
|
|
|
|
2013-02-17 15:30:59 +00:00
|
|
|
include $(TOPDIR)/include/debug.mk
|
|
|
|
include $(TOPDIR)/include/depends.mk
|
2013-04-04 19:00:15 +00:00
|
|
|
include $(GLUONDIR)/include/toplevel.mk
|
2013-02-17 15:30:59 +00:00
|
|
|
|
2013-03-07 20:50:15 +00:00
|
|
|
define GluonProfile
|
|
|
|
image/$(1): FORCE
|
|
|
|
+@$$(GLUONMAKE) $$@
|
|
|
|
endef
|
|
|
|
|
2013-04-04 19:00:15 +00:00
|
|
|
include $(GLUONDIR)/include/profiles.mk
|
2013-03-07 20:50:15 +00:00
|
|
|
|
2013-02-17 15:30:59 +00:00
|
|
|
all: FORCE
|
|
|
|
+@$(GLUONMAKE) prepare
|
|
|
|
+@$(GLUONMAKE) images
|
|
|
|
|
|
|
|
prepare: FORCE
|
|
|
|
+@$(GLUONMAKE) prepare
|
|
|
|
|
|
|
|
images: FORCE
|
|
|
|
+@$(GLUONMAKE) images
|
|
|
|
|
|
|
|
clean: clean-gluon
|
|
|
|
|
|
|
|
clean-gluon:
|
|
|
|
rm -rf $(GLUON_BUILDDIR)
|
|
|
|
|
|
|
|
else
|
2013-02-11 22:06:19 +00:00
|
|
|
|
2013-04-04 19:00:15 +00:00
|
|
|
include $(GLUONDIR)/include/gluon.mk
|
2013-02-11 03:52:16 +00:00
|
|
|
|
2013-02-17 15:30:59 +00:00
|
|
|
include $(TOPDIR)/include/host.mk
|
|
|
|
|
|
|
|
include rules.mk
|
|
|
|
include $(INCLUDE_DIR)/depends.mk
|
|
|
|
include $(INCLUDE_DIR)/subdir.mk
|
2013-02-17 23:39:44 +00:00
|
|
|
include $(INCLUDE_DIR)/kernel.mk
|
|
|
|
|
2013-02-17 15:30:59 +00:00
|
|
|
include package/Makefile
|
|
|
|
include tools/Makefile
|
|
|
|
include toolchain/Makefile
|
2013-02-11 22:06:19 +00:00
|
|
|
|
2013-02-17 15:30:59 +00:00
|
|
|
BOARD := ar71xx
|
|
|
|
PROFILES :=
|
|
|
|
PROFILE_PACKAGES :=
|
|
|
|
|
|
|
|
gluon_prepared_stamp := $(GLUON_BUILDDIR)/$(BOARD)/prepared
|
2013-02-12 06:14:18 +00:00
|
|
|
|
|
|
|
define GluonProfile
|
2013-02-17 15:30:59 +00:00
|
|
|
image/$(1): $(gluon_prepared_stamp)
|
2013-02-19 15:58:48 +00:00
|
|
|
$(NO_TRACE_MAKE) -C $(GLUON_BUILDERDIR) image PROFILE="$(1)"
|
2013-02-12 06:14:18 +00:00
|
|
|
|
|
|
|
PROFILES += $(1)
|
2013-02-19 16:06:50 +00:00
|
|
|
PROFILE_PACKAGES += $(filter-out -%,$(2) $(GLUON_$(1)_SITE_PACKAGES))
|
2013-02-12 06:14:18 +00:00
|
|
|
endef
|
|
|
|
|
2013-04-04 19:00:15 +00:00
|
|
|
include $(GLUONDIR)/include/profiles.mk
|
2013-02-17 15:30:59 +00:00
|
|
|
|
|
|
|
$(BUILD_DIR)/.prepared: Makefile
|
|
|
|
@mkdir -p $$(dirname $@)
|
|
|
|
@touch $@
|
|
|
|
|
|
|
|
$(toolchain/stamp-install): $(tools/stamp-install)
|
2013-02-17 23:39:44 +00:00
|
|
|
$(package/stamp-compile): $(package/stamp-cleanup)
|
2013-02-17 15:30:59 +00:00
|
|
|
|
|
|
|
feeds: FORCE
|
|
|
|
ln -sf $(GLUON_BUILDERDIR)/feeds.conf feeds.conf
|
2013-02-12 01:03:37 +00:00
|
|
|
|
2013-02-17 15:30:59 +00:00
|
|
|
scripts/feeds uninstall -a
|
|
|
|
scripts/feeds update -a
|
2013-02-17 20:29:20 +00:00
|
|
|
|
2013-02-17 15:30:59 +00:00
|
|
|
scripts/feeds install -a
|
|
|
|
|
|
|
|
rm -f $(TMP_DIR)/info/.files-packageinfo-$(SCAN_COOKIE)
|
|
|
|
$(SUBMAKE) prepare-tmpinfo OPENWRT_BUILD=0
|
|
|
|
|
|
|
|
config: FORCE
|
2013-02-19 16:06:50 +00:00
|
|
|
echo -e 'CONFIG_TARGET_$(BOARD)=y\nCONFIG_TARGET_ROOTFS_JFFS2=n\n$(subst ${space},\n,$(patsubst %,CONFIG_PACKAGE_%=m,$(sort $(GLUON_DEFAULT_PACKAGES) $(GLUON_SITE_PACKAGES) $(PROFILE_PACKAGES))))' > .config
|
2013-02-17 15:30:59 +00:00
|
|
|
$(SUBMAKE) defconfig OPENWRT_BUILD=0
|
|
|
|
|
|
|
|
toolchain: $(toolchain/stamp-install) $(tools/stamp-install)
|
2013-02-17 23:39:44 +00:00
|
|
|
|
|
|
|
kernel: FORCE
|
|
|
|
$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD) -f $(GLUON_BUILDERDIR)/Makefile.target $(LINUX_DIR)/.image TARGET_BUILD=1
|
|
|
|
$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD) -f $(GLUON_BUILDERDIR)/Makefile.target $(LINUX_DIR)/.modules TARGET_BUILD=1
|
|
|
|
|
2013-02-17 15:30:59 +00:00
|
|
|
packages: $(package/stamp-compile)
|
2013-02-17 23:39:44 +00:00
|
|
|
$(_SINGLE)$(SUBMAKE) -r package/index
|
|
|
|
|
|
|
|
prepare-image: FORCE
|
|
|
|
rm -rf $(BOARD_KDIR)
|
|
|
|
mkdir -p $(BOARD_KDIR)
|
|
|
|
cp $(KERNEL_BUILD_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux.elf $(BOARD_KDIR)/
|
|
|
|
$(SUBMAKE) -C $(TOPDIR)/target/linux/$(BOARD)/image -f $(GLUON_BUILDERDIR)/Makefile.image prepare KDIR="$(BOARD_KDIR)"
|
2013-02-17 15:30:59 +00:00
|
|
|
|
|
|
|
prepare: FORCE
|
2013-02-13 08:58:25 +00:00
|
|
|
mkdir -p $(GLUON_IMAGEDIR) $(GLUON_BUILDDIR)/$(BOARD)
|
|
|
|
echo 'src packages file:../openwrt/bin/$(BOARD)/packages' > $(GLUON_BUILDDIR)/$(BOARD)/opkg.conf
|
2013-02-11 22:06:19 +00:00
|
|
|
|
2013-02-17 15:30:59 +00:00
|
|
|
$(GLUONMAKE) feeds
|
|
|
|
$(GLUONMAKE) config
|
|
|
|
$(GLUONMAKE) toolchain
|
2013-02-17 23:39:44 +00:00
|
|
|
$(GLUONMAKE) kernel
|
2013-02-17 15:30:59 +00:00
|
|
|
$(GLUONMAKE) packages
|
2013-02-17 23:39:44 +00:00
|
|
|
$(GLUONMAKE) prepare-image
|
2013-02-12 01:03:37 +00:00
|
|
|
|
2013-02-17 15:30:59 +00:00
|
|
|
touch $(gluon_prepared_stamp)
|
2013-02-12 01:03:37 +00:00
|
|
|
|
2013-02-17 15:58:07 +00:00
|
|
|
$(gluon_prepared_stamp):
|
2013-02-17 20:39:40 +00:00
|
|
|
$(GLUONMAKE) prepare
|
2013-02-11 22:06:19 +00:00
|
|
|
|
2013-02-19 15:58:48 +00:00
|
|
|
call_image/%: FORCE
|
|
|
|
$(GLUONMAKE) $(patsubst call_image/%,image/%,$@)
|
|
|
|
|
|
|
|
images: $(patsubst %,call_image/%,$(PROFILES)) ;
|
2013-02-11 03:52:16 +00:00
|
|
|
|
2013-02-12 01:03:37 +00:00
|
|
|
.PHONY: all images prepare clean cleanall
|
2013-02-17 15:30:59 +00:00
|
|
|
|
|
|
|
endif
|