Use make's built-in `.DEFAULT_GOAL` variable to set default target(s)

Instead of using the phony `DEFAULT_GOAL` target, use make's special variable
`.DEFAULT_GOAL` to work around the problem of including arduino-cli.mk at the
top of the sketch makefile.

Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
pull/1155/head
Michael Richters 3 years ago
parent 6e53a6bbb3
commit 674f6a0828
No known key found for this signature in database
GPG Key ID: 1288FD13E4EEF0C0

@ -36,7 +36,7 @@ ifneq ($(TEST_PATH),)
TEST_PATH_ARG="TEST_PATH='$(TEST_PATH)'"
endif
DEFAULT_GOAL: smoke-sketches
.DEFAULT_GOAL := smoke-sketches
.PHONY: setup
setup: $(ARDUINO_CLI_PATH) $(ARDUINO_DIRECTORIES_DATA)/arduino-cli.yaml install-arduino-core-avr install-arduino-core-kaleidoscope $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/boards.txt $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/virtual/boards.txt

@ -114,9 +114,10 @@ endif
.PHONY: configure-arduino-cli install-arduino-core-kaleidoscope install-arduino-core-avr
.PHONY: stupid-workaround-for-make-inclusion-semantics
stupid-workaround-for-make-inclusion-semantics: DEFAULT_GOAL
stupid-workaround-for-make-inclusion-semantics:
@: # This is here so that the sketch makefile including this file doesn't
@: # default to arduino-cli installation as its priamry target
@echo "No default target specified; aborting. Please set the .DEFAULT_GOAL variable in your makefile."
$(KALEIDOSCOPE_BIN_DIR)/arduino-cli:
$(QUIET) curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR="$(KALEIDOSCOPE_BIN_DIR)" sh

@ -99,7 +99,7 @@ endif
DEFAULT_GOAL: compile
.DEFAULT_GOAL := compile
#$(SKETCH_FILE_PATH):

@ -39,6 +39,8 @@ MAKEFLAGS += --no-print-directory
include $(top_dir)/etc/makefiles/arduino-cli.mk
.DEFAULT_GOAL := all
# If we start off in tests to run make all, the sketch makefiles guess the wrong location for
# Kaliedoscope's makefiles
KALEIDOSCOPE_ETC_DIR ?= $(top_dir)/etc

Loading…
Cancel
Save