-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (30 loc) · 798 Bytes
/
Makefile
File metadata and controls
40 lines (30 loc) · 798 Bytes
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
CC = gcc
CPARAMS = -m32 -I include -nostdlib -fno-builtin -fno-exceptions -fno-leading-underscore
AS = as
ASPARAMS = --32
OBJ = arch/loader.o \
mmgt/gdt.o \
io/video_mem.o \
kernel.o
LDPARAMS = -m elf_i386
%.o: %.c
$(CC) $(CPARAMS) -o $@ -c $<
%.o: %.s
$(AS) $(ASPARAMS) -o $@ $<
kernel.bin: linker.ld $(OBJ)
ld $(LDPARAMS) -T $< -o $@ $(OBJ)
kernel.iso: kernel.bin
mkdir iso
mkdir iso/boot
mkdir iso/boot/grub
cp $< iso/boot/
cp ./.buildtools/boot/x86_64/* iso/boot/grub/
genisoimage -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o $@ iso
rm -rf iso
run: kernel.iso
(killall VirtualBox & sleep 1) || true
VirtualBox --startvm "Osdev" &
install: kernel.bin
sudo cp $< /boot/kernel.bin
clean:
rm -f $(OBJ) kernel.bin kernel.iso