aboutsummaryrefslogtreecommitdiff
path: root/init/Makefile
blob: 71405c34da37730109123f09cc37e96ad0aeb7d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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