]> git.saurik.com Git - apple/xnu.git/blob - libkern/conf/Makefile.template
2f78dc30e0c7cce44ee363a3d1ca1c35c4de42bd
[apple/xnu.git] / libkern / conf / Makefile.template
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
16 #
17 # CFLAGS
18 #
19 CFLAGS+= -include meta_features.h -DLIBKERN_KERNEL_PRIVATE -DOSALLOCDEBUG=1
20 SFLAGS+= -include meta_features.h
21
22 # Runtime support functions don't interact well with LTO (9294679)
23 stack_protector.o_CFLAGS_ADD += $(CFLAGS_NOLTO_FLAG)
24
25 #
26 # Directories for mig generated files
27 #
28 COMP_SUBDIRS =
29
30 #
31 # Make sure we don't remove this by accident if interrupted at the wrong
32 # time.
33 #
34 .PRECIOUS: Makefile
35
36 #
37 # Theses macros are filled in by the config program depending on the
38 # current configuration. The MACHDEP macro is replaced by the
39 # contents of the machine dependent makefile template and the others
40 # are replaced by the corresponding symbol definitions for the
41 # configuration.
42 #
43
44 %OBJS
45
46 %LIBOBJS
47
48 %CFILES
49
50 %CXXFILES
51
52 %SFILES
53
54 %MACHDEP
55
56 #
57 # Machine-independent per-file flags
58 #
59
60 #
61 # Diagnostic opt-outs. We need to make this list empty.
62 #
63 # DO NOT ADD MORE HERE.
64 #
65 # -Wno-cast-align
66 OSKext.cpo_CXXWARNFLAGS_ADD += -Wno-cast-align
67 OSKextLib.cpo_CXXWARNFLAGS_ADD += -Wno-cast-align
68 OSMetaClass.cpo_CXXWARNFLAGS_ADD += -Wno-cast-align
69 OSUnserialize.cpo_CXXWARNFLAGS_ADD += -Wno-cast-align
70 corecrypto_md5.o_CFLAGS_ADD += -Wno-cast-align
71 corecrypto_sha1.o_CFLAGS_ADD += -Wno-cast-align
72 # -Wno-cast-qual
73 OSKext.cpo_CXXWARNFLAGS_ADD += -Wno-cast-qual
74 compress.o_CFLAGS_ADD += -Wno-cast-qual
75 deflate.o_CFLAGS_ADD += -Wno-cast-qual
76 runtime.cpo_CXXWARNFLAGS_ADD += -Wno-cast-qual
77 trees.o_CFLAGS_ADD += -Wno-cast-qual
78 uncompr.o_CFLAGS_ADD += -Wno-cast-qual
79 # -Wno-implicit-int-conversion
80 OSUnserialize.cpo_CXXWARNFLAGS_ADD += -Wno-implicit-int-conversion
81 OSUnserializeXML.cpo_CXXWARNFLAGS_ADD += -Wno-implicit-int-conversion
82 kxld_sym.o_CFLAGS_ADD += -Wno-implicit-int-conversion
83 log.o_CFLAGS_ADD += -Wno-implicit-int-conversion
84 scanf.o_CFLAGS_ADD += -Wno-implicit-int-conversion
85 # -Wno-missing-prototypes
86 OSRuntime.cpo_CXXWARNFLAGS_ADD += -Wno-missing-prototypes
87 # -Wno-shorten-64-to-32
88 OSKext.cpo_CXXWARNFLAGS_ADD += -Wno-shorten-64-to-32
89 OSUnserialize.cpo_CXXWARNFLAGS_ADD += -Wno-shorten-64-to-32
90 OSUnserializeXML.cpo_CXXWARNFLAGS_ADD += -Wno-shorten-64-to-32
91 log.o_CFLAGS_ADD += -Wno-shorten-64-to-32
92 scanf.o_CFLAGS_ADD += -Wno-shorten-64-to-32
93 # -Wno-sign-conversion
94 OSCollection.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
95 OSData.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
96 OSDebug.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
97 OSKext.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
98 OSKextVersion.o_CFLAGS_ADD += -Wno-sign-conversion
99 OSMetaClass.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
100 OSNumber.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
101 OSObject.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
102 OSRuntime.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
103 OSSerializeBinary.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
104 OSSet.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
105 OSString.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
106 OSUnserialize.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
107 OSUnserializeXML.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
108 adler32.o_CFLAGS_ADD += -Wno-sign-conversion
109 corecrypto_aes.o_CFLAGS_ADD += -Wno-sign-conversion
110 corecrypto_aesxts.o_CFLAGS_ADD += -Wno-sign-conversion
111 deflate.o_CFLAGS_ADD += -Wno-sign-conversion
112 inet_aton.o_CFLAGS_ADD += -Wno-sign-conversion
113 infback.o_CFLAGS_ADD += -Wno-sign-conversion
114 inflate.o_CFLAGS_ADD += -Wno-sign-conversion
115 kxld_array.o_CFLAGS_ADD += -Wno-sign-conversion
116 kxld_copyright.o_CFLAGS_ADD += -Wno-sign-conversion
117 kxld_dict.o_CFLAGS_ADD += -Wno-sign-conversion
118 kxld_object.o_CFLAGS_ADD += -Wno-sign-conversion
119 kxld_reloc.o_CFLAGS_ADD += -Wno-sign-conversion
120 kxld_sym.o_CFLAGS_ADD += -Wno-sign-conversion
121 kxld_symtab.o_CFLAGS_ADD += -Wno-sign-conversion
122 kxld_util.o_CFLAGS_ADD += -Wno-sign-conversion
123 log.o_CFLAGS_ADD += -Wno-sign-conversion
124 refcnt.o_CFLAGS_ADD += -Wno-sign-conversion
125 scanf.o_CFLAGS_ADD += -Wno-sign-conversion
126 trees.o_CFLAGS_ADD += -Wno-sign-conversion
127 uuid.o_CFLAGS_ADD += -Wno-sign-conversion
128 # -Wno-unreachable-code
129 OSUnserialize.cpo_CXXWARNFLAGS_ADD += -Wno-unreachable-code
130 OSUnserializeXML.cpo_CXXWARNFLAGS_ADD += -Wno-unreachable-code
131 OSUnserialize.cpo_CXXWARNFLAGS_ADD += -Wno-unreachable-code-break
132 OSUnserializeXML.cpo_CXXWARNFLAGS_ADD += -Wno-unreachable-code-break
133 # -Wno-zero-as-null-pointer-constant
134 OSUnserialize.cpo_CXXWARNFLAGS_ADD += -Wno-zero-as-null-pointer-constant
135 OSUnserializeXML.cpo_CXXWARNFLAGS_ADD += -Wno-zero-as-null-pointer-constant
136
137 # Rebuild if per-file overrides change
138 ${OBJS}: $(firstword $(MAKEFILE_LIST))
139
140 # Rebuild if global compile flags change
141 $(COBJS): .CFLAGS
142 .CFLAGS: ALWAYS
143 $(_v)$(REPLACECONTENTS) $@ $(KCC) $(CFLAGS) $(INCFLAGS)
144 $(CXXOBJS): .CXXFLAGS
145 .CXXFLAGS: ALWAYS
146 $(_v)$(REPLACECONTENTS) $@ $(KC++) $(CXXFLAGS) $(INCFLAGS)
147 $(SOBJS): .SFLAGS
148 .SFLAGS: ALWAYS
149 $(_v)$(REPLACECONTENTS) $@ $(S_KCC) $(SFLAGS) $(INCFLAGS)
150
151 $(COMPONENT).filelist: $(OBJS)
152 $(_v)for hib_file in ${HIB_FILES}; \
153 do \
154 $(SEG_HACK) -n __HIB -o $${hib_file}__ $${hib_file} || exit 1; \
155 mv $${hib_file}__ $${hib_file} || exit 1; \
156 done
157 @$(LOG_LDFILELIST) "$(COMPONENT)"
158 $(_v)for obj in ${OBJS}; do \
159 $(ECHO) $(TARGET)/$(CURRENT_KERNEL_CONFIG)/$${obj}; \
160 done > $(COMPONENT).filelist
161
162 $(COMPONENT).libfilelist: $(LIBOBJS)
163 @$(LOG_LDFILELIST) "lib$(COMPONENT)"
164 $(_v)for obj in ${LIBOBJS}; do \
165 $(ECHO) $(TARGET)/$(CURRENT_KERNEL_CONFIG)/$${obj}; \
166 done > $(COMPONENT).libfilelist
167
168 ifeq ($(RC_ProjectName),xnu_libraries)
169 do_all: $(COMPONENT).libfilelist
170 else
171 do_all: $(COMPONENT).filelist
172 endif
173
174 do_build_all:: do_all
175
176 %RULES
177
178 include $(MakeInc_rule)
179 include $(MakeInc_dir)