1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- VPATH += :$(HALPATH)/fe310
- VPATH += :$(HALPATH)/fe310/freedom-metal-201908/src
- VPATH += :$(HALPATH)/fe310/freedom-metal-201908/src/drivers
- VPATH += :$(HALPATH)/fe310/freedom-metal-201908/gloss
- EXTRAINCDIRS += $(HALPATH)/fe310 $(HALPATH)/fe310/freedom-metal-201908
- #Our hal
- SRC += fe310_hal.c
- #Rest of freedom metal stuff
- SRC += button.c cache.c clock.c cpu.c gpio.c \
- interrupt.c led.c lock.c memory.c pmp.c \
- privilege.c shutdown.c spi.c switch.c timer.c \
- tty.c uart.c time.c synchronize_harts.c
- #watchdog.c
- SRC += fixed-clock.c fixed-factor-clock.c \
- inline.c riscv_clint0.c riscv_cpu.c \
- riscv_plic0.c sifive_ccache0.c sifive_fe310-g000_hfrosc.c \
- sifive_fe310-g000_hfxosc.c sifive_fe310-g000_lfrosc.c \
- sifive_fe310-g000_pll.c \
- sifive_fe310-g000_prci.c sifive_fu540-c000_l2.c \
- sifive_global-external-interrupts0.c \
- sifive_gpio0.c sifive_gpio-buttons.c sifive_gpio-leds.c \
- sifive_gpio-switches.c sifive_local-external-interrupts0.c \
- sifive_spi0.c sifive_test0.c sifive_uart0.c
- SRC += sys_exit.c
- #I guess some ASM is cool too
- ASRC += entry.S trap.S vector.S crt0.S
- MCU_FLAGS = -march=rv32imac -mabi=ilp32 -mcmodel=medlow
- CC = riscv64-unknown-elf-gcc
- OBJCOPY = riscv64-unknown-elf-objcopy
- OBJDUMP = riscv64-unknown-elf-objdump
- SIZE = riscv64-unknown-elf-size
- AR = riscv64-unknown-elf-ar rcs
- NM = riscv64-unknown-elf-nm
- #Output Format = Binary for this target
- FORMAT = binary
- CFLAGS += -ffunction-sections
- CPPFLAGS += -ffunction-sections
- ASFLAGS += -ffunction-sections
- CFLAGS_LAST = -Wno-strict-prototypes
- LDFLAGS += --specs=nano.specs -T $(HALPATH)/fe310/metal.default.lds -Wl,--gc-sections -lm -nostartfiles -nostdlib
- LDFLAGS += -Wl,--start-group -lc -lgcc -Wl,--end-group
- #-lmetal -lmetal-gloss
|