# A very very simple makefile copied from the bliky example of SDK 1.5.2
# requires: export PATH=/opt/Expressif/esp-open-sdk/xtensa-lx106-elf/bin:$PATH
# some things need to be manually adjusted for different type and sizes of flash memory

CC = xtensa-lx106-elf-gcc
CFLAGS = -I. -mlongcalls
LDLIBS = -nostdlib -Wl,--start-group -lmain -lnet80211 -lwpa -llwip -lpp -lphy -Wl,--end-group -lgcc
LDFLAGS = -Teagle.app.v6.ld

stratum1-0x00000.bin: stratum1
	esptool.py elf2image $^

stratum1: stratum1.o

stratum1.o: stratum1.c

flash: stratum1-0x00000.bin
	esptool.py write_flash 0 stratum1-0x00000.bin 0x40000 stratum1-0x40000.bin

clean:
	rm -f stratum1 stratum1.o stratum1-0x00000.bin stratum1-0x400000.bin
