add support for parallel build of packages (tested with -j8)
authorFelix Fietkau <nbd@openwrt.org>
Wed, 31 May 2006 20:58:13 +0000 (20:58 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 31 May 2006 20:58:13 +0000 (20:58 +0000)
SVN-Revision: 3874

openwrt/package/Makefile
openwrt/rules.mk

index 12ea942a6a140a9ddb22c6c8d19081ea6ad9be53..7548e069a7162d065494f1ccf697b89aa56d4736 100644 (file)
@@ -10,18 +10,18 @@ $(STAMP_DIR) $(TARGET_DIR):
        mkdir -p $@
 
 %-prepare: $(STAMP_DIR) $(TARGET_DIR)
-       $(MAKE) -C $(patsubst %-prepare,%,$@) prepare
+       $(MAKE) -C $(patsubst %-prepare,%,$@) prepare MAKEFLAGS="$(BUILD_MAKEFLAGS)"
 
 %-compile: $(STAMP_DIR) $(TARGET_DIR)
        @echo "-> make $@"
-       $(MAKE) -C $(patsubst %-compile,%,$@) compile
+       $(MAKE) -C $(patsubst %-compile,%,$@) compile MAKEFLAGS="$(BUILD_MAKEFLAGS)"
 
 %-install: $(STAMP_DIR) $(TARGET_DIR)
        @echo "-> make $@"
-       $(MAKE) -C $(patsubst %-install,%,$@) install
+       $(MAKE) -C $(patsubst %-install,%,$@) install MAKEFLAGS="$(BUILD_MAKEFLAGS)"
 
 %-clean: $(STAMP_DIR) $(TARGET_DIR)
-       $(MAKE) -C $(patsubst %-clean,%,$@) clean
+       $(MAKE) -C $(patsubst %-clean,%,$@) clean MAKEFLAGS="$(BUILD_MAKEFLAGS)"
 
 
 $(TOPDIR)/.pkgdeps: $(TOPDIR)/.pkginfo
@@ -29,7 +29,11 @@ $(TOPDIR)/.pkgdeps: $(TOPDIR)/.pkginfo
 
 all: compile
 clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m))
-compile: $(COMPILE_PACKAGES)
-install: base-files-install $(INSTALL_PACKAGES)
-
+compile-targets: $(COMPILE_PACKAGES)
+compile:
+       $(MAKE) -j$(CONFIG_JLEVEL) compile-targets
+install-targets: base-files-install $(INSTALL_PACKAGES)
+install:
+       rm -rf $(BUILD_DIR)/root
+       $(MAKE) install-targets
 
index a94eee9cd1c15319c5a04d831f51b7045aa1fe56..79807e093dd64630d7c09d7a59cdd4c0e9b70eac 100644 (file)
@@ -24,8 +24,8 @@ endif
 
 
 CP=cp -fpR
-MAKE1=make
-MAKEFLAGS=-j$(CONFIG_JLEVEL) V=$(V) $(EXTRA_MAKEFLAGS)
+BUILD_MAKEFLAGS= V=$(V) $(EXTRA_MAKEFLAGS)
+MAKEFLAGS=$(BUILD_MAKEFLAGS)
 # Strip off the annoying quoting
 ARCH:=$(strip $(subst ",, $(CONFIG_ARCH)))
 WGET:=$(strip $(subst ",, $(CONFIG_WGET)))