Skip to content

Commit 2627c86

Browse files
committed
Add a simple makefile to wrap all the commands
1 parent 75aa60f commit 2627c86

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

Makefile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#
2+
#
3+
#
4+
5+
SKETCH := CameraWebServer.ino
6+
7+
BOARD := esp32:esp32:esp32cam
8+
PACKAGE_URL := https://dl.espressif.com/dl/package_esp32_index.json
9+
10+
BOARD_FILENAME_SLUG := $(subst :,.,$(BOARD))
11+
12+
all: $(SKETCH).$(BOARD_FILENAME_SLUG).bin
13+
14+
# I dont want to use curl|sh, but this is the documented install method ...
15+
ARDUINO_URL := https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh
16+
bin/arduino-cli: /usr/bin/curl
17+
curl -fsSL $(ARDUINO_URL) | sh
18+
19+
.PHONY: $(BOARD_FILENAME_SLUG)
20+
$(BOARD_FILENAME_SLUG): bin/arduino-cli
21+
~/bin/arduino-cli config init --additional-urls $(PACKAGE_URL)
22+
~/bin/arduino-cli core update-index
23+
arduino-cli core install esp32:esp32
24+
25+
build-deps:
26+
sudo apt-get -y install curl
27+
$(MAKE) $(BOARD_FILENAME_SLUG)
28+
29+
%.ino.$(BOARD_FILENAME_SLUG).bin: %.ino
30+
arduino-cli compile -b $(BOARD) $<

0 commit comments

Comments
 (0)