-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (24 loc) · 732 Bytes
/
Makefile
File metadata and controls
30 lines (24 loc) · 732 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
BINPATH = ${HOME}/opt/cross/bin
bootloader = boot.s
bootloader_out = boot.o
ASM = ${BINPATH}/i686-elf-as
ASMFLAGS =
ASMOUT = -o ${bootloader_out}
kernel = kernel.c
kernel_out = kernel.o
CC = ${BINPATH}/i686-elf-gcc
CCFLAGS = -c ${kernel} -std=gnu99 -ffreestanding -O2 -Wall -Wextra
CCOUT = -o ${kernel_out}
linker = linker.ld
os_out = ftcos.bin
LD = ${BINPATH}/i686-elf-ld #not used
LDFLAGS = -T ${linker} -o bin/${os_out} -ffreestanding -O2 -nostdlib ${bootloader_out} ${kernel_out} -lgcc
OSDIR = ./isodir/boot/
build:
${ASM} ${bootloader} ${ASMFLAGS} ${ASMOUT}
${CC} ${CCFLAGS} ${CCOUT}
${CC} ${LDFLAGS}
boot:
cp bin/${os_out} ${OSDIR}
grub-mkrescue -o ftcos.iso isodir
qemu-system-i386 -cdrom ftcos.iso