mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 03:20:00 +03:00
Makefile - remove -j0 (#13838)
Makefile - don't override user-supplied --jobs argument Some targets will default to parallel build, but only when no -j / --jobs argument is specified on make command line
This commit is contained in:
parent
dc741d4d83
commit
3e130de49c
2 changed files with 11 additions and 6 deletions
13
Makefile
13
Makefile
|
@ -80,6 +80,11 @@ ifneq ($(wildcard $(MAKE_SCRIPT_DIR)/local.mk),)
|
||||||
include $(MAKE_SCRIPT_DIR)/local.mk
|
include $(MAKE_SCRIPT_DIR)/local.mk
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# some targets use parallel build by default
|
||||||
|
# MAKEFLAGS is valid only inside target, do not use this at parse phase
|
||||||
|
DEFAULT_PARALLEL_JOBS := # all jobs in parallel (for backward compatibility)
|
||||||
|
MAKE_PARALLEL = $(if $(filter -j%, $(MAKEFLAGS)),$(EMPTY),-j$(DEFAULT_PARALLEL_JOBS))
|
||||||
|
|
||||||
# pre-build sanity checks
|
# pre-build sanity checks
|
||||||
include $(MAKE_SCRIPT_DIR)/checks.mk
|
include $(MAKE_SCRIPT_DIR)/checks.mk
|
||||||
|
|
||||||
|
@ -507,11 +512,11 @@ test_clean:
|
||||||
|
|
||||||
## <TARGET>_clean : clean up one specific target (alias for above)
|
## <TARGET>_clean : clean up one specific target (alias for above)
|
||||||
$(TARGETS_CLEAN):
|
$(TARGETS_CLEAN):
|
||||||
$(V0) $(MAKE) -j TARGET=$(subst _clean,,$@) clean
|
$(V0) $(MAKE) $(MAKE_PARALLEL) TARGET=$(subst _clean,,$@) clean
|
||||||
|
|
||||||
## <CONFIG>_clean : clean up one specific target (alias for above)
|
## <CONFIG>_clean : clean up one specific target (alias for above)
|
||||||
$(CONFIGS_CLEAN):
|
$(CONFIGS_CLEAN):
|
||||||
$(V0) $(MAKE) -j CONFIG=$(subst _clean,,$@) clean
|
$(V0) $(MAKE) $(MAKE_PARALLEL) CONFIG=$(subst _clean,,$@) clean
|
||||||
|
|
||||||
## clean_all : clean all targets
|
## clean_all : clean all targets
|
||||||
clean_all: $(TARGETS_CLEAN) test_clean
|
clean_all: $(TARGETS_CLEAN) test_clean
|
||||||
|
@ -568,10 +573,10 @@ zip:
|
||||||
$(V0) zip $(TARGET_ZIP) $(TARGET_HEX)
|
$(V0) zip $(TARGET_ZIP) $(TARGET_HEX)
|
||||||
|
|
||||||
binary:
|
binary:
|
||||||
$(V0) $(MAKE) -j $(TARGET_BIN)
|
$(V0) $(MAKE) $(MAKE_PARALLEL) $(TARGET_BIN)
|
||||||
|
|
||||||
hex:
|
hex:
|
||||||
$(V0) $(MAKE) -j $(TARGET_HEX)
|
$(V0) $(MAKE) $(MAKE_PARALLEL) $(TARGET_HEX)
|
||||||
|
|
||||||
TARGETS_REVISION = $(addsuffix _rev,$(BASE_TARGETS))
|
TARGETS_REVISION = $(addsuffix _rev,$(BASE_TARGETS))
|
||||||
## <TARGET>_rev : build target and add revision to filename
|
## <TARGET>_rev : build target and add revision to filename
|
||||||
|
|
|
@ -59,9 +59,9 @@ endif
|
||||||
|
|
||||||
$(BASE_CONFIGS):
|
$(BASE_CONFIGS):
|
||||||
@echo "Building target config $@"
|
@echo "Building target config $@"
|
||||||
$(V0) $(MAKE) -j hex CONFIG=$@
|
$(V0) $(MAKE) $(MAKE_PARALLEL) hex CONFIG=$@
|
||||||
@echo "Building target config $@ succeeded."
|
@echo "Building target config $@ succeeded."
|
||||||
|
|
||||||
## <CONFIG>_rev : build configured target and add revision to filename
|
## <CONFIG>_rev : build configured target and add revision to filename
|
||||||
$(addsuffix _rev,$(BASE_CONFIGS)):
|
$(addsuffix _rev,$(BASE_CONFIGS)):
|
||||||
$(V0) $(MAKE) -j hex CONFIG=$(subst _rev,,$@) REV=yes
|
$(V0) $(MAKE) $(MAKE_PARALLEL) hex CONFIG=$(subst _rev,,$@) REV=yes
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue