Closed jscrane closed 1 year ago
A single file is included, uC.mk, which includes all of the other architectures previously included.
Architecture-specific include files, e.g., arduino-esp32.mk, esp32.mk, etc., have defines scoped by the architecture. Thus it should be possible to say,
make -I ~/src/uC-makefile esp32
Backward-compatibility would also be nice: if, e.g., arduino-esp32.mk is included, it should become the default.
a: CPPFLAGS += -I "foo"
a: all
b: CPPFLAGS += -I "bar"
b: all
CPPFLAGS := -I .. -I $@
all:
echo $(CPPFLAGS)
.PHONY: a/foo b/foo
%/bar: %
echo $(@D)
For now have bodged this with conditionals and renaming of fragments. However there must be a better solution involving target- and pattern-specific macros.
Think a better solution involves using a prefix macro:
p = foo
foo_board := d1_mini
Then find board and use that to search various board.txt:
board = $($p_board)
Have a single include for all architectures, with defines for each scoped by processor family.
Aim is to allow a single makefile to build a sketch for multiple architectures.