]>
Commit | Line | Data |
---|---|---|
5ba3f43e A |
1 | # |
2 | # Mach Operating System | |
3 | # Copyright (c) 1986 Carnegie-Mellon University | |
4 | # All rights reserved. The CMU software License Agreement specifies | |
5 | # the terms and conditions for use and redistribution. | |
6 | # | |
7 | ||
8 | export MakeInc_cmd=${SRCROOT}/makedefs/MakeInc.cmd | |
9 | export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def | |
10 | export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule | |
11 | export MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir | |
12 | ||
13 | include $(MakeInc_cmd) | |
14 | include $(MakeInc_def) | |
15 | ||
a39ff7e2 | 16 | CFLAGS += -Wassign-enum -Wswitch-enum |
5ba3f43e A |
17 | |
18 | # | |
19 | # Directories for mig generated files | |
20 | # | |
21 | COMP_SUBDIRS = | |
22 | ||
23 | # | |
24 | # Make sure we don't remove this by accident if interrupted at the wrong | |
25 | # time. | |
26 | # | |
27 | .PRECIOUS: Makefile | |
28 | ||
29 | # | |
30 | # Theses macros are filled in by the config program depending on the | |
31 | # current configuration. The MACHDEP macro is replaced by the | |
32 | # contents of the machine dependent makefile template and the others | |
33 | # are replaced by the corresponding symbol definitions for the | |
34 | # configuration. | |
35 | # | |
36 | ||
37 | %OBJS | |
38 | ||
39 | %CFILES | |
40 | ||
41 | %CXXFILES | |
42 | ||
43 | %SFILES | |
44 | ||
45 | %MACHDEP | |
46 | ||
47 | # Rebuild if per-file overrides change | |
48 | ${OBJS}: $(firstword $(MAKEFILE_LIST)) | |
49 | ||
d9a64523 | 50 | # set file list manually |
5ba3f43e | 51 | OBJS = |
d9a64523 A |
52 | |
53 | ifeq ($(KASAN),1) | |
54 | OBJS += kasan.o kasan-fakestack.o kasan-memintrinsics.o kasan_dynamic_blacklist.o | |
55 | OBJS += kasan-$(CURRENT_ARCH_CONFIG_LC).o | |
56 | OBJS += kasan-test.o kasan-test-$(CURRENT_ARCH_CONFIG_LC).o | |
57 | endif | |
58 | ||
59 | ifeq ($(UBSAN),1) | |
60 | OBJS += ubsan.o ubsan_log.o | |
5ba3f43e A |
61 | endif |
62 | ||
63 | # Rebuild if global compile flags change | |
64 | $(COBJS): .CFLAGS | |
65 | .CFLAGS: ALWAYS | |
66 | $(_v)$(REPLACECONTENTS) $@ $(KCC) $(CFLAGS) $(INCFLAGS) | |
67 | $(CXXOBJS): .CXXFLAGS | |
68 | .CXXFLAGS: ALWAYS | |
69 | $(_v)$(REPLACECONTENTS) $@ $(KC++) $(CXXFLAGS) $(INCFLAGS) | |
70 | $(SOBJS): .SFLAGS | |
71 | .SFLAGS: ALWAYS | |
72 | $(_v)$(REPLACECONTENTS) $@ $(S_KCC) $(SFLAGS) $(INCFLAGS) | |
73 | ||
74 | # rebuild file list if kasan-ness changes | |
75 | .KASANFLAGS: ALWAYS | |
76 | $(_v)$(REPLACECONTENTS) $@ $(KASAN) | |
77 | ||
78 | $(COMPONENT).filelist: $(OBJS) .KASANFLAGS | |
79 | @echo "$(ColorL)LDFILELIST$(Color0) $(ColorLF)$(COMPONENT)$(Color0)" | |
80 | $(_v)for obj in ${OBJS}; do \ | |
81 | echo $(TARGET)/$(CURRENT_KERNEL_CONFIG)/$${obj}; \ | |
82 | done > $(COMPONENT).filelist | |
83 | ||
84 | $(TARGET)/$(CURRENT_KERNEL_CONFIG)/kasan_blacklist_dynamic.h: $(SRCROOT)/$(COMPONENT)/kasan-blacklist-dynamic | |
85 | @echo "$(ColorH)GENERATING$(Color0) $(ColorLF)$(notdir $@)$(Color0)" | |
86 | @$(SRCROOT)/$(COMPONENT)/tools/generate_dynamic_blacklist.py "$<" > "$@" | |
87 | ||
88 | $(SRCROOT)/$(COMPONENT)/kasan_dynamic_blacklist.c: $(TARGET)/$(CURRENT_KERNEL_CONFIG)/kasan_blacklist_dynamic.h | |
89 | ||
90 | do_all: $(COMPONENT).filelist | |
91 | ||
92 | do_build_all:: do_all | |
93 | ||
94 | %RULES | |
95 | ||
96 | include $(MakeInc_rule) | |
97 | include $(MakeInc_dir) |