X-Git-Url: https://the.earth.li/gitweb/?p=esp8266-clock.git;a=blobdiff_plain;f=Makefile;h=9fdad10ef1a7bda8eab00da780aab83deca2fe15;hp=3e0ffec47f9f85c27da9032c9a18f75dda516431;hb=5d2e8d6d42c2cd0841074f3471d9a363a4840637;hpb=99e1116748f10b54cdcfb2227fd7637c0a57d2bb diff --git a/Makefile b/Makefile index 3e0ffec..9fdad10 100644 --- a/Makefile +++ b/Makefile @@ -8,26 +8,26 @@ OBJDUMP = $(SDKDIR)/bin/xtensa-lx106-elf-objdump LIBS = -lc -lhal -lphy -lpp -lnet80211 -llwip -lwpa -lmain -LD_SCRIPT = eagle.app.v6.ld - CFLAGS = -Wall -Os -fno-inline-functions -mlongcalls -DICACHE_FLASH -I. LDFLAGS = -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static APP = clock OBJS = user_main.o max7219.o spi.o clock.o -$(APP)-0x00000.bin: $(APP).elf - PATH=$$PATH:$(SDKDIR)/bin esptool.py elf2image $^ -o $(APP)- +all: rom0.bin rom1.bin + +%.bin: %.elf + PATH=$$PATH:$(SDKDIR)/bin esptool.py elf2image $^ --version 2 -o $@ -$(APP).elf: $(APP)_app.a - $(LD) -T$(LD_SCRIPT) $(LDFLAGS) -Wl,--start-group $(LIBS) $^ -Wl,--end-group -lgcc -o $@ +%.elf: $(APP)_app.a + $(LD) -T$(basename $@).ld $(LDFLAGS) -Wl,--start-group $(LIBS) $^ -Wl,--end-group -lgcc -o $@ $(OBJDUMP) -h -j .data -j .rodata -j .bss -j .text -j .irom0.text $@ $(APP)_app.a: project_config.h $(OBJS) $(AR) cru $@ $^ -flash: $(APP)-0x00000.bin $(APP)-0x10000.bin - $(SDKDIR)/bin/esptool.py write_flash 0 $(APP)-0x00000.bin 0x10000 $(APP)-0x10000.bin +flash: rom0.bin rom1.bin + $(SDKDIR)/bin/esptool.py write_flash 0x2000 rom0.bin 0x42000 rom1.bin project_config.h: echo '#error "Edit this file to match your configuration."' > $@ @@ -35,4 +35,6 @@ project_config.h: echo '#define CFG_WIFI_PASSWORD "password"' >> $@ clean: - rm -f $(OBJS) $(APP)_app.a $(APP).elf $(APP)-0x00000.bin $(APP)-0x10000.bin + rm -f $(OBJS) $(APP)_app.a $(APP).elf rom0.bin rom1.bin + +.PHONY: all clean