Fix parallel build

This commit is contained in:
Matthias Schiffer 2013-09-24 19:23:09 +02:00
parent 882339556f
commit af2a826e90
2 changed files with 26 additions and 25 deletions

View File

@ -77,7 +77,7 @@ gluon_prepared_stamp := $(GLUON_BUILDDIR)/$(BOARD)/prepared
define GluonProfile define GluonProfile
image/$(1): $(gluon_prepared_stamp) image/$(1): $(gluon_prepared_stamp)
$(GLUONMAKE) image PROFILE="$(1)" V=s$(OPENWRT_VERBOSE) +$(GLUONMAKE) image PROFILE="$(1)" V=s$(OPENWRT_VERBOSE)
PROFILES += $(1) PROFILES += $(1)
PROFILE_PACKAGES += $(filter-out -%,$(2) $(GLUON_$(1)_SITE_PACKAGES)) PROFILE_PACKAGES += $(filter-out -%,$(2) $(GLUON_$(1)_SITE_PACKAGES))
@ -99,6 +99,7 @@ clean: FORCE
refresh_feeds: FORCE refresh_feeds: FORCE
( \ ( \
MAKEFLAGS=V=s$(OPENWRT_VERBOSE) \
export SCAN_COOKIE=; \ export SCAN_COOKIE=; \
scripts/feeds uninstall -a; \ scripts/feeds uninstall -a; \
scripts/feeds update -a; \ scripts/feeds update -a; \
@ -117,28 +118,28 @@ export FEEDS
feeds: FORCE feeds: FORCE
rm -f feeds.conf rm -f feeds.conf
echo "$$FEEDS" > feeds.conf echo "$$FEEDS" > feeds.conf
$(GLUONMAKE) refresh_feeds V=s$(OPENWRT_VERBOSE) +$(GLUONMAKE) refresh_feeds V=s$(OPENWRT_VERBOSE)
config: FORCE config: FORCE
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 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
$(SUBMAKE) defconfig OPENWRT_BUILD= $(_SINGLE)$(SUBMAKE) defconfig OPENWRT_BUILD=
.config: .config:
$(GLUONMAKE) config +$(GLUONMAKE) config
download: .config FORCE download: .config FORCE
$(SUBMAKE) tools/download +$(SUBMAKE) tools/download
$(SUBMAKE) toolchain/download +$(SUBMAKE) toolchain/download
$(SUBMAKE) package/download +$(SUBMAKE) package/download
$(SUBMAKE) target/download +$(SUBMAKE) target/download
toolchain: $(toolchain/stamp-install) $(tools/stamp-install) toolchain: $(toolchain/stamp-install) $(tools/stamp-install)
include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/kernel.mk
kernel: FORCE kernel: FORCE
$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD) -f $(GLUONDIR)/include/Makefile.target $(LINUX_DIR)/.image TARGET_BUILD=1 +$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD) -f $(GLUONDIR)/include/Makefile.target $(LINUX_DIR)/.image TARGET_BUILD=1
$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD) -f $(GLUONDIR)/include/Makefile.target $(LINUX_DIR)/.modules TARGET_BUILD=1 +$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD) -f $(GLUONDIR)/include/Makefile.target $(LINUX_DIR)/.modules TARGET_BUILD=1
packages: $(package/stamp-compile) packages: $(package/stamp-compile)
$(_SINGLE)$(SUBMAKE) -r package/index $(_SINGLE)$(SUBMAKE) -r package/index
@ -147,23 +148,23 @@ prepare-image: FORCE
rm -rf $(BOARD_KDIR) rm -rf $(BOARD_KDIR)
mkdir -p $(BOARD_KDIR) mkdir -p $(BOARD_KDIR)
cp $(KERNEL_BUILD_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux.elf $(BOARD_KDIR)/ cp $(KERNEL_BUILD_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux.elf $(BOARD_KDIR)/
$(SUBMAKE) -C $(TOPDIR)/target/linux/$(BOARD)/image -f $(GLUONDIR)/include/Makefile.image prepare KDIR="$(BOARD_KDIR)" +$(SUBMAKE) -C $(TOPDIR)/target/linux/$(BOARD)/image -f $(GLUONDIR)/include/Makefile.image prepare KDIR="$(BOARD_KDIR)"
prepare: FORCE prepare: FORCE
mkdir -p $(GLUON_IMAGEDIR) $(GLUON_BUILDDIR)/$(BOARD) mkdir -p $(GLUON_IMAGEDIR) $(GLUON_BUILDDIR)/$(BOARD)
echo 'src packages file:../openwrt/bin/$(BOARD)/packages' > $(GLUON_BUILDDIR)/$(BOARD)/opkg.conf echo 'src packages file:../openwrt/bin/$(BOARD)/packages' > $(GLUON_BUILDDIR)/$(BOARD)/opkg.conf
$(GLUONMAKE) feeds +$(GLUONMAKE) feeds
$(GLUONMAKE) config +$(GLUONMAKE) config
$(GLUONMAKE) toolchain +$(GLUONMAKE) toolchain
$(GLUONMAKE) kernel +$(GLUONMAKE) kernel
$(GLUONMAKE) packages +$(GLUONMAKE) packages
$(GLUONMAKE) prepare-image +$(GLUONMAKE) prepare-image
touch $(gluon_prepared_stamp) touch $(gluon_prepared_stamp)
$(gluon_prepared_stamp): $(gluon_prepared_stamp):
$(GLUONMAKE) prepare +$(GLUONMAKE) prepare
include $(INCLUDE_DIR)/package-ipkg.mk include $(INCLUDE_DIR)/package-ipkg.mk
@ -216,10 +217,10 @@ package_install: FORCE
$(OPKG) install $(PACKAGE_DIR)/kernel_*.ipk $(OPKG) install $(PACKAGE_DIR)/kernel_*.ipk
$(OPKG) install $(BASE_PACKAGES) $(OPKG) install $(BASE_PACKAGES)
$(GLUONMAKE) enable_initscripts ENABLE_INITSCRIPTS_FROM=% +$(GLUONMAKE) enable_initscripts ENABLE_INITSCRIPTS_FROM=%
$(OPKG) install $(GLUON_PACKAGES) $(OPKG) install $(GLUON_PACKAGES)
$(GLUONMAKE) enable_initscripts ENABLE_INITSCRIPTS_FROM="$(GLUON_PACKAGES)" +$(GLUONMAKE) enable_initscripts ENABLE_INITSCRIPTS_FROM="$(GLUON_PACKAGES)"
rm -f $(TARGET_DIR)/usr/lib/opkg/lists/* $(TARGET_DIR)/tmp/opkg.lock rm -f $(TARGET_DIR)/usr/lib/opkg/lists/* $(TARGET_DIR)/tmp/opkg.lock
@ -228,15 +229,15 @@ image: FORCE
mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TMP_DIR) $(TARGET_DIR)/tmp mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TMP_DIR) $(TARGET_DIR)/tmp
cp -r $(BOARD_KDIR) $(PROFILE_KDIR) cp -r $(BOARD_KDIR) $(PROFILE_KDIR)
$(GLUONMAKE) package_install +$(GLUONMAKE) package_install
$(call Image/mkfs/prepare) $(call Image/mkfs/prepare)
$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD)/image install TARGET_BUILD=1 IB=1 IMG_PREFIX="gluon-$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))" \ $(_SINGLE)$(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD)/image install TARGET_BUILD=1 IB=1 IMG_PREFIX="gluon-$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))" \
PROFILE="$(PROFILE)" KDIR="$(PROFILE_KDIR)" TARGET_DIR="$(TARGET_DIR)" BIN_DIR="$(BIN_DIR)" TMP_DIR="$(TMP_DIR)" PROFILE="$(PROFILE)" KDIR="$(PROFILE_KDIR)" TARGET_DIR="$(TARGET_DIR)" BIN_DIR="$(BIN_DIR)" TMP_DIR="$(TMP_DIR)"
call_image/%: FORCE call_image/%: FORCE
$(GLUONMAKE) $(patsubst call_image/%,image/%,$@) +$(GLUONMAKE) $(patsubst call_image/%,image/%,$@)
images: $(patsubst %,call_image/%,$(PROFILES)) ; images: $(patsubst %,call_image/%,$(PROFILES)) ;

View File

@ -1,9 +1,9 @@
override define Kernel/Configure override define Kernel/Configure
cp $(GLUONDIR)/kernel/config-$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET)) $(LINUX_DIR)/.config cp $(GLUONDIR)/kernel/config-$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET)) $(LINUX_DIR)/.config
$(MAKE) $(KERNEL_MAKEOPTS) oldnoconfig +$(MAKE) $(KERNEL_MAKEOPTS) oldnoconfig
$(call Kernel/SetInitramfs) $(call Kernel/SetInitramfs)
rm -rf $(KERNEL_BUILD_DIR)/modules rm -rf $(KERNEL_BUILD_DIR)/modules
[ -d $(LINUX_DIR)/user_headers ] || $(MAKE) $(KERNEL_MAKEOPTS) INSTALL_HDR_PATH=$(LINUX_DIR)/user_headers headers_install +[ -d $(LINUX_DIR)/user_headers ] || $(MAKE) $(KERNEL_MAKEOPTS) INSTALL_HDR_PATH=$(LINUX_DIR)/user_headers headers_install
cp $(GLUONDIR)/kernel/vermagic-$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET)) $(LINUX_DIR)/.vermagic cp $(GLUONDIR)/kernel/vermagic-$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET)) $(LINUX_DIR)/.vermagic
endef endef