-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (30 loc) · 1.26 KB
/
Makefile
File metadata and controls
37 lines (30 loc) · 1.26 KB
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
27
28
29
30
31
32
33
34
35
36
37
# Compile all examples for each board.
# Config.
CLI = arduino-cli
ARDUINO_BOARDS = arduino:avr:uno arduino:avr:mega arduino:mbed_giga:giga
ARDUINO_EXAMPLES = messageBuilder client server serverWithObserve
# Build for all. The first failure will stop the process.
.PHONY: all
all: arduino esp32 esp8266
# Build for different Arduino boards.
.PHONY: arduino
arduino:
@for board in $(ARDUINO_BOARDS); do \
echo "--- Compiling for board: $$board ---"; \
for sketch in $(ARDUINO_EXAMPLES); do \
echo "Compiling $$sketch..."; \
$(CLI) compile --fqbn $$board --library . examples/$$sketch/$$sketch.ino || exit 1; \
done || exit 1; \
done
# Build for ESP32 platform
PHONY: esp32
esp32:
@echo "--- Compiling for board: esp32:esp32:esp32 ---"; \
$(CLI) compile --fqbn esp32:esp32:esp32 --library . examples/serverEsp32/serverEsp32.ino || exit 1;
# Build for ESP8266 platform. Requires the ESP8266 core. Install with:
# arduino-cli core install esp8266:esp8266 --additional-urls https://arduino.esp8266.com/stable/package_esp8266com_index.json
PHONY: esp8266
esp8266:
@echo "--- Compiling for board: esp8266:esp8266:nodemcuv2 ---"; \
echo "Compiling esp8266..."; \
$(CLI) compile --fqbn esp8266:esp8266:nodemcuv2 --library . examples/serverEsp8266/serverEsp8266.ino || exit 1;