remove some default goals and export less stuff

tmp/arduino-cli-pre-rebase
Jesse Vincent 4 years ago
parent 121f46076c
commit 86552b46c1
No known key found for this signature in database
GPG Key ID: CC228463465E40BC

@ -63,9 +63,6 @@ _arduino_prop = $(subst $1=,,$(subst 🔥, ,$(filter $1=%,$(_arduino_props))))
# $(call _arduino_prop,recipe.hooks.sketch.prebuild.2.pattern) # $(call _arduino_prop,recipe.hooks.sketch.prebuild.2.pattern)
.PHONY: configure-arduino-cli install-arduino-core-kaleidoscope install-arduino-core-avr .PHONY: configure-arduino-cli install-arduino-core-kaleidoscope install-arduino-core-avr
.PHONY: all
.DEFAULT_GOAL := non-goal
non-goal: non-goal:
@echo "Make without a target doesn't do anything" @echo "Make without a target doesn't do anything"

@ -23,8 +23,8 @@ endif
export SKETCH_BASE_NAME := $(notdir $(sketch_dir)) SKETCH_BASE_NAME := $(notdir $(sketch_dir))
export SKETCH_FILE_NAME := $(addsuffix .ino, $(SKETCH_BASE_NAME)) SKETCH_FILE_NAME := $(addsuffix .ino, $(SKETCH_BASE_NAME))
sketch_dir_candidates = $(sketch_dir) src/ . sketch_dir_candidates = $(sketch_dir) src/ .
sketch_exists_p = $(realpath $(wildcard $(dir)/$(SKETCH_FILE_NAME))) sketch_exists_p = $(realpath $(wildcard $(dir)/$(SKETCH_FILE_NAME)))
@ -34,30 +34,30 @@ export FQBN := $(call _arduino_prop,build.fqbn)
export BOOTLOADER_PATH := $(call _arduino_prop,runtime.platform.path)/bootloaders/$(call _arduino_prop,bootloader.file) BOOTLOADER_PATH := $(call _arduino_prop,runtime.platform.path)/bootloaders/$(call _arduino_prop,bootloader.file)
# Find the path of the sketch file # Find the path of the sketch file
SKETCH_FILE_PATH := $(firstword $(foreach dir,$(sketch_dir_candidates),$(sketch_exists_p))) SKETCH_FILE_PATH := $(firstword $(foreach dir,$(sketch_dir_candidates),$(sketch_exists_p)))
# We -could- check to see if sketch-dir is in git before running this command # We -could- check to see if sketch-dir is in git before running this command
# but since we'd just return an empty value in that case, why bother? # but since we'd just return an empty value in that case, why bother?
export GIT_VERSION := $(shell git -C "$(sketch_dir)" describe --abbrev=6 --dirty --alway 2>/dev/null || echo 'unknown') GIT_VERSION := $(shell git -C "$(sketch_dir)" describe --abbrev=6 --dirty --alway 2>/dev/null || echo 'unknown')
export SKETCH_IDENTIFIER := $(shell echo "${SKETCH_FILE_PATH}" | cksum | cut -d ' ' -f 1)-$(SKETCH_FILE_NAME) SKETCH_IDENTIFIER := $(shell echo "${SKETCH_FILE_PATH}" | cksum | cut -d ' ' -f 1)-$(SKETCH_FILE_NAME)
export KALEIDOSCOPE_TEMP_PATH ?= $(TMPDIR)/kaleidoscope-$(USER) KALEIDOSCOPE_TEMP_PATH ?= $(TMPDIR)/kaleidoscope-$(USER)
export KALEIDOSCOPE_BUILD_PATH ?= $(KALEIDOSCOPE_TEMP_PATH)/build KALEIDOSCOPE_BUILD_PATH ?= $(KALEIDOSCOPE_TEMP_PATH)/build
export KALEIDOSCOPE_OUTPUT_PATH ?= $(KALEIDOSCOPE_TEMP_PATH)/output KALEIDOSCOPE_OUTPUT_PATH ?= $(KALEIDOSCOPE_TEMP_PATH)/output
CORE_CACHE_PATH ?= $(KALEIDOSCOPE_TEMP_PATH)/arduino-cores CORE_CACHE_PATH ?= $(KALEIDOSCOPE_TEMP_PATH)/arduino-cores
export BUILD_PATH ?= $(KALEIDOSCOPE_BUILD_PATH)/$(SKETCH_IDENTIFIER) BUILD_PATH ?= $(KALEIDOSCOPE_BUILD_PATH)/$(SKETCH_IDENTIFIER)
export OUTPUT_PATH ?= $(KALEIDOSCOPE_OUTPUT_PATH)/$(SKETCH_IDENTIFIER) OUTPUT_PATH ?= $(KALEIDOSCOPE_OUTPUT_PATH)/$(SKETCH_IDENTIFIER)
OUTPUT_FILE_PREFIX := $(SKETCH_BASE_NAME)-$(GIT_VERSION) OUTPUT_FILE_PREFIX := $(SKETCH_BASE_NAME)-$(GIT_VERSION)
@ -86,8 +86,6 @@ $(SKETCH_FILE_PATH):
.PHONY: compile configure-arduino-cli install-arduino-core-kaleidoscope install-arduino-core-avr .PHONY: compile configure-arduino-cli install-arduino-core-kaleidoscope install-arduino-core-avr
.PHONY: disassemble decompile size-map flash clean all test .PHONY: disassemble decompile size-map flash clean all test
.DEFAULT_GOAL := compile
all: all:
@echo "Make all target doesn't do anything" @echo "Make all target doesn't do anything"
@: ## Do not remove this line, otherwise `make all` will trigger the `%` rule too. @: ## Do not remove this line, otherwise `make all` will trigger the `%` rule too.

