-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
36 lines (26 loc) · 979 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
all: kernel.obj
%.os: %.asm
nasm -f elf $< -o $@
kernel.o: kernel.adb kernel.ads
gnat compile -c kernel.adb
multiboot.o: multiboot.ads
gnat compile -c multiboot.ads
kernel-stdlib.o: kernel-stdlib.ads kernel-stdlib.adb
gnat compile -c kernel-stdlib.adb
kernel.obj: linker.ld stub.os kernel.o multiboot.o \
kernel-stdlib.o kernel-video-cga.o
ld -Tlinker.ld -o $@ stub.os kernel.o multiboot.o \
kernel-stdlib.o kernel-video-cga.o
kernel-video-cga.o: kernel-video-cga.ads kernel-video-cga.adb
gnat compile -c kernel-video-cga.adb
image.iso: kernel.obj grub.conf
mkdir -p isofiles/boot/grub
cp -f /usr/share/grub/i386-redhat/stage2_eltorito isofiles/boot/grub
cp -f grub.conf isofiles/boot/grub
cp -f kernel.obj isofiles/
genisoimage -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o image.iso isofiles
run: image.iso
qemu -cdrom image.iso
.PHONY: run clean
clean:
rm -rf isofiles kernel.obj *.os *.o *~ *.ppu *.iso *.s