-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
109 lines (90 loc) · 2.82 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
CFLAGS = -m32 -ggdb -ffreestanding -falign-jumps -falign-functions -falign-labels -falign-loops -fstrength-reduce -fomit-frame-pointer -finline-functions -Wno-unused-function -fno-builtin -Werror -Wno-unused-label -Wno-cpp -Wno-unused-parameter -nostdlib -nostartfiles -nodefaultlibs -Wall -O0 -Iinc
TESTING_CFLAGS = -m32 -ggdb -ffreestanding -falign-jumps -falign-functions -falign-labels -falign-loops -fstrength-reduce -fomit-frame-pointer -finline-functions -Wno-unused-function -fno-builtin -Werror -Wno-unused-label -Wno-cpp -Wno-unused-parameter -Wall -O0 -Iinc
ASPARAMS = --32
LDPARAMS = -melf_i386 -g
objects = ./build/loader.o \
./build/kernel.o \
./build/tty.o \
./build/multiboot_util.o \
./build/stdio.o \
./build/qemu_debug.o \
./build/cpu_info.o \
./build/string.o \
./build/io_port.o \
./build/vga_driver.o \
./build/pic.o \
./build/gdt_flush.o \
./build/gdt.o \
./build/idt_flush.o \
./build/idt.o \
./build/exception_helper.o \
./build/exception.o \
./build/interrupt_helper.o \
./build/interrupt.o \
./build/tss_flush.o \
./build/tss.o \
./build/timer.o \
./build/keyboard.o \
./build/paging_enable.o \
./build/paging.o \
./build/kernel_heap.o \
./build/render_font.o \
./build/panic.o \
./build/options.o \
./build/render_image.o \
./build/tty_cursor.o \
./build/multiboot_module.o \
./build/art_linked_list.o \
./build/cmos.o \
./build/math.o \
./build/stdlib.o \
./build/bresenham.o \
./build/tempfs.o \
./build/tempfs_initrd.o \
_mkdir := $(shell mkdir -p build)
# LIBC TESTING
testing:
gcc -o libc_testing kernel/libc/stdlib.c tests/libc/stdlib_test.c
# BASE KERNEL SOURCE
build/%.o: kernel/src/%.c
i686-elf-gcc $(CFLAGS) -c -o $@ $<
# LIBC
build/%.o: kernel/libc/%.c
i686-elf-gcc $(CFLAGS) -c -o $@ $<
# Driver
build/%.o: kernel/driver/%.c
i686-elf-gcc $(CFLAGS) -c -o $@ $<
# Descriptor tables
build/%.o: kernel/descriptor_tables/asm/%.asm
nasm -f elf32 -o $@ $<
build/%.o: kernel/descriptor_tables/src/%.c
i686-elf-gcc $(CFLAGS) -c -o $@ $<
# GUI
build/%.o: gui/%.c
i686-elf-gcc $(CFLAGS) -c -o $@ $<
# MEMORY
build/%.o: kernel/memory/asm/%.asm
nasm -f elf32 -o $@ $<
# FILE SYSTEM
build/%.o: kernel/fs/tempfs/%.c
i686-elf-gcc $(CFLAGS) -c -o $@ $<
# UTIL
build/%.o: util/%.c
i686-elf-gcc $(CFLAGS) -c -o $@ $<
build/%.o: kernel/memory/src/%.c
i686-elf-gcc $(CFLAGS) -c -o $@ $<
# LOADER ASM
build/%.o: boot/%.asm
nasm -f elf32 -o $@ $<
kernel.elf: linker.ld $(objects)
i686-elf-ld $(LDPARAMS) -T $< -o $@ $(objects)
all: kernel.elf
install: kernel.elf
sudo cp $< /boot/mykernel.elf
iso: kernel.elf
./scripts/create_iso.sh
clean:
rm -rf ./iso/
rm -rf ./build/
rm -f kernel.elf
rm -f artillery.iso