From: Jean THOMAS Date: Tue, 9 Jun 2020 09:55:17 +0000 (+0200) Subject: Update Makefile for library generation X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4e88c8ce0c29194e613d544d03f4dee89bd3426b;p=gram.git Update Makefile for library generation --- diff --git a/libgram/Makefile b/libgram/Makefile index 1f1b138..cf7ee3f 100644 --- a/libgram/Makefile +++ b/libgram/Makefile @@ -1,15 +1,24 @@ -CSR_CSV_FILE := ddr3soc_resources.csv - -OBJS := +OBJS := src/init.o src/memtest.o TRIPLE := riscv64-unknown-elf -CC := $(TRIPLE)-gcc -AS := $(TRIPLE)-as +CC := $(TRIPLE)-gcc +AS := $(TRIPLE)-as OBJCOPY := $(TRIPLE)-objcopy -PYTHON := python +AR := $(TRIPLE)-ar CFLAGS := -march=rv32i -mabi=ilp32 -nostdlib -Os -Iinclude LDFLAGS := -march=rv32i -mabi=ilp32 -nostdlib -src/ +all: libgram.a + +%.o: %.c + $(CC) $(CFLAGS) -c $< -o $@ + +libgram.a: $(OBJS) + $(AR) rcs $@ $(OBJS) + +clean: + rm -rf $(OBJS) + rm -f libgram.a +.PHONY: clean