-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
41 lines (29 loc) · 1.01 KB
/
Makefile
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
38
39
40
41
# Arduino CLI executable name
ARDUINO_CLI = arduino-cli.exe
# Library path
LIBRARIES_PATH = ./libraries
# Optional verbose compile/upload trigger
V ?= 0
VERBOSE=
# Build path -- used to store built binary and object files
BUILD_DIR=build
BUILD_PATH=./$@_$(BUILD_DIR)
ifneq ($(V), 0)
VERBOSE=-v
endif
COMMON_COMPILE_ARG = $(VERBOSE) --libraries ${LIBRARIES_PATH} --output-dir=$(BUILD_PATH)
.PHONY: all clean
all: arduinoUno arduinoUnoUltra arduinoMega2560
patched.flag:
git apply patch/Boards.patch
echo > patched.flag
arduinoUno:
$(ARDUINO_CLI) compile $(COMMON_COMPILE_ARG) -b arduino:avr:uno ConfigurableFirmata.ino
arduinoUnoUltra: patched.flag
$(ARDUINO_CLI) compile $(COMMON_COMPILE_ARG) -b arduino:avr:uno --build-property build.extra_flags=-DARDUINO_UNO_ULTRA ConfigurableFirmata.ino
arduinoMega2560:
$(ARDUINO_CLI) compile $(COMMON_COMPILE_ARG) -b arduino:avr:mega:cpu=atmega2560 ConfigurableFirmata.ino
clean:
rm -rf *_$(BUILD_DIR)
rm -rf patched.flag
cd ./libraries/ConfigurableFirmata && git checkout .