diff options
Diffstat (limited to 'src/kernel/Makefile')
-rw-r--r-- | src/kernel/Makefile | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/src/kernel/Makefile b/src/kernel/Makefile new file mode 100644 index 0000000..aa6b3d7 --- /dev/null +++ b/src/kernel/Makefile | |||
@@ -0,0 +1,87 @@ | |||
1 | # | ||
2 | # Makefile for the FREAX-kernel. | ||
3 | # | ||
4 | # Note! Dependencies are done automagically by 'make dep', which also | ||
5 | # removes any old dependencies. DON'T put your own dependencies here | ||
6 | # unless it's something special (ie not a .c file). | ||
7 | # | ||
8 | |||
9 | include ../Makefile.header | ||
10 | |||
11 | LDFLAGS += -r | ||
12 | |||
13 | # NOTE!: do not try to add -On to CFLAGS with gcc4.x, which will optimize the | ||
14 | # memcpy function a lot to let the kernel not work, for fixing this problem, | ||
15 | # please refer to glibc and rewrite the memcpy in include/string.h, or just not | ||
16 | # use any -On options with gcc 4.x when compiling it. in fact, we only can not | ||
17 | # use -On with gcc4.x to compile fork.c, but after that you need to isolate the | ||
18 | # compling procedure of it, it's not good too. for playing with linux-0.11, we | ||
19 | # just have fun, have no much concerning about the performance. | ||
20 | |||
21 | CFLAGS += -I../include | ||
22 | |||
23 | CPP += -I../include | ||
24 | |||
25 | .c.s: | ||
26 | @$(CC) $(CFLAGS) \ | ||
27 | -S -o $*.s $< | ||
28 | .s.o: | ||
29 | @$(AS) -o $*.o $< | ||
30 | .c.o: | ||
31 | @$(CC) $(CFLAGS) \ | ||
32 | -c -o $*.o $< | ||
33 | |||
34 | OBJS = sched.o system_call.o traps.o asm.o fork.o \ | ||
35 | panic.o printk.o vsprintf.o sys.o exit.o \ | ||
36 | signal.o mktime.o | ||
37 | |||
38 | kernel.o: $(OBJS) | ||
39 | @$(LD) $(LDFLAGS) -o kernel.o $(OBJS) | ||
40 | @sync | ||
41 | |||
42 | clean: | ||
43 | @rm -f core *.o *.a tmp_make keyboard.s | ||
44 | @for i in *.c;do rm -f `basename $$i .c`.s;done | ||
45 | @for i in chr_drv blk_drv math; do make clean -C $$i; done | ||
46 | |||
47 | dep: | ||
48 | @sed '/\#\#\# Dependencies/q' < Makefile > tmp_make | ||
49 | @(for i in *.c;do echo -n `echo $$i | sed 's,\.c,\.s,'`" "; \ | ||
50 | $(CPP) -M $$i;done) >> tmp_make | ||
51 | @cp tmp_make Makefile | ||
52 | @for i in chr_drv blk_drv; do make dep -C $$i; done | ||
53 | |||
54 | ### Dependencies: | ||
55 | exit.s exit.o: exit.c ../include/errno.h ../include/signal.h \ | ||
56 | ../include/sys/types.h ../include/sys/wait.h ../include/linux/sched.h \ | ||
57 | ../include/linux/head.h ../include/linux/fs.h ../include/linux/mm.h \ | ||
58 | ../include/linux/kernel.h ../include/linux/tty.h ../include/termios.h \ | ||
59 | ../include/asm/segment.h | ||
60 | fork.s fork.o: fork.c ../include/errno.h ../include/linux/sched.h \ | ||
61 | ../include/linux/head.h ../include/linux/fs.h ../include/sys/types.h \ | ||
62 | ../include/linux/mm.h ../include/signal.h ../include/linux/kernel.h \ | ||
63 | ../include/asm/segment.h ../include/asm/system.h | ||
64 | mktime.s mktime.o: mktime.c ../include/time.h | ||
65 | panic.s panic.o: panic.c ../include/linux/kernel.h ../include/linux/sched.h \ | ||
66 | ../include/linux/head.h ../include/linux/fs.h ../include/sys/types.h \ | ||
67 | ../include/linux/mm.h ../include/signal.h | ||
68 | printk.s printk.o: printk.c ../include/stdarg.h ../include/stddef.h \ | ||
69 | ../include/linux/kernel.h | ||
70 | sched.s sched.o: sched.c ../include/linux/sched.h ../include/linux/head.h \ | ||
71 | ../include/linux/fs.h ../include/sys/types.h ../include/linux/mm.h \ | ||
72 | ../include/signal.h ../include/linux/kernel.h ../include/linux/sys.h \ | ||
73 | ../include/linux/fdreg.h ../include/asm/system.h ../include/asm/io.h \ | ||
74 | ../include/asm/segment.h | ||
75 | signal.s signal.o: signal.c ../include/linux/sched.h ../include/linux/head.h \ | ||
76 | ../include/linux/fs.h ../include/sys/types.h ../include/linux/mm.h \ | ||
77 | ../include/signal.h ../include/linux/kernel.h ../include/asm/segment.h | ||
78 | sys.s sys.o: sys.c ../include/errno.h ../include/linux/sched.h \ | ||
79 | ../include/linux/head.h ../include/linux/fs.h ../include/sys/types.h \ | ||
80 | ../include/linux/mm.h ../include/signal.h ../include/linux/tty.h \ | ||
81 | ../include/termios.h ../include/linux/kernel.h ../include/asm/segment.h \ | ||
82 | ../include/sys/times.h ../include/sys/utsname.h | ||
83 | traps.s traps.o: traps.c ../include/string.h ../include/linux/head.h \ | ||
84 | ../include/linux/sched.h ../include/linux/fs.h ../include/sys/types.h \ | ||
85 | ../include/linux/mm.h ../include/signal.h ../include/linux/kernel.h \ | ||
86 | ../include/asm/system.h ../include/asm/segment.h ../include/asm/io.h | ||
87 | vsprintf.s vsprintf.o: vsprintf.c ../include/stdarg.h ../include/string.h | ||