summaryrefslogtreecommitdiff
path: root/fw/fe310/test/Makefile
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2020-08-05 06:43:12 +0200
committerUros Majstorovic <majstor@majstor.org>2020-08-05 06:43:12 +0200
commitc7d1773e73f8c8195c30fdf0e5143f61a123338e (patch)
tree891a00b949886b19d8a9762910fdc4f32b6da4ab /fw/fe310/test/Makefile
parentcf7c06297d04bade9cd04c056f9ed510e64dd7bd (diff)
added test prg
Diffstat (limited to 'fw/fe310/test/Makefile')
-rw-r--r--fw/fe310/test/Makefile20
1 files changed, 20 insertions, 0 deletions
diff --git a/fw/fe310/test/Makefile b/fw/fe310/test/Makefile
new file mode 100644
index 0000000..f6b619c
--- /dev/null
+++ b/fw/fe310/test/Makefile
@@ -0,0 +1,20 @@
+include ../common.mk
+
+CFLAGS += -I.. -I../bsp/include -I../bsp/drivers
+LDFLAGS = $(CFLAGS) -L.. -Wl,--gc-sections -nostartfiles -nostdlib -Wl,--start-group -lc -lm -lgcc -leos -Wl,--end-group -T../bsp/default.lds
+
+TARGET = modem
+
+all: $(TARGET)
+
+%.o: %.c
+ $(CC) $(CFLAGS) -c $<
+
+$(TARGET): $(TARGET).o
+ $(CC) $< $(LDFLAGS) -o $@
+
+clean:
+ rm -f *.o *.a $(TARGET)
+
+upload: $(TARGET)
+ ../bsp/upload --elf ./$(TARGET) --openocd $(RISCV_OPENOCD_HOME)/bin/openocd --gdb $(RISCV_HOME)/bin/riscv64-unknown-elf-gdb --openocd-config ../bsp/openocd.cfg