Add chapter 7: ext2 file system implemention
[thunix.git] / Makefile
blob5dcbb2587d6303f2e6c9dbb03c7822cfe8ca1220
1 AS = as -Iinclude
2 CC = gcc -nostdinc -Iinclude #-Wall
3 LD = ld
4 LDFLAGS = --oformat binary -N
6 KERNEL_OBJS = boot/head.o init/init.o kernel/kernel.o fs/ext2_fs.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
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)
37 boot.img: boot/bootsect.o
38 ${LD} ${LDFLAGS} -e start -Ttext 0x7c00 -o $@ $<
39 kernel.img: ${KERNEL_OBJS}
40 ${LD} ${LDFLAGS} -e pm_mode -Ttext 0x0000 -o $@ ${KERNEL_OBJS}
43 backup: clean
44 (cp thunix.img ./image)
45 (rm -f thunix.img)
46 (cd ..; tar -cf /media/Soft/thunix/thunix-0.2-backup.tar thunix)
48 bochs:
49 bochs -qf bochsrc
50 clean:
51 rm -f bochsout.txt boot.img kernel.img *~ include/*~
52 (cd boot; make clean)
53 (cd init; make clean)
54 (cd kernel; make clean)
55 (cd fs; make clean)
58 dep:
59 (cd kernel; make dep)
60 (cd fs; make dep)