update the changelog and releaselog file
[thunix.git] / Makefile
blobe8b46e5ec2033fc43f8228199f9137c5cf56aa0c
1 LD = ld
2 OBJCOPY = objcopy
3 LDFLAGS = -N
4 MAKEFLAGS += --no-print-directory
6 ifeq ("$(origin V)", "command line")
7 MAKEFLAGS +=
8 else
9 MAKEFLAGS += --quiet
10 endif
12 KERNEL_OBJS = boot/head.o init/init.o kernel/kernel.o mm/mm.o fs/fs.o lib/lib.a
14 .PHONY: all ${KERNEL_OBJS} clean backup release
16 all: thunix.img user-progs
18 thunix.img: boot.img kernel.img user-progs
19 @printf "\n%8s %s\n" "MK" $@
20 cat boot.img kernel.img > thunix.img
21 (./gen-test.sh >/dev/null)
23 %.img: %.elf
24 ${OBJCOPY} -O binary $< $@
26 boot.elf: boot/bootsect.o
27 @printf "%8s %s\n" "LD" $@
28 ${LD} ${LDFLAGS} -e start -Ttext 0x7c00 -o $@ $<
30 kernel.elf: ${KERNEL_OBJS}
31 @printf "%8s %s\n" "LD" $@
32 ${LD} ${LDFLAGS} -e pm_mode -Ttext 0x0000 -o $@ ${KERNEL_OBJS} -M > thunix.map
34 boot/bootsect.o:
35 ${MAKE} --directory=boot
36 init/init.o:
37 ${MAKE} --directory=init
38 kernel/kernel.o:
39 ${MAKE} --directory=kernel
40 fs/fs.o:
41 ${MAKE} --directory=fs
42 mm/mm.o:
43 ${MAKE} --directory=mm
44 lib/lib.a:
45 ${MAKE} --directory=lib
47 doc:
48 ${MAKE} --directory=doc
51 user-progs:
52 @printf "\n"
53 ${MAKE} --directory=user
54 cp user/user-test ./
56 release:
57 ./release.sh
59 bochs:
60 bochs -qf bochsrc
61 clean:
62 @printf "%8s *.o *~ boot.img kernle.img *.elf\n" "RM"
63 rm -f bochsout.txt boot.img kernel.img *~ include/*~ *.elf *.map user-test
64 (cd boot; make clean)
65 (cd init; make clean)
66 (cd kernel; make clean)
67 (cd fs; make clean)
68 (cd mm; make clean)
69 (cd lib; make clean)
70 (cd doc; make clean)
71 (cd user; make clean)
73 dep:
74 (cd kernel; make dep)
75 (cd fs; make dep)