aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/Makefile')
-rw-r--r--firmware/Makefile33
1 files changed, 33 insertions, 0 deletions
diff --git a/firmware/Makefile b/firmware/Makefile
new file mode 100644
index 0000000..0fd1699
--- /dev/null
+++ b/firmware/Makefile
@@ -0,0 +1,33 @@
1ifneq (,$(wildcard .env))
2 include .env
3 export $(shell sed 's/=.*//' .env)
4endif
5
6ENV = esp32dev
7
8BUILD_FLAGS = -D WIFI_SSID="\\\"$(WIFI_SSID)\\\"" \
9 -D WIFI_PASS="\\\"$(WIFI_PASS)\\\"" \
10 -D MQTT_URI="\\\"$(MQTT_URI)\\\""
11
12.PHONY: build upload monitor clean debug-flags test
13
14build:
15 @echo "Starting build with SSID=$(WIFI_SSID)"
16 PLATFORMIO_BUILD_FLAGS="$(BUILD_FLAGS)" pio run -e $(ENV)
17
18upload:
19 @echo "Starting uploading process..."
20 PLATFORMIO_BUILD_FLAGS="$(BUILD_FLAGS)" pio run -e $(ENV) -t upload
21
22monitor:
23 pio device monitor -e $(ENV)
24
25clean:
26 pio run -e $(ENV) -t clean
27
28debug-flags:
29 @echo $(BUILD_FLAGS)
30
31test:
32 @echo "Starting unit tests..."
33 PLATFORMIO_BUILD_FLAGS="$(BUILD_FLAGS)" pio test -e $(ENV) -vvv