From c173df46a0a12fe52fdf13323f967e9117462096 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Mon, 12 Aug 2024 08:24:44 +0200 Subject: Initial commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mainly with the code I took from @popovicu's blog. Signed-off-by: Miquel Sabaté Solà --- init/Makefile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 init/Makefile (limited to 'init/Makefile') diff --git a/init/Makefile b/init/Makefile new file mode 100644 index 0000000..71405c3 --- /dev/null +++ b/init/Makefile @@ -0,0 +1,21 @@ +CROSS_CC ?= riscv64-suse-linux-gcc +CROSS_LD ?= riscv64-suse-linux-ld +CCFLAGS = -static + +## +# Targets + +.PHONY: hello +hello: clean + $(CROSS_CC) $(CCFLAGS) -o init hello.c + cpio -o -H newc < file_list.txt > initramfs.cpio + +.PHONY: shell +shell: clean + $(CROSS_CC) $(CCFLAGS) -o init shell.c + GOOS=linux GOARCH=riscv64 go build little_shell.go + cpio -o -H newc < file_list.txt > initramfs.cpio + +.PHONY: clean +clean: + @rm -f *.o init initramfs.cpio -- cgit v1.2.3