@ -1,25 +1,26 @@
top_dir := $(abspath $(dir $(lastword ${MAKEFILE_LIST}))..) top_dir := $(abspath $(dir $(lastword ${MAKEFILE_LIST}))..)
build_dir := ${top_dir}/_build build_dir := ${top_dir}/_build
LIB_DIR := ${build_dir}/lib LIB_DIR := ${build_dir}/lib
libcommon_a := ${top_dir}/_build/lib/libcommon.a libcommon_a := ${top_dir}/_build/lib/libcommon.a
TEST_PATH ?= tests/ TEST_PATH ?= tests/
FQBN ?= keyboarido:virtual:model01 FQBN ?= keyboarido:virtual:model01
TESTS ?= $(shell find ${top_dir}/${TEST_PATH} -name '*.ino' -exec dirname {} \;)
TESTS ?= $(shell find ${top_dir}/${TEST_PATH} -name '*.ino' -exec dirname {} \;)
.PHONY: clean cmake-clean all googletest .PHONY: clean cmake-clean all googletest
generate-testcases: generate-testcases:
@for test in ${TESTS}; do \ @for test in ${TESTS}; do \
${MAKE} -s -f ${top_dir}/testing/makefiles/testcase.mk -C $${test} top_dir=${top_dir} testcase=$${test} generate-testcase; \ ${MAKE} -s -f ${top_dir}/testing/makefiles/testcase.mk -C ${test} top_dir=${top_dir} testcase=${test} generate-testcase; \
done done
all: ${TESTS} all: ${TESTS}
@for test in ${TESTS}; do \ @for test in ${TESTS}; do \
${MAKE} -s -f ${top_dir}/testing/makefiles/testcase.mk -C $${test} top_dir=${top_dir} testcase=$${test} run; \ ${MAKE} -s -f ${top_dir}/testing/makefiles/testcase.mk -C ${test} top_dir=${top_dir} testcase=${test} run; \
done || exit 1 done || exit 1
cmake-clean: cmake-clean:

Loading…
Cancel
Save