-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (31 loc) · 831 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
CC=i686-elf-gcc
CFLAGS=-Wall -I$(shell pwd)/include/ -nostdlib -ffreestanding
LIBS=-lgcc
ROOT=$(shell pwd)/buildroot
ARCH=i686
export
.PHONY: debug clean petix2.iso run run-iso release
debug: CFLAGS+=-g3 -ggdb -O0
debug: subdir
release: CFLAGS+=-O2 -s
release: subdir
petix2.iso:
grub-mkrescue -o $@ $(ROOT)
run:
qemu-system-i386 -initrd "$(ROOT)/boot/initrd.tar initrd" \
-kernel $(ROOT)/boot/kernel \
-serial mon:stdio
run-iso:
qemu-system-i386 -cdrom petix2.iso \
-serial mon:stdio
gdb:
qemu-system-i386 -initrd "$(ROOT)/boot/initrd.tar initrd" \
-kernel $(ROOT)/boot/kernel \
-S -s &
sleep .4
gdb -x .gdbinit
clean: subdir_clean
rm -r $(ROOT)
rm petix2.iso || true
DIRS=skel libc kernel bin initrd
include subdirs.mk