2013-02-11 22:06:19 +00:00
|
|
|
GLUONDIR:=${CURDIR}
|
2013-02-11 03:52:16 +00:00
|
|
|
|
|
|
|
LN_S:=ln -sf
|
|
|
|
|
2013-02-13 01:36:39 +00:00
|
|
|
all:
|
|
|
|
$(MAKE) prepare
|
|
|
|
$(MAKE) images
|
2013-02-11 22:06:19 +00:00
|
|
|
|
|
|
|
include $(GLUONDIR)/builder/gluon.mk
|
2013-02-11 03:52:16 +00:00
|
|
|
|
2013-02-12 06:14:18 +00:00
|
|
|
BOARD := ar71xx
|
|
|
|
PROFILES :=
|
|
|
|
PROFILE_PACKAGES :=
|
2013-02-11 22:06:19 +00:00
|
|
|
|
|
|
|
null :=
|
|
|
|
space := ${null} ${null}
|
|
|
|
${space} := ${space}
|
|
|
|
|
2013-02-12 06:14:18 +00:00
|
|
|
prepared_stamp := $(GLUON_BUILDDIR)/prepared
|
|
|
|
|
|
|
|
define GluonProfile
|
|
|
|
image/$(1): $(prepared_stamp)
|
|
|
|
$(MAKE) -C $(GLUON_BUILDERDIR) image \
|
|
|
|
PROFILE="$(1)" \
|
|
|
|
PACKAGE_DIR="$(GLUON_OPENWRTDIR)/bin/$(BOARD)/packages" \
|
|
|
|
$(if $(2),PACKAGES="$(2)")
|
|
|
|
|
|
|
|
PROFILES += $(1)
|
|
|
|
PROFILE_PACKAGES += $(filter-out -%,$(2))
|
|
|
|
endef
|
|
|
|
|
|
|
|
include profiles.mk
|
2013-02-12 01:03:37 +00:00
|
|
|
|
2013-02-11 22:06:19 +00:00
|
|
|
prepare:
|
|
|
|
mkdir -p $(GLUON_IMAGEDIR) $(GLUON_BUILDDIR)
|
|
|
|
echo 'src packages file:../openwrt/bin/$(BOARD)/packages' > $(GLUON_BUILDDIR)/opkg-$(BOARD).conf
|
|
|
|
|
2013-02-11 23:09:22 +00:00
|
|
|
$(LN_S) $(GLUON_BUILDERDIR)/feeds.conf $(GLUON_OPENWRTDIR)/feeds.conf
|
|
|
|
$(GLUON_OPENWRTDIR)/scripts/feeds uninstall -a
|
|
|
|
$(GLUON_OPENWRTDIR)/scripts/feeds update -a
|
|
|
|
$(GLUON_OPENWRTDIR)/scripts/feeds install -a
|
|
|
|
|
2013-02-12 06:14:18 +00:00
|
|
|
echo -e "CONFIG_TARGET_$(BOARD)=y\nCONFIG_TARGET_ROOTFS_JFFS2=n\n$(subst ${ },\n,$(patsubst %,CONFIG_PACKAGE_%=m,$(GLUON_PACKAGES) $(PROFILE_PACKAGES)))" > $(GLUON_OPENWRTDIR)/.config
|
2013-02-12 01:03:37 +00:00
|
|
|
$(MAKE) -C $(GLUON_OPENWRTDIR) defconfig prepare
|
|
|
|
$(MAKE) -C $(GLUON_BUILDERDIR) kernel
|
|
|
|
$(MAKE) -C $(GLUON_OPENWRTDIR) package/compile
|
|
|
|
|
|
|
|
touch $(prepared_stamp)
|
|
|
|
|
|
|
|
$(prepared_stamp):
|
|
|
|
$(MAKE) prepare
|
2013-02-11 22:06:19 +00:00
|
|
|
|
2013-02-12 06:14:18 +00:00
|
|
|
images: $(patsubst %,image/%,$(PROFILES))
|
2013-02-11 03:52:16 +00:00
|
|
|
|
2013-02-12 01:03:37 +00:00
|
|
|
clean:
|
2013-02-12 06:14:18 +00:00
|
|
|
rm -rf $(GLUON_BUILDDIR)
|
2013-02-12 01:03:37 +00:00
|
|
|
|
|
|
|
cleanall: clean
|
|
|
|
$(MAKE) -C $(GLUON_OPENWRTDIR) clean
|
|
|
|
|
|
|
|
.PHONY: all images prepare clean cleanall
|