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
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).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 $@ $^
$(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