diff --git a/apps/crt0.S b/apps/common/crt0.S similarity index 100% rename from apps/crt0.S rename to apps/common/crt0.S diff --git a/apps/linker.ld b/apps/common/linker.ld similarity index 100% rename from apps/linker.ld rename to apps/common/linker.ld diff --git a/apps/makefile.common b/apps/common/makefile.common similarity index 93% rename from apps/makefile.common rename to apps/common/makefile.common index ce0e87e..0fdbd9e 100644 --- a/apps/makefile.common +++ b/apps/common/makefile.common @@ -4,7 +4,7 @@ CFLAGS+=-I${TOPDIR}/common CFLAGS+=${OPT} -fno-stack-protector -fno-builtin-memcpy -fno-builtin CFLAGS+=-static-libgcc -fdata-sections -ffunction-sections CFLAGS+=-g -march=rv32im -mabi=ilp32 -static -LDFLAGS:= -T ${TOPDIR}/apps/linker.ld -nostdlib -Wl,--gc-sections +LDFLAGS:= -T ${TOPDIR}/apps/common/linker.ld -nostdlib -Wl,--gc-sections LIBS:= -lgcc # needed for softfp # check if the compiler is installed diff --git a/apps/conio/Makefile b/apps/conio/Makefile index 49f15d9..870cf17 100644 --- a/apps/conio/Makefile +++ b/apps/conio/Makefile @@ -1,7 +1,7 @@ TOPDIR=../.. PROJECT:=$(shell basename ${PWD}) -SRCS=${PROJECT}.c ${TOPDIR}/apps/crt0.S +SRCS=${PROJECT}.c ${TOPDIR}/apps/common/crt0.S all: all_common test: test_common clean: clean_common -include ${TOPDIR}/apps/makefile.common +include ${TOPDIR}/apps/common/makefile.common diff --git a/apps/fib/Makefile b/apps/fib/Makefile index 49f15d9..870cf17 100644 --- a/apps/fib/Makefile +++ b/apps/fib/Makefile @@ -1,7 +1,7 @@ TOPDIR=../.. PROJECT:=$(shell basename ${PWD}) -SRCS=${PROJECT}.c ${TOPDIR}/apps/crt0.S +SRCS=${PROJECT}.c ${TOPDIR}/apps/common/crt0.S all: all_common test: test_common clean: clean_common -include ${TOPDIR}/apps/makefile.common +include ${TOPDIR}/apps/common/makefile.common diff --git a/apps/gfx/Makefile b/apps/gfx/Makefile index 59c6298..ae7141f 100644 --- a/apps/gfx/Makefile +++ b/apps/gfx/Makefile @@ -2,7 +2,7 @@ TOPDIR=../.. PROJECT:=$(shell basename ${PWD}) OPT=-Os -SRCS=${PROJECT}.c ${TOPDIR}/apps/crt0.S +SRCS=${PROJECT}.c ${TOPDIR}/apps/common/crt0.S HEAP_SIZE=$(shell echo "320 * 200 * 4" | bc) HOST_EXTRA=-e ${HEAP_SIZE} -i 9999999 @@ -12,4 +12,4 @@ test: all ${TOPDIR}/hosts/host-sdl/host-sdl ${HOST_EXTRA} ${PWD}/${PROJECT}.bin clean: clean_common -include ${TOPDIR}/apps/makefile.common +include ${TOPDIR}/apps/common/makefile.common diff --git a/apps/heap/Makefile b/apps/heap/Makefile index 45b1e81..a1bc3bc 100644 --- a/apps/heap/Makefile +++ b/apps/heap/Makefile @@ -4,9 +4,9 @@ PROJECT:=$(shell basename ${PWD}) HEAP_SIZE=$(shell echo "1024 * 512" | bc) OPT=-Os CFLAGS=-DHEAP_SIZE=${HEAP_SIZE} -SRCS=${PROJECT}.c ${TOPDIR}/apps/crt0.S malloc_freelist.c +SRCS=${PROJECT}.c ${TOPDIR}/apps/common/crt0.S malloc_freelist.c HOST_EXTRA=-e ${HEAP_SIZE} -i 100000 all: all_common test: test_common clean: clean_common -include ${TOPDIR}/apps/makefile.common +include ${TOPDIR}/apps/common/makefile.common diff --git a/apps/hello-asm/Makefile b/apps/hello-asm/Makefile index 15e3181..1ce3ae5 100644 --- a/apps/hello-asm/Makefile +++ b/apps/hello-asm/Makefile @@ -4,4 +4,4 @@ SRCS=${PROJECT}.S all: all_common test: test_common clean: clean_common -include ${TOPDIR}/apps/makefile.common +include ${TOPDIR}/apps/common/makefile.common diff --git a/apps/helloworld/Makefile b/apps/helloworld/Makefile index 49f15d9..870cf17 100644 --- a/apps/helloworld/Makefile +++ b/apps/helloworld/Makefile @@ -1,7 +1,7 @@ TOPDIR=../.. PROJECT:=$(shell basename ${PWD}) -SRCS=${PROJECT}.c ${TOPDIR}/apps/crt0.S +SRCS=${PROJECT}.c ${TOPDIR}/apps/common/crt0.S all: all_common test: test_common clean: clean_common -include ${TOPDIR}/apps/makefile.common +include ${TOPDIR}/apps/common/makefile.common diff --git a/apps/lissajous/Makefile b/apps/lissajous/Makefile index 49f15d9..870cf17 100644 --- a/apps/lissajous/Makefile +++ b/apps/lissajous/Makefile @@ -1,7 +1,7 @@ TOPDIR=../.. PROJECT:=$(shell basename ${PWD}) -SRCS=${PROJECT}.c ${TOPDIR}/apps/crt0.S +SRCS=${PROJECT}.c ${TOPDIR}/apps/common/crt0.S all: all_common test: test_common clean: clean_common -include ${TOPDIR}/apps/makefile.common +include ${TOPDIR}/apps/common/makefile.common diff --git a/apps/maze/Makefile b/apps/maze/Makefile index f0ff05b..cec001c 100644 --- a/apps/maze/Makefile +++ b/apps/maze/Makefile @@ -1,9 +1,9 @@ TOPDIR=../.. PROJECT:=$(shell basename ${PWD}) -SRCS=${PROJECT}.c ${TOPDIR}/apps/crt0.S +SRCS=${PROJECT}.c ${TOPDIR}/apps/common/crt0.S OPT=-O2 CFLAGS+=-fpeel-loops all: all_common test: test_common clean: clean_common -include ${TOPDIR}/apps/makefile.common +include ${TOPDIR}/apps/common/makefile.common diff --git a/apps/memtest/Makefile b/apps/memtest/Makefile index 864ec41..ab47a47 100644 --- a/apps/memtest/Makefile +++ b/apps/memtest/Makefile @@ -4,10 +4,10 @@ PROJECT:=$(shell basename ${PWD}) HEAP_SIZE=$(shell echo "1024 * 1024 * 32" | bc) OPT=-Os CFLAGS=-DHEAP_SIZE=${HEAP_SIZE} -SRCS=${PROJECT}.c ${TOPDIR}/apps/crt0.S barr_memtest.c +SRCS=${PROJECT}.c ${TOPDIR}/apps/common/crt0.S barr_memtest.c HOST_EXTRA=-e ${HEAP_SIZE} -i 4294967295 all: all_common test: test_common clean: clean_common -include ${TOPDIR}/apps/makefile.common +include ${TOPDIR}/apps/common/makefile.common diff --git a/apps/rust-hello/Makefile b/apps/rust-hello/Makefile index 174bf06..a7f0fa6 100644 --- a/apps/rust-hello/Makefile +++ b/apps/rust-hello/Makefile @@ -10,4 +10,4 @@ clean: clean_common test: all ${TOPDIR}/host/host ${PROJECT}.bin -include ${TOPDIR}/apps/makefile.common +include ${TOPDIR}/apps/common/makefile.common diff --git a/apps/rust-hello/build.rs b/apps/rust-hello/build.rs index 5a8597a..7883f81 100644 --- a/apps/rust-hello/build.rs +++ b/apps/rust-hello/build.rs @@ -3,7 +3,7 @@ use std::path::PathBuf; fn main() { // linker - println!("cargo:rustc-link-arg-bin=rust-hello=-T../linker.ld"); + println!("cargo:rustc-link-arg-bin=rust-hello=-T../common/linker.ld"); let bindings = bindgen::Builder::default() .header("../../common/uvm32_sys.h") diff --git a/apps/rust-hello/src/main.rs b/apps/rust-hello/src/main.rs index 7b02068..9adb371 100644 --- a/apps/rust-hello/src/main.rs +++ b/apps/rust-hello/src/main.rs @@ -9,7 +9,7 @@ use core::panic::PanicInfo; include!(concat!(env!("OUT_DIR"), "/bindings.rs")); // startup code -global_asm!(include_str!("../../crt0.S")); +global_asm!(include_str!("../../common/crt0.S")); fn syscall(id: u32, param1: u32, param2: u32) -> u32 { let mut value; diff --git a/apps/self/Makefile b/apps/self/Makefile index 4f66329..41c70f1 100644 --- a/apps/self/Makefile +++ b/apps/self/Makefile @@ -1,10 +1,10 @@ TOPDIR=../.. PROJECT:=$(shell basename ${PWD}) -SRCS=${PROJECT}.c ${TOPDIR}/apps/crt0.S ${TOPDIR}/uvm32/uvm32.c +SRCS=${PROJECT}.c ${TOPDIR}/apps/common/crt0.S ${TOPDIR}/uvm32/uvm32.c CFLAGS=-DUVM32_MEMORY_SIZE=8192 -DCUSTOM_STDLIB_H=\"uvm32_target.h\" -I../../uvm32 all: xxd -n mandel -i ${TOPDIR}/precompiled/mandel.bin | sed -e "s/unsigned char/const unsigned char/" > mandel.h make all_common test: test_common clean: clean_common -include ${TOPDIR}/apps/makefile.common +include ${TOPDIR}/apps/common/makefile.common diff --git a/apps/sketch/Makefile b/apps/sketch/Makefile index 49f15d9..870cf17 100644 --- a/apps/sketch/Makefile +++ b/apps/sketch/Makefile @@ -1,7 +1,7 @@ TOPDIR=../.. PROJECT:=$(shell basename ${PWD}) -SRCS=${PROJECT}.c ${TOPDIR}/apps/crt0.S +SRCS=${PROJECT}.c ${TOPDIR}/apps/common/crt0.S all: all_common test: test_common clean: clean_common -include ${TOPDIR}/apps/makefile.common +include ${TOPDIR}/apps/common/makefile.common diff --git a/apps/zig-mandel/Makefile b/apps/zig-mandel/Makefile index e273836..71bed07 100644 --- a/apps/zig-mandel/Makefile +++ b/apps/zig-mandel/Makefile @@ -12,4 +12,4 @@ clean: clean_common test: all ${TOPDIR}/hosts/host/host ${PROJECT}.bin -include ${TOPDIR}/apps/makefile.common +include ${TOPDIR}/apps/common/makefile.common diff --git a/apps/zig-mandel/build.zig b/apps/zig-mandel/build.zig index a16e00b..983c08b 100644 --- a/apps/zig-mandel/build.zig +++ b/apps/zig-mandel/build.zig @@ -37,8 +37,8 @@ pub fn build(b: *std.Build) void { b.installArtifact(exe); - exe.addAssemblyFile(b.path("../crt0.S")); - exe.setLinkerScript(b.path("../linker.ld")); + exe.addAssemblyFile(b.path("../common/crt0.S")); + exe.setLinkerScript(b.path("../common/linker.ld")); exe.addIncludePath(b.path("../../common")); const bin = b.addObjCopy(exe.getEmittedBin(), .{ diff --git a/apps/zigalloc/Makefile b/apps/zigalloc/Makefile index 43549f4..9847bdb 100644 --- a/apps/zigalloc/Makefile +++ b/apps/zigalloc/Makefile @@ -15,4 +15,4 @@ clean: clean_common test: all ${TOPDIR}/hosts/host/host ${HOST_EXTRA} ${PROJECT}.bin -include ${TOPDIR}/apps/makefile.common +include ${TOPDIR}/apps/common/makefile.common diff --git a/apps/zigalloc/build.zig b/apps/zigalloc/build.zig index ee02aa0..1428415 100644 --- a/apps/zigalloc/build.zig +++ b/apps/zigalloc/build.zig @@ -42,8 +42,8 @@ pub fn build(b: *std.Build) void { b.installArtifact(exe); - exe.addAssemblyFile(b.path("../crt0.S")); - exe.setLinkerScript(b.path("../linker.ld")); + exe.addAssemblyFile(b.path("../common/crt0.S")); + exe.setLinkerScript(b.path("../common/linker.ld")); exe.addIncludePath(b.path("../../common")); const bin = b.addObjCopy(exe.getEmittedBin(), .{ diff --git a/apps/zigdoom/Makefile b/apps/zigdoom/Makefile index c41421c..2cf367c 100644 --- a/apps/zigdoom/Makefile +++ b/apps/zigdoom/Makefile @@ -15,4 +15,4 @@ clean: clean_common test: all ${TOPDIR}/hosts/host-sdl/host-sdl ${HOST_EXTRA} ${PROJECT}.bin -include ${TOPDIR}/apps/makefile.common +include ${TOPDIR}/apps/common/makefile.common diff --git a/apps/zigdoom/build.zig b/apps/zigdoom/build.zig index 5c665ea..ef91964 100644 --- a/apps/zigdoom/build.zig +++ b/apps/zigdoom/build.zig @@ -79,8 +79,8 @@ pub fn build(b: *std.Build) void { b.installArtifact(exe); - exe.addAssemblyFile(b.path("../crt0.S")); - exe.setLinkerScript(b.path("../linker.ld")); + exe.addAssemblyFile(b.path("../common/crt0.S")); + exe.setLinkerScript(b.path("../common/linker.ld")); exe.addIncludePath(b.path("../../common")); const bin = b.addObjCopy(exe.getEmittedBin(), .{ diff --git a/apps/zigtris/Makefile b/apps/zigtris/Makefile index 63b6532..ee38bf1 100644 --- a/apps/zigtris/Makefile +++ b/apps/zigtris/Makefile @@ -12,4 +12,4 @@ clean: clean_common test: all ${TOPDIR}/hosts/host/host ${PROJECT}.bin -include ${TOPDIR}/apps/makefile.common +include ${TOPDIR}/apps/common/makefile.common diff --git a/apps/zigtris/build.zig b/apps/zigtris/build.zig index 72709ac..38cc434 100644 --- a/apps/zigtris/build.zig +++ b/apps/zigtris/build.zig @@ -52,8 +52,8 @@ pub fn build(b: *std.Build) void { b.installArtifact(exe); - exe.addAssemblyFile(b.path("../crt0.S")); - exe.setLinkerScript(b.path("../linker.ld")); + exe.addAssemblyFile(b.path("../common/crt0.S")); + exe.setLinkerScript(b.path("../common/linker.ld")); exe.addIncludePath(b.path("../../common")); const bin = b.addObjCopy(exe.getEmittedBin(), .{ diff --git a/test/basic_syscalls/rom/Makefile b/test/basic_syscalls/rom/Makefile index 4698f22..c85effd 100644 --- a/test/basic_syscalls/rom/Makefile +++ b/test/basic_syscalls/rom/Makefile @@ -1,6 +1,6 @@ TOPDIR=../../../ PROJECT:=$(shell basename ${PWD}) -SRCS=${PROJECT}.c ${TOPDIR}/apps/crt0.S +SRCS=${PROJECT}.c ${TOPDIR}/apps/common/crt0.S all: all_common @# Convert ROM to C file and header @xxd -i ${PROJECT}.bin > ${PROJECT}-header.c @@ -10,4 +10,4 @@ test: test_common clean: clean_common rm -f ${PROJECT}-header.h ${PROJECT}-header.c -include ${TOPDIR}/apps/makefile.common +include ${TOPDIR}/apps/common/makefile.common diff --git a/test/custom_syscall/rom/Makefile b/test/custom_syscall/rom/Makefile index 4698f22..c85effd 100644 --- a/test/custom_syscall/rom/Makefile +++ b/test/custom_syscall/rom/Makefile @@ -1,6 +1,6 @@ TOPDIR=../../../ PROJECT:=$(shell basename ${PWD}) -SRCS=${PROJECT}.c ${TOPDIR}/apps/crt0.S +SRCS=${PROJECT}.c ${TOPDIR}/apps/common/crt0.S all: all_common @# Convert ROM to C file and header @xxd -i ${PROJECT}.bin > ${PROJECT}-header.c @@ -10,4 +10,4 @@ test: test_common clean: clean_common rm -f ${PROJECT}-header.h ${PROJECT}-header.c -include ${TOPDIR}/apps/makefile.common +include ${TOPDIR}/apps/common/makefile.common diff --git a/test/extram/rom/Makefile b/test/extram/rom/Makefile index 4698f22..c85effd 100644 --- a/test/extram/rom/Makefile +++ b/test/extram/rom/Makefile @@ -1,6 +1,6 @@ TOPDIR=../../../ PROJECT:=$(shell basename ${PWD}) -SRCS=${PROJECT}.c ${TOPDIR}/apps/crt0.S +SRCS=${PROJECT}.c ${TOPDIR}/apps/common/crt0.S all: all_common @# Convert ROM to C file and header @xxd -i ${PROJECT}.bin > ${PROJECT}-header.c @@ -10,4 +10,4 @@ test: test_common clean: clean_common rm -f ${PROJECT}-header.h ${PROJECT}-header.c -include ${TOPDIR}/apps/makefile.common +include ${TOPDIR}/apps/common/makefile.common diff --git a/test/meter/rom/Makefile b/test/meter/rom/Makefile index 9f50d69..f831a3b 100644 --- a/test/meter/rom/Makefile +++ b/test/meter/rom/Makefile @@ -1,6 +1,6 @@ TOPDIR=../../../ PROJECT:=$(shell basename ${PWD}) -SRCS=${PROJECT}.c ${TOPDIR}/apps/crt0.S +SRCS=${PROJECT}.c ${TOPDIR}/apps/common/crt0.S OPT=-O0 # don't let optimiser remove stall loop all: all_common @# Convert ROM to C file and header @@ -11,4 +11,4 @@ test: test_common clean: clean_common rm -f ${PROJECT}-header.h ${PROJECT}-header.c -include ${TOPDIR}/apps/makefile.common +include ${TOPDIR}/apps/common/makefile.common diff --git a/test/stackoverflow/rom/Makefile b/test/stackoverflow/rom/Makefile index 6efca22..e5a6ad0 100644 --- a/test/stackoverflow/rom/Makefile +++ b/test/stackoverflow/rom/Makefile @@ -1,6 +1,6 @@ TOPDIR=../../../ PROJECT:=$(shell basename ${PWD}) -SRCS=${PROJECT}.c ${TOPDIR}/apps/crt0.S +SRCS=${PROJECT}.c ${TOPDIR}/apps/common/crt0.S OPT=-O0 # don't optimise all: all_common @# Convert ROM to C file and header @@ -11,4 +11,4 @@ test: test_common clean: clean_common rm -f ${PROJECT}-header.h ${PROJECT}-header.c -include ${TOPDIR}/apps/makefile.common +include ${TOPDIR}/apps/common/makefile.common diff --git a/test/syscall_args/rom/Makefile b/test/syscall_args/rom/Makefile index 4698f22..c85effd 100644 --- a/test/syscall_args/rom/Makefile +++ b/test/syscall_args/rom/Makefile @@ -1,6 +1,6 @@ TOPDIR=../../../ PROJECT:=$(shell basename ${PWD}) -SRCS=${PROJECT}.c ${TOPDIR}/apps/crt0.S +SRCS=${PROJECT}.c ${TOPDIR}/apps/common/crt0.S all: all_common @# Convert ROM to C file and header @xxd -i ${PROJECT}.bin > ${PROJECT}-header.c @@ -10,4 +10,4 @@ test: test_common clean: clean_common rm -f ${PROJECT}-header.h ${PROJECT}-header.c -include ${TOPDIR}/apps/makefile.common +include ${TOPDIR}/apps/common/makefile.common