-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
60 lines (46 loc) · 1.68 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
-include Make.conf
.PHONY: clean all run
all: symlist quick_recompile BOOT_IMAGE
run: quick_recompile BOOT_IMAGE
ifeq ($(modern), yes)
$(EMU) $(EMU_OPTS) $(EMU_OPTS_CUTTING_EDGE)
else
$(EMU) $(EMU_OPTS)
endif
# modern=yes will attempt to use modern features. If the cpu does not support it, it will fallback to something else
kvm: quick_recompile BOOT_IMAGE
ifeq ($(modern), yes)
$(EMU) $(EMU_OPTS) $(EMU_OPTS_KVM) $(EMU_OPTS_CUTTING_EDGE)
else
$(EMU) $(EMU_OPTS) $(EMU_OPTS_KVM)
endif
$(KERNEL_ELF):
@$(MAKE) --no-print-directory -C kernel
symlist:
@echo '#include "sym.h"' > scripts/parsed.sym
@echo 'SymbolTable symbol_table[] = {{0xFFFFFFFFFFFFFFFF, ""}};' >> scripts/parsed.sym
$(CC) -x c $(CHARDFLAGS) -I kernel/trace -I libs/ -m64 -c scripts/parsed.sym -o kernel/trace/symtable.o
libs:
@$(MAKE) --no-print-directory -C libs all
clean:
@$(MAKE) --no-print-directory -C kernel clean
@$(MAKE) --no-print-directory -C libs clean
@$(MAKE) --no-print-directory -C service clean
debug: quick_recompile
$(DEBUG_TERMINAL) $(DEBUG_TERMINAL_OPTS) ./meta/debug-util/debug.sh &
$(EMU) $(EMU_DEBUG_OPTS)
test:
cd meta/tests && CEEDLING_MAIN_PROJECT_FILE=project-$(ARCH)-$(BOARD).yml ceedling
clean_test:
cd meta/tests && CEEDLING_MAIN_PROJECT_FILE=project-$(ARCH)-$(BOARD).yml ceedling clean
distclean_test:
rm -rf meta/tests/build
# FIXME: Use .d files instead of this
# Remove the elf file while saving all object files (fewer files will be recompiled)
quick_recompile: symlist
@rm -f kernel/kernel.elf
@printf "\n"
@$(MAKE) --no-print-directory -C libs
@$(MAKE) --no-print-directory -C service
@$(MAKE) --no-print-directory -C kernel
-include meta/build/make/Makefile.$(ARCH).$(BOARD).conf