-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
23 lines (16 loc) · 878 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
#OBJECTS = boot.o descriptor-tables.o isr.o dt.o port-io.o vga.o tty.o serial.o kmain.o
OBJECTS = boot.o port-io.o vga.o tty.o serial.o kmain.o
CC = ~/opt/cross/bin/i686-elf-gcc
#CFLAGS = -m32 -nostdlib -nostdinc -fno-builtin -fno-stack-protector \
-nostartfiles -nodefaultlibs -Wall -Wextra -Werror -c
CFLAGS = -ffreestanding -nostdlib -lgcc -fno-stack-protector -Wall -Wextra -c
LDFLAGS = -T linker.ld -melf_i386
AS = nasm
ASFLAGS = -felf32
all: kernel.elf
kernel.elf: $(OBJECTS) ; ld $(LDFLAGS) $(OBJECTS) -o kernel.elf
os.iso: kernel.elf ; cp kernel.elf iso/boot/kernel.elf ; genisoimage -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -A os -input-charset utf8 -quiet -boot-info-table -o os.iso iso
run: os.iso ; bochs -f bochsrc.txt -q
%.o: %.c ; $(CC) $(CFLAGS) $< -o $@
%.o: %.s ; $(AS) $(ASFLAGS) $< -o $@
clean: ; rm -rf *.o kernel.elf os.iso