Add support for 'make -j3' so make to run stuff in parallel
authorEric Andersen <andersen@codepoet.org>
Sat, 18 Oct 2003 11:09:54 +0000 (11:09 -0000)
committerEric Andersen <andersen@codepoet.org>
Sat, 18 Oct 2003 11:09:54 +0000 (11:09 -0000)
Makefile
make/binutils.mk
make/gcc-3.3.mk

index 7a66efb39b8001f9b5646446df0b69c4109267a3..68f6900ee231c931d55186712ec867155214b907 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -78,6 +78,9 @@ MULTILIB:=--enable-multilib
 #Install libstdc++?
 INSTALL_LIBSTDCPP=true
 
+# For SMP machines some stuff can be run in parallel
+#JLEVEL=-j3
+
 #############################################################
 #
 # The list of stuff to build for the target filesystem
index 74269edf94ed1c25bea3b19fbb631e400cec6cc3..ac2116a0a4c0e54d50c50e2d79c1d434fa270e3c 100644 (file)
@@ -61,11 +61,11 @@ $(BINUTILS_DIR1)/.configured: $(BINUTILS_DIR)/.patched
        touch $(BINUTILS_DIR1)/.configured
 
 $(BINUTILS_DIR1)/binutils/objdump: $(BINUTILS_DIR1)/.configured
-       $(MAKE) CC_FOR_HOST=$(HOSTCC) CXX_FOR_HOST=$(HOSTCC) \
+       $(MAKE) $(JLEVEL) CC_FOR_HOST=$(HOSTCC) CXX_FOR_HOST=$(HOSTCC) \
                -C $(BINUTILS_DIR1);
 
 $(STAGING_DIR)/$(GNU_TARGET_NAME)/bin/ld: $(BINUTILS_DIR1)/binutils/objdump 
-       $(MAKE) CC_FOR_HOST=$(HOSTCC) CXX_FOR_HOST=$(HOSTCC) \
+       $(MAKE) $(JLEVEL) CC_FOR_HOST=$(HOSTCC) CXX_FOR_HOST=$(HOSTCC) \
                -C $(BINUTILS_DIR1) install;
        rm -rf $(STAGING_DIR)/info $(STAGING_DIR)/man $(STAGING_DIR)/share/doc \
                $(STAGING_DIR)/share/locale
@@ -144,7 +144,7 @@ $(BINUTILS_DIR2)/.configured: $(BINUTILS_DIR)/.patched
        touch $(BINUTILS_DIR2)/.configured
 
 $(BINUTILS_DIR2)/binutils/objdump: $(BINUTILS_DIR2)/.configured
-       $(MAKE) -C $(BINUTILS_DIR2) \
+       $(MAKE) $(JLEVEL) -C $(BINUTILS_DIR2) \
                CC_FOR_BUILD=$(HOSTCC) \
                CXX_FOR_BUILD=$(HOSTCC) \
                AR_FOR_TARGET=$(TARGET_CROSS)ar \
@@ -158,7 +158,7 @@ $(BINUTILS_DIR2)/binutils/objdump: $(BINUTILS_DIR2)/.configured
        touch -c $(BINUTILS_DIR2)/binutils/objdump
 
 $(TARGET_DIR)/usr/bin/ld: $(BINUTILS_DIR2)/binutils/objdump 
-       $(MAKE) -C $(BINUTILS_DIR2) \
+       $(MAKE) $(JLEVEL) -C $(BINUTILS_DIR2) \
                CC_FOR_BUILD=$(HOSTCC) \
                CXX_FOR_BUILD=$(HOSTCC) \
                AR_FOR_TARGET=$(TARGET_CROSS)ar \
index 141dfd7008bb914bbe63d63855a1df3d7526a6de..ab8e6b847daaa40c1f6a70b04c06b105eeb9da25 100644 (file)
@@ -136,13 +136,13 @@ $(GCC_BUILD_DIR1)/.configured: $(GCC_DIR)/.gcc3_3_build_hacks
        touch $(GCC_BUILD_DIR1)/.configured
 
 $(GCC_BUILD_DIR1)/.compiled: $(GCC_BUILD_DIR1)/.configured
-       PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) \
+       PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR1) \
            AR_FOR_TARGET=$(STAGING_DIR)/bin/$(ARCH)-uclibc-ar \
            RANLIB_FOR_TARGET=$(STAGING_DIR)/bin/$(ARCH)-uclibc-ranlib
        touch $(GCC_BUILD_DIR1)/.compiled
 
 $(STAGING_DIR)/bin/$(ARCH)-uclibc-gcc: $(GCC_BUILD_DIR1)/.compiled
-       PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) install;
+       PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR1) install;
        #Cleanup then mess when --program-prefix mysteriously fails 
        -mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-cpp $(STAGING_DIR)/bin/$(ARCH)-uclibc-cpp
        -mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-gcc $(STAGING_DIR)/bin/$(ARCH)-uclibc-gcc
@@ -215,11 +215,11 @@ $(GCC_BUILD_DIR2)/.compiled: $(GCC_BUILD_DIR2)/.configured
        PATH=$(TARGET_PATH) CC=$(HOSTCC) \
            AR_FOR_TARGET=$(TARGET_CROSS)ar RANLIB_FOR_TARGET=$(TARGET_CROSS)ranlib \
            LD_FOR_TARGET=$(TARGET_CROSS)ld NM_FOR_TARGET=$(TARGET_CROSS)nm \
-           CC_FOR_TARGET=$(TARGET_CROSS)gcc $(MAKE) -C $(GCC_BUILD_DIR2)
+           CC_FOR_TARGET=$(TARGET_CROSS)gcc $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR2)
        touch $(GCC_BUILD_DIR2)/.compiled
 
 $(GCC_BUILD_DIR2)/.installed: $(GCC_BUILD_DIR2)/.compiled $(STAGING_DIR)/lib/libc.a
-       PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR2) install;
+       PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR2) install;
        -mv $(STAGING_DIR)/bin/gcc $(STAGING_DIR)/usr/bin;
        -mv $(STAGING_DIR)/bin/protoize $(STAGING_DIR)/usr/bin;
        -mv $(STAGING_DIR)/bin/unprotoize $(STAGING_DIR)/usr/bin;
@@ -385,11 +385,11 @@ $(GCC_BUILD_DIR3)/.configured: $(GCC_BUILD_DIR3)/.gcc3_3_build_hacks
 #endif
 
 $(GCC_BUILD_DIR3)/.compiled: $(GCC_BUILD_DIR3)/.configured
-       $(MAKE) $(TARGET_GCC_ARGS) -C $(GCC_BUILD_DIR3)
+       $(MAKE) $(JLEVEL) $(TARGET_GCC_ARGS) -C $(GCC_BUILD_DIR3)
        touch $(GCC_BUILD_DIR3)/.compiled
 
 $(TARGET_DIR)/usr/bin/gcc: $(GCC_BUILD_DIR3)/.compiled
-       $(MAKE) $(TARGET_GCC_ARGS) DESTDIR=$(TARGET_DIR) \
+       $(MAKE) $(JLEVEL) $(TARGET_GCC_ARGS) DESTDIR=$(TARGET_DIR) \
                -C $(GCC_BUILD_DIR3) install
        (cd $(TARGET_DIR)/usr/bin; ln -fs gcc cc)
        (cd $(TARGET_DIR)/lib; ln -fs /usr/bin/cpp)