add support for parallel build of packages (tested with -j8)

SVN-Revision: 3874
This commit is contained in:
Felix Fietkau 2006-05-31 20:58:13 +00:00
parent 7a14b45177
commit 4f9703fb8d
2 changed files with 13 additions and 9 deletions

View file

@ -10,18 +10,18 @@ $(STAMP_DIR) $(TARGET_DIR):
mkdir -p $@ mkdir -p $@
%-prepare: $(STAMP_DIR) $(TARGET_DIR) %-prepare: $(STAMP_DIR) $(TARGET_DIR)
$(MAKE) -C $(patsubst %-prepare,%,$@) prepare $(MAKE) -C $(patsubst %-prepare,%,$@) prepare MAKEFLAGS="$(BUILD_MAKEFLAGS)"
%-compile: $(STAMP_DIR) $(TARGET_DIR) %-compile: $(STAMP_DIR) $(TARGET_DIR)
@echo "-> make $@" @echo "-> make $@"
$(MAKE) -C $(patsubst %-compile,%,$@) compile $(MAKE) -C $(patsubst %-compile,%,$@) compile MAKEFLAGS="$(BUILD_MAKEFLAGS)"
%-install: $(STAMP_DIR) $(TARGET_DIR) %-install: $(STAMP_DIR) $(TARGET_DIR)
@echo "-> make $@" @echo "-> make $@"
$(MAKE) -C $(patsubst %-install,%,$@) install $(MAKE) -C $(patsubst %-install,%,$@) install MAKEFLAGS="$(BUILD_MAKEFLAGS)"
%-clean: $(STAMP_DIR) $(TARGET_DIR) %-clean: $(STAMP_DIR) $(TARGET_DIR)
$(MAKE) -C $(patsubst %-clean,%,$@) clean $(MAKE) -C $(patsubst %-clean,%,$@) clean MAKEFLAGS="$(BUILD_MAKEFLAGS)"
$(TOPDIR)/.pkgdeps: $(TOPDIR)/.pkginfo $(TOPDIR)/.pkgdeps: $(TOPDIR)/.pkginfo
@ -29,7 +29,11 @@ $(TOPDIR)/.pkgdeps: $(TOPDIR)/.pkginfo
all: compile all: compile
clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m)) clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m))
compile: $(COMPILE_PACKAGES) compile-targets: $(COMPILE_PACKAGES)
install: base-files-install $(INSTALL_PACKAGES) compile:
$(MAKE) -j$(CONFIG_JLEVEL) compile-targets
install-targets: base-files-install $(INSTALL_PACKAGES)
install:
rm -rf $(BUILD_DIR)/root
$(MAKE) install-targets

View file

@ -24,8 +24,8 @@ endif
CP=cp -fpR CP=cp -fpR
MAKE1=make BUILD_MAKEFLAGS= V=$(V) $(EXTRA_MAKEFLAGS)
MAKEFLAGS=-j$(CONFIG_JLEVEL) V=$(V) $(EXTRA_MAKEFLAGS) MAKEFLAGS=$(BUILD_MAKEFLAGS)
# Strip off the annoying quoting # Strip off the annoying quoting
ARCH:=$(strip $(subst ",, $(CONFIG_ARCH))) ARCH:=$(strip $(subst ",, $(CONFIG_ARCH)))
WGET:=$(strip $(subst ",, $(CONFIG_WGET))) WGET:=$(strip $(subst ",, $(CONFIG_WGET)))