]> git.saurik.com Git - apple/xnu.git/blame - san/conf/Makefile.template
xnu-4903.221.2.tar.gz
[apple/xnu.git] / san / conf / Makefile.template
CommitLineData
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
8export MakeInc_cmd=${SRCROOT}/makedefs/MakeInc.cmd
9export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def
10export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule
11export MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir
12
13include $(MakeInc_cmd)
14include $(MakeInc_def)
15
a39ff7e2 16CFLAGS += -Wassign-enum -Wswitch-enum
5ba3f43e
A
17
18#
19# Directories for mig generated files
20#
21COMP_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 51OBJS =
d9a64523
A
52
53ifeq ($(KASAN),1)
54OBJS += kasan.o kasan-fakestack.o kasan-memintrinsics.o kasan_dynamic_blacklist.o
55OBJS += kasan-$(CURRENT_ARCH_CONFIG_LC).o
56OBJS += kasan-test.o kasan-test-$(CURRENT_ARCH_CONFIG_LC).o
57endif
58
59ifeq ($(UBSAN),1)
60OBJS += ubsan.o ubsan_log.o
5ba3f43e
A
61endif
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
90do_all: $(COMPONENT).filelist
91
92do_build_all:: do_all
93
94%RULES
95
96include $(MakeInc_rule)
97include $(MakeInc_dir)