-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
83 lines (58 loc) · 1.87 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
export CFGDIR:=$(abspath .)
include config.mk
# the kernel doesn't support use of coprocessors in kernel mode.
CFLAGS+=-mno-mmx -mno-sse -mno-avx
.PHONY: all clean distclean check qcheck
all: tags
+@make -C lib all
+@make -C user all
+@make -C mbiloader all
+@make ia32-kernel
clean:
@rm -f *.o $(CLEAN_PATS)
+@make -C user clean
+@make -C mbiloader clean
+@make -C lib clean
distclean: clean
@rm -f ia32-kernel tags
@rm -rf .deps
+@make -C user distclean
+@make -C mbiloader distclean
+@make -C lib distclean
@find . -name ".deps" -type d -print|xargs rm -rf
# TODO: skip testbench self-tests only if the perl source, and its test code,
# hasn't changed since "testbench" and "ia32-kernel". (bit of a tall order,
# this.)
qcheck: all
@echo "--- In-kernel tests..."
@KTEST=1 user/testbench/report.pl
@echo "--- Userspace tests..."
@user/testbench/report.pl
@echo "--- All tests completed!"
check: all
@echo "--- Framework self-tests..."
+@make -C user/testbench check
+@make qcheck
slowcheck:
+@make check TEST_SLOW=1
slowercheck:
+@make check TEST_SLOWER=1
tags: $(shell find . -iname "*.[ch]" -or -iname "*.p[lm]")
@ctags -R *
ia32-kernel: linker.ld loader.o kmain.o kip.o cpu.o heap.o thread.o \
ktest.o trace.o ptab_32bit.o \
sched.o exception.o space.o ipc.o ipc_typed.o mapdb.o arch_x86.o \
acpi.o gdt.o idt.o irq.o pic.o apic.o isr.o timer.o context.o \
rangealloc.o dlmalloc.o tap.o ccan-htable.o ccan-list.o
@echo " LD $@"
@$(LD) -T linker.ld -o $@ $(filter %.o,$^) \
$(LDFLAGS) -L lib -lukernel_util \
$(shell gcc $(CFLAGS) -print-libgcc-file-name)
dlmalloc.o: CFLAGS += -Wno-unused-variable
# mostly for tap.o
%.o: user/testbench/%.c
@echo " CC $@ <user>"
@$(CC) -c -o $@ $< $(CFLAGS) -nostartfiles -nodefaultlibs -MMD
@test -d .deps || mkdir -p .deps
@mv $(subst user/testbench/,,$(<:.c=.d)) .deps/
include $(wildcard .deps/*.d)