diff options
| author | Nathan Lee <me@nwlee.tech> | 2026-10-03 21:37:57 -0500 |
|---|---|---|
| committer | Nathan Lee <me@nwlee.tech> | 2026-10-03 21:37:57 -0500 |
| commit | 0189cc9d771e5911b07fbf91ca18da3a338f8d30 (patch) | |
| tree | dbf2c8a366547dda3ec99f752417a4085a5a5599 /website-initramfs/Makefile | |
| parent | 182ad75161c77b4a75d48275979ce44cde213e3f (diff) | |
add first userspace invocation
Diffstat (limited to 'website-initramfs/Makefile')
| -rw-r--r-- | website-initramfs/Makefile | 39 |
1 files changed, 39 insertions, 0 deletions
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 |
