From 0189cc9d771e5911b07fbf91ca18da3a338f8d30 Mon Sep 17 00:00:00 2001 From: Nathan Lee Date: Sat, 3 Oct 2026 21:37:57 -0500 Subject: add first userspace invocation --- website-initramfs/Makefile | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 website-initramfs/Makefile (limited to 'website-initramfs/Makefile') diff --git a/website-initramfs/Makefile b/website-initramfs/Makefile new file mode 100644 index 0000000..57d303b --- /dev/null +++ b/website-initramfs/Makefile @@ -0,0 +1,39 @@ +CC = clang +LD = ld.lld +OBJCOPY = llvm-objcopy + +CFLAGS = \ + --target=riscv32-unknown-elf \ + -march=rv32im_zicsr \ + -mabi=ilp32 \ + -ffreestanding \ + -fno-builtin \ + -nostdlib \ + -nostdinc \ + -nodefaultlibs \ + -O2 -g3 \ + -Wall -Wextra -Werror -Wundef + +C_SRCS = $(shell find progs -type f -name "*.c") +S_SRCS = $(shell find progs -type f -name "*.S") +SRCS = $(C_SRCS) $(S_SRCS) +OBJS = $(basename $(SRCS)) + +$(V).SILENT: +progs: $(OBJS) + +%: %.c + @echo " CC $<" + $(CC) $(CFLAGS) $< -o $@ +%: %.S + @echo " AS $<" + $(CC) $(CFLAGS) -fuse-ld=lld $< -o $@ + +.PHONY: progs mkinitrd all clean +mkinitrd: + @echo " MKINITRD" + find . -print0 | cpio --null -ov -H newc > initramfs.cpio +clean: + @echo " CLEAN $(OBJS) initramfs.cpio" + $(RM) -f $(OBJS) initramfs.cpio +all: progs mkinitrd -- cgit v1.2.3