-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (41 loc) · 1.9 KB
/
Copy pathMakefile
File metadata and controls
57 lines (41 loc) · 1.9 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
PORT ?= /dev/cu.usbmodem1101
BOOT ?= oled-boot
FQBN ?= esp32:esp32:esp32c3:CDCOnBoot=cdc,PartitionScheme=default,CPUFreq=160,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,EraseFlash=none
DEVICE_AUTOEXEC := /spiffs/autoexec.fs
SKETCH := ueforth/out/esp32/ESP32forth/ESP32forth.ino
# Load order matters: console.fs uses words from oled42.fs and text.fs.
MODULES := forth/oled42.fs generated/text.fs forth/console.fs
export ARDUINO_DIRECTORIES_DATA := $(CURDIR)/arduino/data
export ARDUINO_DIRECTORIES_DOWNLOADS := $(CURDIR)/arduino/downloads
export ARDUINO_DIRECTORIES_USER := $(CURDIR)/arduino/user
ACLI := arduino-cli --config-file arduino-cli.yaml
.DEFAULT_GOAL := install
generate:
@mkdir -p generated
font: generated/text.fs
generated/text.fs: tools/make_font.py | generate
python3 tools/make_font.py > $@
installer: generated/install.fs
generated/install.fs: tools/make_autoexec.py forth/oled42.fs generated/text.fs forth/console.fs | generate
python3 tools/make_autoexec.py --out $(DEVICE_AUTOEXEC) --boot "$(BOOT)" $(MODULES) > $@
install: generated/install.fs
python3 tools/forth.py $(PORT) --file generated/install.fs
reload: generated/text.fs
python3 tools/forth.py $(PORT) --file forth/oled42.fs
python3 tools/forth.py $(PORT) --file generated/text.fs
python3 tools/forth.py $(PORT) --file forth/console.fs
monitor:
screen $(PORT) 115200
probe:
python3 tools/serial_check.py $(PORT)
ueforth:
test -d ueforth || git clone --depth 1 https://github.com/flagxor/ueforth.git
$(SKETCH): | ueforth
cd ueforth && python3 configure.py && ninja out/esp32/ESP32forth/ESP32forth.ino
firmware: $(SKETCH)
$(ACLI) compile --fqbn "$(FQBN)" --build-path build/esp32c3 $(SKETCH)
flash-firmware: firmware
$(ACLI) upload --fqbn "$(FQBN)" -p $(PORT) --input-dir build/esp32c3
clean:
rm -rf generated
.PHONY: generate font installer install reload monitor probe ueforth firmware flash-firmware clean