X-Git-Url: https://the.earth.li/gitweb/?a=blobdiff_plain;f=Makefile;h=347b9046bff4c7b34bf7987736eed01192ed235a;hb=f8ec77a59ae23e61eeb657f4101fbba360fbcddb;hp=9fdad10ef1a7bda8eab00da780aab83deca2fe15;hpb=5d2e8d6d42c2cd0841074f3471d9a363a4840637;p=esp8266-clock.git diff --git a/Makefile b/Makefile index 9fdad10..347b904 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,26 @@ SDKDIR ?= /opt/esp8266-sdk -AR = $(SDKDIR)/bin/xtensa-lx106-elf-ar -CC = $(SDKDIR)/bin/xtensa-lx106-elf-gcc -LD = $(SDKDIR)/bin/xtensa-lx106-elf-gcc -OBJCOPY = $(SDKDIR)/bin/xtensa-lx106-elf-objcopy -OBJDUMP = $(SDKDIR)/bin/xtensa-lx106-elf-objdump +AR = xtensa-lx106-elf-ar +CC = xtensa-lx106-elf-gcc +LD = xtensa-lx106-elf-gcc +OBJCOPY = xtensa-lx106-elf-objcopy +OBJDUMP = xtensa-lx106-elf-objdump LIBS = -lc -lhal -lphy -lpp -lnet80211 -llwip -lwpa -lmain -CFLAGS = -Wall -Os -fno-inline-functions -mlongcalls -DICACHE_FLASH -I. -LDFLAGS = -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static +CFLAGS = -Wall -Os -fno-inline-functions -mlongcalls -DICACHE_FLASH -I. \ + -I$(SDKDIR)/xtensa-lx106-elf/include +LDFLAGS = -nostdlib -Wl,--no-check-sections -Wl,--gc-sections -Wl,-static \ + -u call_user_start \ + -L$(SDKDIR)/xtensa-lx106-elf/lib APP = clock -OBJS = user_main.o max7219.o spi.o clock.o +OBJS = user_main.o clock.o max7219.o ota.o spi.o all: rom0.bin rom1.bin %.bin: %.elf - PATH=$$PATH:$(SDKDIR)/bin esptool.py elf2image $^ --version 2 -o $@ + esptool elf2image $^ --version 2 -o $@ %.elf: $(APP)_app.a $(LD) -T$(basename $@).ld $(LDFLAGS) -Wl,--start-group $(LIBS) $^ -Wl,--end-group -lgcc -o $@ @@ -35,6 +38,6 @@ project_config.h: echo '#define CFG_WIFI_PASSWORD "password"' >> $@ clean: - rm -f $(OBJS) $(APP)_app.a $(APP).elf rom0.bin rom1.bin + rm -f $(OBJS) $(APP)_app.a rom0.elf rom1.elf rom0.bin rom1.bin .PHONY: all clean