-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
executable file
·88 lines (76 loc) · 1.21 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
# teppich
TARG = i686-linux-gnu
CC := $(TARG)-gcc-11
LD := $(TARG)-ld.bfd
AS := $(TARG)-as
CFLAGS +=-O0 -nostdinc -Iinclude/ -ffreestanding -fcommon -fno-pie
ASFLAGS +=
LDFLAGS += -T linker.ld -z noexecstack
QEMU ?= qemu-system-i386
QFLAGS +=-machine accel=kvm:tcg -m 16M -serial stdio -kernel teppich.elf
F = \
fs/vfs.o\
fs/rootfs.o\
fs/cmdfs.o\
fs/envfs.o\
C = \
cmd/rc.o\
cmd/echo.o\
cmd/clear.o\
cmd/check.o\
cmd/cal.o\
cmd/ls.o\
cmd/reboot.o\
cmd/memory.o\
cmd/cat.o\
cmd/login.o\
cmd/id.o\
cmd/wc.o\
cmd/od.o\
L = \
libc/strlen.o\
libc/strcmp.o\
libc/strcntok.o\
libc/strccnt.o\
libc/strtol.o\
libc/strncpy.o\
libc/strncat.o\
libc/strdup.o\
libc/memcpy.o\
libc/memset.o\
libc/lladd.o\
libc/lldel.o\
libc/lllen.o\
libc/llfree.o\
libc/printf.o\
libc/scanf.o\
libc/itoa.o\
libc/adler32.o\
libc/malloc.o\
libc/free.o\
libc/panic.o\
K = \
pc/boot.o\
pc/x86.o\
pc/kern.o\
pc/vga.o\
pc/ps2.o\
pc/com.o\
pc/mem.o\
pc/cons.o\
pc/bitmap.o\
pc/user.o\
${L}\
${C}\
${F}\
all: teppich.elf
%.o: %.c %.h
$(CC) $(CFLAGS) -c $< -o $@
%.o: %.s
$(AS) $(ASFLAGS) $< -o $@
teppich.elf: ${K}
$(LD) $(LDFLAGS) -o $@ ${K}
clean:
rm -f *.o *.elf ${K}
qemu: teppich.elf
$(QEMU) $(QFLAGS)