-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (55 loc) · 2.87 KB
/
Makefile
File metadata and controls
75 lines (55 loc) · 2.87 KB
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
FILES = ./build/kernel.asm.o ./build/kernel.o ./build/idt/idt.asm.o ./build/idt/idt.o ./build/memory/memory.o ./build/io/io.asm.o ./build/memory/heap/heap.o ./build/memory/heap/kheap.o ./build/paging/paging.o ./build/paging/paging.asm.o ./build/disk/disk.o ./build/string/string.o ./build/fs/pparser.o ./build/disk/streamer.o ./build/fs/file.o ./build/fs/fat/fat16.o
FLAGS = -g -ffreestanding -falign-jumps -falign-functions -falign-labels -falign-jumps -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
INCLUDES = -Iincludes
all: ./bin/boot.bin ./bin/kernel.bin
rm -rf ./bin/os.bin
dd if=./bin/boot.bin >> ./bin/os.bin
dd if=./bin/kernel.bin >> ./bin/os.bin
dd if=/dev/zero bs=1048576 count=16 >> ./bin/os.bin
sudo mount -t vfat ./bin/os.bin /mnt/z
#Copy a file
sudo cp ./hello.txt /mnt/z
sudo umount /mnt/z
./bin/boot.bin: ./src/boot/boot.asm #Bootloader binarysi çıkarıyor.
nasm -f bin src/boot/boot.asm -o bin/boot.bin
./bin/kernel.bin: $(FILES)
i686-elf-ld -g -relocatable $(FILES) -o ./build/kernelfull.o
i686-elf-gcc $(FLAGS) -T ./src/linker.ld -ffreestanding -O0 -nostdlib ./build/kernelfull.o -o ./bin/kernel.bin
./build/kernel.asm.o: ./src/kernel.asm
nasm -f elf -g ./src/kernel.asm -o ./build/kernel.asm.o
./build/kernel.o: ./src/kernel.c
i686-elf-gcc $(INCLUDES) $(FLAGS) -std=gnu99 -c $< -o $@
./build/idt/idt.asm.o: ./src/idt/idt.asm
nasm -f elf -g $< -o $@
./build/idt/idt.o: ./src/idt/idt.c
i686-elf-gcc $(INCLUDES) $(FLAGS) -std=gnu99 -c $< -o $@
./build/memory/memory.o: ./src/memory/memory.c
i686-elf-gcc $(INCLUDES) $(FLAGS) -std=gnu99 -c $< -o $@
./build/memory/heap/heap.o: ./src/memory/heap/heap.c
i686-elf-gcc $(INCLUDES) $(FLAGS) -std=gnu99 -c $< -o $@
./build/memory/heap/kheap.o: ./src/memory/heap/kheap.c
i686-elf-gcc $(INCLUDES) $(FLAGS) -std=gnu99 -c $< -o $@
./build/io/io.asm.o: ./src/io/io.asm
nasm -f elf -g $< -o $@
./build/paging/paging.asm.o: ./src/paging/paging.asm
nasm -f elf -g $< -o $@
./build/paging/paging.o: ./src/paging/paging.c
i686-elf-gcc $(INCLUDES) $(FLAGS) -std=gnu99 -c $< -o $@
./build/disk/disk.o: ./src/disk/disk.c
i686-elf-gcc $(INCLUDES) $(FLAGS) -std=gnu99 -c $< -o $@
./build/fs/pparser.o: ./src/fs/pparser.c
i686-elf-gcc $(INCLUDES) $(FLAGS) -std=gnu99 -c $< -o $@
./build/string/string.o: ./src/string/string.c
i686-elf-gcc $(INCLUDES) $(FLAGS) -std=gnu99 -c $< -o $@
./build/disk/streamer.o: ./src/disk/streamer.c
i686-elf-gcc $(INCLUDES) $(FLAGS) -std=gnu99 -c $< -o $@
./build/fs/file.o: ./src/fs/file.c
i686-elf-gcc $(INCLUDES) $(FLAGS) -std=gnu99 -c $< -o $@
./build/fs/fat/fat16.o: ./src/fs/fat/fat16.c
i686-elf-gcc $(INCLUDES) $(FLAGS) -std=gnu99 -c $< -o $@
clean:
rm -rf bin/boot.bin
rm -rf bin/kernel.bin
rm -rf bin/os.bin
rm -rf ${FILES}
rm -rf build/kernelfull.o