Add malloc stuff
[thunix.git] / Makefile
blob9ab1d73a8e9c43ee260d76566646fd5865adfb3b
1 AS = as -Iinclude
2 CC = gcc -nostdinc -Iinclude -Wall -Wno-unused-function
3 LD = ld
4 LDFLAGS = --oformat binary -N
6 KERNEL_OBJS = boot/head.o init/init.o kernel/kernel.o fs/ext2_fs.o mm/mm.o
8 .PHONY :clean backup
12 .c.s:
13 ${CC} -S -o $*.s $<
14 .s.o:
15 ${AS} -o $*.o $<
16 .c.o:
17 ${CC} -c -o $*.o $<
20 all: thunix.img doc
22 thunix.img: boot.img kernel.img
23 cat boot.img kernel.img > thunix.img
24 @wc -c thunix.img
28 boot/boot.o:
29 (cd boot; make)
30 init/init.o:
31 (cd init; make)
32 kernel/kernel.o:
33 (cd kernel; make)
34 fs/ext2_fs.o:
35 (cd fs; make)
36 mm/mm.o:
37 (cd mm; make)
39 boot.img: boot/bootsect.o
40 ${LD} ${LDFLAGS} -e start -Ttext 0x7c00 -o $@ $<
41 kernel.img: ${KERNEL_OBJS}
42 ${LD} ${LDFLAGS} -e pm_mode -Ttext 0x0000 -o $@ ${KERNEL_OBJS}
44 doc:
45 (cd doc; make)
47 backup: clean
48 (cp thunix.img ./image)
49 (rm -f thunix.img)
50 (cd ..; tar -cf /media/Soft/thunix/thunix-0.2-backup.tar thunix)
52 bochs:
53 bochs -qf bochsrc
54 clean:
55 rm -f bochsout.txt boot.img kernel.img *~ include/*~
56 (cd boot; make clean)
57 (cd init; make clean)
58 (cd kernel; make clean)
59 (cd fs; make clean)
60 (cd mm; make clean)
61 (cd doc; make clean)
63 dep:
64 (cd kernel; make dep)
65 (cd fs; make dep)