-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (34 loc) · 975 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
40
41
42
43
# Default config file
CONFIG ?= config.yaml
# ESPHome command
ESPHOME = esphome
# Targets
.PHONY: all config compile upload clean help
all: config compile upload
config:
$(ESPHOME) config $(CONFIG)
compile:
$(ESPHOME) compile $(CONFIG)
upload:
$(ESPHOME) upload $(CONFIG)
run:
$(ESPHOME) run $(CONFIG)
clean:
$(ESPHOME) clean $(CONFIG)
help:
@echo "Usage: make [target] [CONFIG=<path_to_config.yaml>]"
@echo ""
@echo "Targets:"
@echo " all - Run config, compile, and upload (default)"
@echo " config - Validate the configuration"
@echo " compile - Compile the firmware"
@echo " upload - Upload the firmware to the device"
@echo " run - Compile and upload in one command"
@echo " clean - Clean the build files"
@echo " help - Show this help message"
@echo ""
@echo "Variables:"
@echo " CONFIG - Path to the ESPHome config file (default: config.yaml)"
@echo ""
@echo "Example:"
@echo " make compile CONFIG=my_device.yaml"