kbd: use a better get_key method
[thunix.git] / Makefile
blobc42c9116aa20fd8b5ec77c2acf216581455502a7
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} clean --directory=user
54 ${MAKE} --directory=user
56 release:
57 ./release.sh
59 bochs:
60 bochs -qf bochsrc
62 qemu:
63 qemu -fda thunix.img -boot a
65 clean:
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
68 (cd boot; make clean)
69 (cd init; make clean)
70 (cd kernel; make clean)
71 (cd fs; make clean)
72 (cd mm; make clean)
73 (cd lib; make clean)
74 (cd doc; make clean)
75 (cd user; make clean)
77 dep:
78 (cd kernel; make dep)
79 (cd fs; make dep)