Various fixes and enhancements

This commit is contained in:
Matthias Schiffer 2013-02-12 02:03:37 +01:00
parent adad83c1f3
commit 37f8df9a81
2 changed files with 27 additions and 45 deletions

View File

@ -13,6 +13,8 @@ null :=
space := ${null} ${null}
${space} := ${space}
prepared_stamp:=$(GLUON_BUILDDIR)/prepared
prepare:
mkdir -p $(GLUON_IMAGEDIR) $(GLUON_BUILDDIR)
echo 'src packages file:../openwrt/bin/$(BOARD)/packages' > $(GLUON_BUILDDIR)/opkg-$(BOARD).conf
@ -22,15 +24,27 @@ prepare:
$(GLUON_OPENWRTDIR)/scripts/feeds update -a
$(GLUON_OPENWRTDIR)/scripts/feeds install -a
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 prepare package/compile
echo -e "CONFIG_TARGET_$(BOARD)=y\nCONFIG_TARGET_ROOTFS_JFFS2=n\n$(subst ${ },\n,$(patsubst %,CONFIG_PACKAGE_%=m,$(GLUON_PACKAGES)))" > $(GLUON_OPENWRTDIR)/.config
$(MAKE) -C $(GLUON_OPENWRTDIR) defconfig prepare
$(MAKE) -C $(GLUON_BUILDERDIR) kernel
$(MAKE) -C $(GLUON_OPENWRTDIR) package/compile
image-%: prepare
touch $(prepared_stamp)
$(prepared_stamp):
$(MAKE) prepare
image-%: $(prepared_stamp)
$(MAKE) -C $(GLUON_BUILDERDIR) image \
PACKAGE_DIR=$(GLUON_OPENWRTDIR)/bin/$(BOARD)/packages \
PROFILE=$(subst image-,,$@)
images: $(patsubst %,image-%,$(PROFILES))
.PHONY: all images prepare
clean:
rm -rf $(GLUON_BUILDDIR) $(prepared_stamp)
cleanall: clean
$(MAKE) -C $(GLUON_OPENWRTDIR) clean
.PHONY: all images prepare clean cleanall

View File

@ -15,7 +15,7 @@ LC_ALL:=C
LANG:=C
export TOPDIR LC_ALL LANG
export OPENWRT_VERBOSE=s
all: help
all: image
include $(TOPDIR)/include/host.mk
@ -33,30 +33,6 @@ include $(INCLUDE_DIR)/version.mk
REVISION:=$(shell $(GLUON_BUILDERDIR)/openwrt_rev.sh $(GLUONDIR))
export REVISION
define Helptext
Available Commands:
help: This help text
info: Show a list of available target profiles
clean: Remove images and temporary build files
image: Build an image (see below for more information).
Building images:
By default 'make image' will create an image with the default
target profile and package set. You can use the following parameters
to change that:
make image PROFILE="<profilename>" # override the default target profile
make image PACKAGES="<pkg1> [<pkg2> [<pkg3> ...]]" # include extra packages
make image FILES="<path>" # include extra files from <path>
make image BIN_DIR="<path>" # alternative output directory for the images
endef
$(eval $(call shexport,Helptext))
help: FORCE
echo "$$$(call shvar,Helptext)"
include $(INCLUDE_DIR)/package-ipkg.mk
# override variables from rules.mk
@ -90,17 +66,16 @@ endef
include $(INCLUDE_DIR)/target.mk
_call_info: FORCE
echo 'Current Target: "$(BOARD)$(if $(SUBTARGET), ($(BOARDNAME)))"'
echo 'Default Packages: $(DEFAULT_PACKAGES)'
echo 'Available Profiles:'
echo; $(PROFILE_LIST)
BUILD_PACKAGES:=$(sort $(DEFAULT_PACKAGES) $(USER_PACKAGES) $($(USER_PROFILE)_PACKAGES) kernel)
# "-pkgname" in the package list means remove "pkgname" from the package list
BUILD_PACKAGES:=$(filter-out $(filter -%,$(BUILD_PACKAGES)) $(patsubst -%,%,$(filter -%,$(BUILD_PACKAGES))),$(BUILD_PACKAGES))
PACKAGES:=
include $(INCLUDE_DIR)/kernel-build.mk
kernel: FORCE
$(Kernel/CompileImage)
_call_image:
echo 'Building images for $(BOARD)$(if $($(USER_PROFILE)_NAME), - $($(USER_PROFILE)_NAME))'
echo 'Packages: $(BUILD_PACKAGES)'
@ -169,16 +144,9 @@ package_postinst: FORCE
build_image: FORCE
@echo
@echo Building images...
$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD)/image install TARGET_BUILD=1 IB=1 \
$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD)/image install TARGET_BUILD=1 \
$(if $(USER_PROFILE),PROFILE="$(USER_PROFILE)")
clean:
rm -rf $(TOPDIR)/tmp $(TOPDIR)/dl $(TARGET_DIR) $(BIN_DIR)
info:
(unset PROFILE FILES PACKAGES MAKEFLAGS; $(MAKE) -s _call_info)
image:
(unset PROFILE FILES PACKAGES MAKEFLAGS; \
$(MAKE) _call_image \
@ -188,5 +156,5 @@ image:
BIN_DIR="$(GLUON_IMAGEDIR)" \
$(if $(PACKAGE_DIR),PACKAGE_DIR="$(PACKAGE_DIR)"))
.SILENT: help info image
.SILENT: image