Makefile cleaup
[thunix.git] / Makefile
blob1d7e249f57c53ce80f329346c0a5e793b3faeba3
1 LD = ld
2 LDFLAGS = --oformat binary -N
3 MAKEFLAGS += --no-print-directory
5 ifeq ("$(origin V)", "command line")
6 MAKEFLAGS +=
7 else
8 MAKEFLAGS += --quiet
9 endif
11 KERNEL_OBJS = boot/head.o init/init.o kernel/kernel.o mm/mm.o fs/fs.o
13 .PHONY :clean backup release
15 all: thunix.img doc
17 thunix.img: boot.img kernel.img
18 @printf "%8s %s\n" "MK" $@
19 cat boot.img kernel.img > thunix.img
20 (./gen-test.sh >/dev/null)
22 boot.img: boot/bootsect.o
23 @printf "%8s %s\n" "LD" $@
24 ${LD} ${LDFLAGS} -e start -Ttext 0x7c00 -o $@ $<
25 kernel.img: ${KERNEL_OBJS}
26 @printf "%8s %s\n" "LD" $@
27 ${LD} ${LDFLAGS} -e pm_mode -Ttext 0x0000 -o $@ ${KERNEL_OBJS}
29 boot/bootsect.o:
30 (cd boot; make)
31 init/init.o:
32 (cd init; make)
33 kernel/kernel.o:
34 (cd kernel; make)
35 fs/fs.o:
36 (cd fs; make)
37 mm/mm.o:
38 (cd mm; make)
40 doc:
41 (cd doc; make)
43 release:
44 ./release.sh
46 bochs:
47 bochs -qf bochsrc
48 clean:
49 rm -f bochsout.txt boot.img kernel.img *~ include/*~
50 (cd boot; make clean)
51 (cd init; make clean)
52 (cd kernel; make clean)
53 (cd fs; make clean)
54 (cd mm; make clean)
55 (cd doc; make clean)
57 dep:
58 (cd kernel; make dep)
59 (cd fs; make dep)