4 MAKEFLAGS
+= --no-print-directory
6 ifeq ("$(origin V)", "command line")
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
)
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
35 ${MAKE} --directory
=boot
37 ${MAKE} --directory
=init
39 ${MAKE} --directory
=kernel
41 ${MAKE} --directory
=fs
43 ${MAKE} --directory
=mm
45 ${MAKE} --directory
=lib
48 ${MAKE} --directory
=doc
53 ${MAKE} clean --directory
=user
54 ${MAKE} --directory
=user
63 qemu
-fda thunix.img
-boot a
66 @printf
"%8s *.o *~ boot.img kernle.img *.elf\n" "RM"
67 rm -f bochsout.txt boot.img kernel.img
*~
include/*~
*.elf
*.map user-test
70 (cd kernel
; make
clean)