-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
26 lines (22 loc) · 686 Bytes
/
makefile
File metadata and controls
26 lines (22 loc) · 686 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# ------------------------------------------------
# Arduino Library Makefile (Ubuntu + Arduino CLI)
# ------------------------------------------------
BOARD = arduino:avr:uno
OUTPUT_DIR = build
EXAMPLES = $(wildcard examples/*/*.ino)
ARDUINO_CLI = arduino-cli
all: compile
compile:
@mkdir -p $(OUTPUT_DIR)
@for sketch in $(EXAMPLES); do \
name=$$(basename $$sketch .ino); \
echo "\n==> Compiling example: $$name"; \
$(ARDUINO_CLI) compile --fqbn $(BOARD) \
--build-path $(OUTPUT_DIR)/$$name \
--libraries $(PWD) \
$$sketch || exit 1; \
done
@echo "\n✅ Compilation successful for all examples!"
clean:
rm -rf $(OUTPUT_DIR)
@echo "🧹 Clean complete."