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 /*-----------------------------------------------------------------------*/