forked from sebastianhodapp/ESPbootloader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (44 loc) · 1.24 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
38
39
40
41
42
43
44
45
46
47
48
# Path to nodemcu-uploader (https://github.com/kmpm/nodemcu-uploader)
UPLOADER=./uploader.py
# Serial port
PORT=/dev/cu.usbserial
BAUD=9600
HTML_FILES := $(wildcard html/*)
LUA_FILES := init.lua run_config.lua run_program.lua
# Help
help:
@echo ""
@echo "******** ESPbootloader Makefile options ********"
@echo ""
@echo "(1)"
@echo "make should be installed, verify if not sure (i.e. \"which make\")"
@echo ""
@echo "(2)"
@echo "\"make all\" --> uploads all files"
@echo ""
@echo "(3)"
@echo "\"make html\" --> uploads html folder with files"
@echo ""
@echo "(4)"
@echo "optional parameters may be passed in to specify port and baudrate:"
@echo "e.g. \"make all PORT:=/dev/tty.usb_evs BAUD:=115200\""
@echo ""
# Upload files
all: $(LUA_FILES) $(HTML_FILES)
ifneq ($(strip $(port)),)
override PORT = $(port)
endif
ifneq ($(strip $(baud)),)
override BAUD = $(baud)
endif
@echo "Flashing with PORT $(PORT) and BAUDRATE $(BAUD)"
@$(UPLOADER) -b $(BAUD) -p $(PORT) upload $(foreach f, $^, $(f))
html: $(HTML_FILES)
ifneq ($(strip $(port)),)
override PORT = $(port)
endif
ifneq ($(strip $(baud)),)
override BAUD = $(baud)
endif
@echo "Flashing with PORT $(PORT) and BAUDRATE $(BAUD)"
@$(UPLOADER) -b $(BAUD) -p $(PORT) upload $(foreach f, $^, $(f))