-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (42 loc) · 1.45 KB
/
Makefile
File metadata and controls
54 lines (42 loc) · 1.45 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
# Proje adını ve hedef dosyayı tanımlayın
TARGET = funix
# Derleyici ve bayraklar
CC = gcc
CFLAGS = -Wall -Wextra -nostdlib -ffreestanding -O2
# Linker ayarları
LDFLAGS = -T linker.ld
# Kök dizindeki tüm kaynak dosyalar
SRC_ROOT = kernel/main.c kernel/init.c kernel/paging.c kernel/process.c kernel/timer.c kernel/memory.c \
drivers/disk.c drivers/keyboard.c \
fs/vfs.c fs/ext2.c \
net/socket.c net/tcp.c net/udp.c \
shell/shell.c shell/parser.c \
libc/math.c libc/errno.c libc/stdlib.c libc/string.c
# Kök dizindeki tüm header dosyalar
HEADERS = include/assert.h include/ctype.h include/stdio.h include/stddef.h include/stdint.h include/string.h \
kernel/init.h kernel/paging.h kernel/process.h kernel/timer.h kernel/memory.h \
drivers/disk.h drivers/keyboard.h \
fs/vfs.h fs/ext2.h \
net/socket.h net/tcp.h net/udp.h \
shell/shell.h shell/parser.h \
libc/math.h libc/errno.h libc/stdlib.h
# Assembly kaynak dosyaları
ASM_SRC = boot/boot.asm
# Nesne dosyaları
OBJS = $(SRC_ROOT:.c=.o) $(ASM_SRC:.asm=.o)
# Varsayılan hedef
all: $(TARGET)
# Hedef dosya oluşturma
$(TARGET): $(OBJS)
$(CC) $(LDFLAGS) -o $(TARGET) $(OBJS)
# .c dosyalarını derleme
%.o: %.c $(HEADERS)
$(CC) $(CFLAGS) -c $< -o $@
# .asm dosyalarını derleme
%.o: %.asm
nasm -f elf32 $< -o $@
# Temizlik
clean:
rm -f $(OBJS) $(TARGET)
# Yeniden derleme için
rebuild: clean all