From 72e7eac0ef1eb667407f73be26a84cd0a0d38c74 Mon Sep 17 00:00:00 2001 From: Michal Sieron Date: Tue, 17 Aug 2021 11:24:57 +0200 Subject: [PATCH] Fix demo compilation --- litex/soc/software/demo/Makefile | 11 ++++++----- litex/soc/software/demo/donut.c | 2 +- litex/soc/software/demo/isr.c | 2 +- litex/soc/software/demo/main.c | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/litex/soc/software/demo/Makefile b/litex/soc/software/demo/Makefile index 7bf22c6bf..1ea2d6815 100644 --- a/litex/soc/software/demo/Makefile +++ b/litex/soc/software/demo/Makefile @@ -3,7 +3,7 @@ BUILD_DIR?=../build/ include $(BUILD_DIR)/software/include/generated/variables.mak include $(SOC_DIRECTORY)/software/common.mak -OBJECTS = isr.o donut.o helloc.o main.o +OBJECTS = isr.o donut.o helloc.o main.o crt0.o ifdef WITH_CXX OBJECTS += hellocpp.o endif @@ -21,16 +21,17 @@ demo.elf: $(OBJECTS) $(CC) $(LDFLAGS) \ -T linker.ld \ -N -o $@ \ - $(BUILD_DIR)/software/libbase/crt0.o \ $(OBJECTS) \ - -L$(BUILD_DIR)/software/libbase \ - -L$(BUILD_DIR)/software/libcompiler_rt \ - -lbase -lcompiler_rt + $(PACKAGES:%=-L$(BUILD_DIR)/software/%) \ + $(LIBS:lib%=-l%) chmod -x $@ main.o: main.c $(compile) +crt0.o: $(CPU_DIRECTORY)/crt0.S + $(assemble) + donut.o: CFLAGS += -w helloc.o: CFLAGS += -w diff --git a/litex/soc/software/demo/donut.c b/litex/soc/software/demo/donut.c index 8a15dd1ba..0e0b73a84 100644 --- a/litex/soc/software/demo/donut.c +++ b/litex/soc/software/demo/donut.c @@ -9,7 +9,7 @@ #include #include -#include +#include #define R(mul,shift,x,y) \ _=x; \ diff --git a/litex/soc/software/demo/isr.c b/litex/soc/software/demo/isr.c index 8bdbd84c2..97f0fc9df 100644 --- a/litex/soc/software/demo/isr.c +++ b/litex/soc/software/demo/isr.c @@ -4,7 +4,7 @@ #include #include #include -#include +#include void isr(void); diff --git a/litex/soc/software/demo/main.c b/litex/soc/software/demo/main.c index e97b0c0c3..5581ed667 100644 --- a/litex/soc/software/demo/main.c +++ b/litex/soc/software/demo/main.c @@ -6,8 +6,8 @@ #include #include -#include -#include +#include +#include #include /*-----------------------------------------------------------------------*/