forked from mischief/goose
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
47 lines (35 loc) · 915 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
GO_CROSS = i386-elf-gccgo
LD_CROSS = i386-elf-ld
ASM = nasm -f elf
GOFLAGS_CROSS = -static -Werror -nostdlib
all: kernel.iso
.PHONY: clean
clean:
rm -f isodir/boot/{kernel.bin,main,proc2} kernel.iso loader.o
make -C kernel clean
make -C bootstrap clean
make -C testapp clean
.PHONY: boot-nogrub
boot-nogrub: kernel.bin
qemu-system-i386 -kernel isodir/boot/kernel.bin -m 1024
.PHONY: boot
boot: kernel.iso
qemu-system-x86_64 -no-reboot -d int -cdrom kernel.iso
.PHONY: bochs
bochs: kernel.iso
bochs -q
kernel.bin: loader.o bootstrap.a kernel.o
$(LD_CROSS) -t link.ld --whole-archive -o isodir/boot/kernel.bin loader.o kernel/kernel.o bootstrap/bootstrap.a
kernel.iso: kernel.bin apps
grub-mkrescue -o kernel.iso isodir
.PHONY: apps
apps:
make -C testapp
loader.o: loader.s
$(ASM) -o $@ $<
.PHONY: kernel.o
kernel.o:
make -C kernel kernel.o
.PHONY: bootstrap.a
bootstrap.a:
make -C bootstrap