-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (56 loc) · 1.32 KB
/
Makefile
File metadata and controls
69 lines (56 loc) · 1.32 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
CLI?=/opt/homebrew/bin/arduino-cli
PORT?=/dev/cu.usbmodem2101
BOARD?=esp32:esp32:esp32s3:CDCOnBoot=cdc
SKETCH=$(shell ls *.ino | head -n 1)
hr=bash -c 'COLS=`tput cols`;x=1;dots=""; while [ $$x -le $$COLS ]; do dots="$$dots""-"; x=$$(( $$x + 1 )); done; dots=$${dots:0:$$COLS}; echo $$dots;'
all: upload
compile:
@${hr}
@echo Building...
@${hr}
@${CLI} -v compile --fqbn $(BOARD) $(SKETCH)
nocache:
@${hr}
@echo Clean and build (no cache)
@${hr}
@${CLI} -v compile --clean --upload -p $(PORT) --fqbn $(BOARD) $(SKETCH)
upload:
@${hr}
@echo Building and uploading afterwards
@${hr}
@${CLI} -v compile --upload -p $(PORT) --fqbn $(BOARD) $(SKETCH)
just-upload:
@${hr}
@echo JUST UPLOADING!
@${hr}
@${CLI} upload -p $(PORT) --fqbn $(BOARD) $(SKETCH)
update:
@${hr}
@echo Updating Arduino platform...
@${hr}
@${CLI} update
@${CLI} upgrade
list:
@${hr}
@echo Listing all installed board's FQBN
@${hr}
@${CLI} board listall
monitor-once:
@${hr}
@echo Starting serial monitor...
@${hr}
@${CLI} monitor -p $(PORT) --fqbn $(BOARD)
monitor:
@while true; do \
make monitor-once; \
echo "No connection, restarting..."; \
sleep 1; \
done
# Simulator targets
simulator:
cd simulator && $(MAKE)
sim-run:
cd simulator && $(MAKE) run
sim-clean:
cd simulator && $(MAKE) clean
.PHONY: simulator sim-run sim-clean