-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (27 loc) · 1.08 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
#
#
#
SKETCH := CameraWebServer.ino
BOARD := esp32:esp32:esp32cam
BOARD_FILENAME_SLUG := $(subst :,.,$(BOARD))
all: $(SKETCH).$(BOARD_FILENAME_SLUG).bin
PACKAGE_URL := https://dl.espressif.com/dl/package_esp32_index.json
# Note that the package URL is sometimes documented as
# https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
# At the time of writing these two urls resulted in byte-for-byte identical
# files, so I used the shorter URL
# I dont want to use curl|sh, but this is the documented install method ...
ARDUINO_URL := https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh
bin/arduino-cli: /usr/bin/curl
mkdir -p bin
curl -fsSL $(ARDUINO_URL) | BINDIR=bin sh
.PHONY: $(BOARD_FILENAME_SLUG)
$(BOARD_FILENAME_SLUG): bin/arduino-cli
bin/arduino-cli config init --additional-urls $(PACKAGE_URL)
bin/arduino-cli core update-index
bin/arduino-cli core install esp32:esp32
build-deps:
sudo apt-get -y install curl
$(MAKE) $(BOARD_FILENAME_SLUG)
%.ino.$(BOARD_FILENAME_SLUG).bin: %.ino
bin/arduino-cli compile -b $(BOARD) $<