aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2025-01-02 00:31:43 +0900
committerMario Limonciello <superm1@gmail.com>2025-01-06 03:05:13 +0000
commit2b781910a7d0a7fd67e3d4f40fd8178004c588bc (patch)
tree378d677cf7f42ccb92663c7b18851faec93a7111 /Makefile
parentc170fc69cf9e10a935b869777357e41bd89bd65d (diff)
Add support to install files/symlinks in parallel.
This reduces the install-zst target time from 100 s to 25 s on my test system, a 400% speed improvement. * Makefile (NUM_JOBS): New variable. (install, install-xz, install-zst): Use it. * copy-firmware.sh (num_jobs): New variable. (has_gnu_parallel): New procedure. <-j>: Parse new option, and use it along GNU parallel to parallelize firmware copying and compression/symlink creation. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 5 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 1f507bfd..0719f874 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,6 @@
FIRMWAREDIR = /lib/firmware
+NUM_JOBS := $(or $(patsubst -j%,%,$(filter -j%,$(MAKEFLAGS))),\
+ 1)
all:
@@ -33,17 +35,17 @@ install:
false; \
fi
install -d $(DESTDIR)$(FIRMWAREDIR)
- ./copy-firmware.sh $(DESTDIR)$(FIRMWAREDIR)
+ ./copy-firmware.sh -j$(NUM_JOBS) $(DESTDIR)$(FIRMWAREDIR)
@echo "Now run \"make dedup\" to de-duplicate any firmware files"
install-xz:
install -d $(DESTDIR)$(FIRMWAREDIR)
- ./copy-firmware.sh --xz $(DESTDIR)$(FIRMWAREDIR)
+ ./copy-firmware.sh -j$(NUM_JOBS) --xz $(DESTDIR)$(FIRMWAREDIR)
@echo "Now run \"make dedup\" to de-duplicate any firmware files"
install-zst:
install -d $(DESTDIR)$(FIRMWAREDIR)
- ./copy-firmware.sh --zstd $(DESTDIR)$(FIRMWAREDIR)
+ ./copy-firmware.sh -j$(NUM_JOBS) --zstd $(DESTDIR)$(FIRMWAREDIR)
@echo "Now run \"make dedup\" to de-duplicate any firmware files"
clean: