2021-03-23 18:54:29 +00:00
|
|
|
TARGETDIR := bin
|
|
|
|
TARGET := $(TARGETDIR)/start
|
|
|
|
ROOT := ..
|
|
|
|
LIBRARY_DIRS :=
|
|
|
|
LIBRARY_FILES :=
|
|
|
|
|
2021-04-08 00:12:43 +00:00
|
|
|
MARCH :=-march=rv64ic
|
|
|
|
MABI :=-mabi=lp64
|
|
|
|
LINK_FLAGS :=$(MARCH) $(MABI) -nostartfiles
|
|
|
|
|
|
|
|
AFLAGS =$(MARCH) $(MABI) -march=rv64ic -mabi=lp64 -W
|
2021-05-27 16:48:29 +00:00
|
|
|
CFLAGS =$(MARCH) $(MABI) -march=rv64ic -mabi=lp64 -mcmodel=medany -O2
|
2021-03-23 18:54:29 +00:00
|
|
|
AS=riscv64-unknown-elf-as
|
|
|
|
CC=riscv64-unknown-elf-gcc
|
|
|
|
AR=riscv64-unknown-elf-ar
|
|
|
|
|
|
|
|
all: libcrt0.a
|
|
|
|
|
|
|
|
%.o: %.s
|
|
|
|
${AS} ${AFLAGS} -c $< -o $@
|
|
|
|
|
2021-05-27 16:48:29 +00:00
|
|
|
libcrt0.a: start.o pcnt_driver.o pre_main.o
|
2021-03-23 18:54:29 +00:00
|
|
|
${AR} -r $@ $^
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf *.a *.o
|