From db3a8e8c2e91e55237f86c885fde137ec4b3ee5b Mon Sep 17 00:00:00 2001 From: Trammell Hudson Date: Tue, 21 Mar 2017 14:29:07 -0400 Subject: [PATCH] limit parallel make load (issue #131) --- Makefile | 8 ++++---- modules/busybox | 2 +- modules/coreboot | 2 +- modules/cryptsetup | 2 +- modules/kexec | 1 + modules/libuuid | 2 +- modules/lvm2 | 1 + modules/mbedtls | 2 +- modules/musl | 2 +- modules/popt | 2 +- modules/qrencode | 2 +- modules/xen | 2 +- 12 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index a649594..a895f53 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ build := $(pwd)/build config := $(pwd)/build INSTALL := $(pwd)/install log_dir := $(build)/log -MAKE_JOB ?= 8 +MAKE_JOBS ?= -j8 --max-load 24 # Create the log directory if it doesn't already exist BUILD_LOG := $(shell [ -d "$(log_dir)" ] || mkdir "$(log_dir)") @@ -38,7 +38,7 @@ heads_cc := $(INSTALL)/bin/musl-gcc \ -fdebug-prefix-map=$(pwd)=heads \ -gno-record-gcc-switches \ -CROSS := $(build)/$(musl-cross_dir)/../../crossgcc/x86_64-linux-musl/bin/x86_64-musl-linux- +CROSS := $(build)/../crossgcc/x86_64-linux-musl/bin/x86_64-musl-linux- #heads_cc := $(HOME)/install/x86_64-linux-musl/x86_64-linux-musl/bin/gcc @@ -229,7 +229,7 @@ initrd/bin/busybox: $(build)/$(busybox_dir)/busybox -C $(build)/$(busybox_dir) \ CC="$(heads_cc)" \ CONFIG_PREFIX="$(pwd)/initrd" \ - -j 8 \ + $(MAKE_JOBS) \ install # hack to build cbmem from coreboot @@ -353,7 +353,7 @@ all: # How to download and build the correct version of make $(HEADS_MAKE): $(build)/$(make_dir)/Makefile - make -C "`dirname $@`" -j$(MAKE_JOBS) \ + make -C "`dirname $@`" $(MAKE_JOBS) \ 2>&1 \ | tee "$(log_dir)/make.log" \ $(VERBOSE_REDIRECT) diff --git a/modules/busybox b/modules/busybox index 85a008d..0f18077 100644 --- a/modules/busybox +++ b/modules/busybox @@ -12,7 +12,7 @@ busybox_output := busybox busybox_target := \ CC="$(heads_cc)" \ CONFIG_PREFIX="$(INSTALL)" \ - -j $(MAKE_JOBS) \ + $(MAKE_JOBS) \ install busybox_depends := $(musl_dep) diff --git a/modules/coreboot b/modules/coreboot index 3481d3b..5eea5eb 100644 --- a/modules/coreboot +++ b/modules/coreboot @@ -30,7 +30,7 @@ coreboot_target := \ BUILD_TIMELESS=1 \ CFLAGS_x86_32="$(EXTRA_FLAGS)" \ CFLAGS_x86_64="$(EXTRA_FLAGS)" \ - -j $(MAKE_JOBS) + $(MAKE_JOBS) coreboot_output := $(BOARD)/coreboot.rom diff --git a/modules/cryptsetup b/modules/cryptsetup index 8f7b66c..6da0d48 100644 --- a/modules/cryptsetup +++ b/modules/cryptsetup @@ -20,7 +20,7 @@ cryptsetup_configure := ./configure \ # but after building, replace prefix so that they will be installed # in the correct directory. cryptsetup_target := \ - -j $(MAKE_JOBS) \ + $(MAKE_JOBS) \ && $(MAKE) \ -C $(build)/$(cryptsetup_dir) \ prefix="$(INSTALL)" \ diff --git a/modules/kexec b/modules/kexec index b4bc9d8..527de7d 100644 --- a/modules/kexec +++ b/modules/kexec @@ -17,6 +17,7 @@ kexec_configure := ./configure \ && $(MAKE) clean kexec_target := \ + $(MAKE_JOBS) \ install \ kexec_output := build/sbin/kexec diff --git a/modules/libuuid b/modules/libuuid index b3fe04f..8e8174a 100644 --- a/modules/libuuid +++ b/modules/libuuid @@ -11,7 +11,7 @@ libuuid_configure := ./configure \ --prefix "" \ --host i386-elf-linux \ -libuuid_target := -j $(MAKE_JOBS) && \ +libuuid_target := $(MAKE_JOBS) && \ $(MAKE) \ -C "$(build)/$(libuuid_dir)" \ prefix="$(INSTALL)" \ diff --git a/modules/lvm2 b/modules/lvm2 index 2b1730c..4c57f71 100644 --- a/modules/lvm2 +++ b/modules/lvm2 @@ -22,6 +22,7 @@ lvm2_configure := \ # not sure why LIB_SUFFIX is not defined in the cross build lvm2_target := \ + $(MAKE_JOBS) \ install_device-mapper \ #lvm2_libraries := libdm/libdevmapper.so diff --git a/modules/mbedtls b/modules/mbedtls index 19dca3e..8696f14 100644 --- a/modules/mbedtls +++ b/modules/mbedtls @@ -14,7 +14,7 @@ mbedtls_target := \ SHARED=1 \ DESTDIR=$(INSTALL) \ CC="$(heads_cc)" \ - -j $(MAKE_JOBS) \ + $(MAKE_JOBS) \ install mbedtls_depends := $(musl_dep) diff --git a/modules/musl b/modules/musl index cc94d30..187b3e3 100644 --- a/modules/musl +++ b/modules/musl @@ -24,7 +24,7 @@ musl_configure := ./configure \ -musl_target := -j $(MAKE_JOBS) install +musl_target := $(MAKE_JOBS) install #musl_target := install musl_depends := kernel-headers musl-cross diff --git a/modules/popt b/modules/popt index 51947fe..7ed30ed 100644 --- a/modules/popt +++ b/modules/popt @@ -11,7 +11,7 @@ popt_configure := ./configure \ --prefix "" \ --host i386-elf-linux \ -popt_target := -j $(MAKE_JOBS) \ +popt_target := $(MAKE_JOBS) \ && $(MAKE) \ -C "$(build)/$(popt_dir)" \ prefix="$(INSTALL)" \ diff --git a/modules/qrencode b/modules/qrencode index e7b8f0d..ba1e0b9 100644 --- a/modules/qrencode +++ b/modules/qrencode @@ -14,7 +14,7 @@ qrencode_configure := ./configure \ --without-tools \ --host i386-elf-linux \ -qrencode_target := -j $(MAKE_JOBS) \ +qrencode_target := $(MAKE_JOBS) \ && $(MAKE) \ -C "$(build)/$(qrencode_dir)" \ prefix="$(INSTALL)" \ diff --git a/modules/xen b/modules/xen index 443a5ce..ec3211d 100644 --- a/modules/xen +++ b/modules/xen @@ -10,4 +10,4 @@ xen_hash := 02badfce9a037bd1bd4a94210c1f6b85467746216c71795805102b514bcf1fc4 xen_output := xen.gz xen_configure := -xen_target := -j $(MAKE_JOBS) +xen_target := $(MAKE_JOBS)