build: minimise the number of eval calls in build
This commit is contained in:
parent
d777166c6f
commit
b1f7b80f7e
@ -83,17 +83,21 @@ $(1)-$(2)-debug : $(1)-$(2)
|
|||||||
$(1)-$(2)-hilsensors : $(1)-$(2)
|
$(1)-$(2)-hilsensors : $(1)-$(2)
|
||||||
$(1)-$(2)-upload : $(1)-$(2)
|
$(1)-$(2)-upload : $(1)-$(2)
|
||||||
$(1)-$(2)-upload : $(1)-upload
|
$(1)-$(2)-upload : $(1)-upload
|
||||||
|
endef
|
||||||
|
|
||||||
|
define board_template
|
||||||
$(1)-hil : $(1)
|
$(1)-hil : $(1)
|
||||||
$(1)-debug : $(1)
|
$(1)-debug : $(1)
|
||||||
$(1)-hilsensors : $(1)
|
$(1)-hilsensors : $(1)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
ifneq ($(findstring -, $(MAKECMDGOALS)),)
|
USED_BOARDS := $(foreach board,$(BOARDS), $(findstring $(board), $(MAKECMDGOALS)))
|
||||||
ifneq (px4-v2,$(MAKECMDGOALS))
|
USED_FRAMES := $(foreach frame,$(FRAMES), $(findstring $(frame), $(MAKECMDGOALS)))
|
||||||
|
#$(warning $(USED_BOARDS))
|
||||||
|
#$(warning $(USED_FRAMES))
|
||||||
# generate targets of the form BOARD-FRAME and BOARD-FRAME-HIL
|
# generate targets of the form BOARD-FRAME and BOARD-FRAME-HIL
|
||||||
$(foreach board,$(BOARDS),$(foreach frame,$(FRAMES),$(eval $(call frame_template,$(board),$(frame)))))
|
$(foreach board,$(USED_BOARDS),$(eval $(call board_template,$(board))))
|
||||||
endif
|
$(foreach board,$(USED_BOARDS),$(foreach frame,$(USED_FRAMES),$(eval $(call frame_template,$(board),$(frame)))))
|
||||||
endif
|
|
||||||
|
|
||||||
apm2beta: EXTRAFLAGS += "-DAPM2_BETA_HARDWARE "
|
apm2beta: EXTRAFLAGS += "-DAPM2_BETA_HARDWARE "
|
||||||
apm2beta: apm2
|
apm2beta: apm2
|
||||||
|
Loading…
Reference in New Issue
Block a user