Files
wch-uf2-example/minimal-payload/Makefile
T
R 40082ed533 Minimal executable, cleaned up from vendor code
- Removed extraneous and/or oversized(?) align from linker script
- Handle init_array properly
- Remove legacy init code paths (.ctors, .init)
- Don't do nonstandard interrupt mode handling by default
2024-04-12 17:50:23 +01:00

26 lines
569 B
Makefile

.PHONY: all clean
RV_ARCH = rv32imacxw
CC = riscv-none-elf-gcc
OBJDUMP = riscv-none-elf-objdump
CFLAGS = -ggdb3 -Os -march=$(RV_ARCH) -ffunction-sections -fdata-sections
LDFLAGS = -ggdb3 -march=$(RV_ARCH) -Wl,--gc-sections --specs=nosys.specs
all: main.elf
main.elf: startup.o main.o
%.elf: linker.lds
$(CC) -Xlinker -Map=$(@:.elf=.map) -Wl,--script=linker.lds -nostartfiles -o $@ $(filter-out linker.lds,$+)
$(OBJDUMP) -xdsS $@ >$(@:.elf=.dump)
%.o: %.S
$(CC) $(CFLAGS) -c -o $@ $<
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
clean:
rm -f *.o *.elf *.map *.dump