forked from bleskomat/bleskomat-diy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (32 loc) · 995 Bytes
/
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
## Usage
#
# $ make install # run install process(es)
# $ make compile # compile the device firmware
# $ make upload # compile then upload the device firmware
# $ make monitor # start the serial monitor
#
## Variables
DEVICE ?= /dev/ttyUSB0
BAUDRATE ?= 115200
PLATFORM=espressif32
## Phony targets - these are for when the target-side of a definition
# (such as "install" below) isn't a file but instead just a label. Declaring
# it as phony ensures that it always run, even if a file by the same name
# exists.
.PHONY: install\
compile\
upload\
monitor\
.git-commit-hash
install:
pio pkg install --platform ${PLATFORM}
compile: .git-commit-hash
pio run
upload: .git-commit-hash
sudo chown ${USER}:${USER} ${DEVICE}
pio run --upload-port ${DEVICE} --target upload
monitor:
sudo chown ${USER}:${USER} ${DEVICE}
pio device monitor --baud ${BAUDRATE} --port ${DEVICE}
.git-commit-hash:
-git rev-parse HEAD 2>/dev/null && git rev-parse HEAD > .git-commit-hash