-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (26 loc) · 1.06 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
CC = xtensa-lx106-elf-gcc
CXX = xtensa-lx106-elf-g++
CFLAGS = -mlongcalls -Iinclude/ -I$(ESP_ROOT)/sdk/driver_lib/include/ -std=c++11 -Wall -Wextra -Wno-unused-parameter -Os
LDLIBS = -nostdlib -Wl,--start-group -lmain -lnet80211 -lwpa -llwip -lpp -lphy -lc -ldriver -Wl,--end-group -lgcc
LDFLAGS = -Wl,-Teagle.app.v6.ld,-gc-sections
IDIR = include
SDIR = src
ODIR = obj
HEADERS = user_config.h ws2812_i2c.h pin_mux_register.h
OBJ = esp8266-ws2811.o ws2812_i2c.o
_DEPS = $(patsubst %,$(IDIR)/%,$(HEADERS))
_OBJ = $(patsubst %,$(ODIR)/%,$(OBJ))
$(ODIR)/%.o: $(SDIR)/%.cpp $(_DEPS)
# Building object
$(CXX) -c -o $@ $< $(CFLAGS)
esp8266-ws2811: $(_OBJ)
# Assembling binary
$(CXX) -o $@ $^ $(LDFLAGS) $(LDLIBS)
esp8266-ws2811-0x00000.bin: esp8266-ws2811
esptool.py elf2image $^
flash: esp8266-ws2811-0x00000.bin
esptool.py --port $(PORT) write_flash -fs 32m -ff 40m -fm dout 0 esp8266-ws2811-0x00000.bin 0x10000 esp8266-ws2811-0x10000.bin
.PHONY: clean
clean:
find obj/ -maxdepth 1 -name '*.o' -delete
rm -f esp8266-ws2811-0x00000.bin esp8266-ws2811-0x10000.bin esp8266-ws2811