diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-03-15 09:21:47 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-03-20 23:45:00 +0800 |
| commit | a6fff3ae360da26cbadab0dbbfded01e2b70a396 (patch) | |
| tree | f3aeb3f2e839565960da54a371898f09e9e2b3d3 /Makefile | |
| parent | 60e0c64717e1620d471640c066b328b7199d51e4 (diff) | |
build: auto parallel with nproc
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -18,6 +18,9 @@ DEBUG_LDFLAGS = -Wl,--as-needed,-z,now,-z,pack-relative-relocs JOB_COUNT := $(BIN) $(OBJS) JOBS_DONE := $(shell ls -l $(JOB_COUNT) 2> /dev/null | wc -l) +NPROC := $(shell nproc 2>/dev/null || getconf NPROCESSORS_CONF || echo 2) +MAKEFLAGS += -j$(NPROC) + define progress $(eval JOBS_DONE := $(shell echo $$(($(JOBS_DONE) + 1)))) @printf "[$(JOBS_DONE)/$(shell echo $(JOB_COUNT) | wc -w)] %s %s\n" $(1) $(2) |
