]> git.saurik.com Git - apple/xnu.git/blob - bsd/conf/Makefile.template
9636b05f7add82cfb490381fc0fa7d8ba70b68c2
[apple/xnu.git] / bsd / conf / Makefile.template
1 #
2 # Copyright (c) 2000-2011 Apple Inc. All rights reserved.
3 #
4 # @APPLE_LICENSE_HEADER_START@
5 #
6 # The contents of this file constitute Original Code as defined in and
7 # are subject to the Apple Public Source License Version 1.1 (the
8 # "License"). You may not use this file except in compliance with the
9 # License. Please obtain a copy of the License at
10 # http://www.apple.com/publicsource and read it before using this file.
11 #
12 # This Original Code and all software distributed under the License are
13 # distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 # EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 # INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 # FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 # License for the specific language governing rights and limitations
18 # under the License.
19 #
20 # @APPLE_LICENSE_HEADER_END@
21 #
22
23 #
24 # Mach Operating System
25 # Copyright (c) 1986 Carnegie-Mellon University
26 # All rights reserved. The CMU software License Agreement specifies
27 # the terms and conditions for use and redistribution.
28 #
29
30 export MakeInc_cmd=${SRCROOT}/makedefs/MakeInc.cmd
31 export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def
32 export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule
33 export MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir
34
35 include $(MakeInc_cmd)
36 include $(MakeInc_def)
37
38 #
39 # XXX: CFLAGS
40 #
41 CFLAGS+= -include meta_features.h -DDRIVER_PRIVATE \
42 -D_KERNEL_BUILD -DKERNEL_BUILD -DMACH_KERNEL -DBSD_BUILD \
43 -DBSD_KERNEL_PRIVATE -DLP64_DEBUG=0
44
45 #
46 # Directories for mig generated files
47 #
48 COMP_SUBDIRS =
49
50 #
51 # Make sure we don't remove this by accident if interrupted at the wrong
52 # time.
53 #
54 .PRECIOUS: Makefile
55
56 #
57 # Theses macros are filled in by the config program depending on the
58 # current configuration. The MACHDEP macro is replaced by the
59 # contents of the machine dependent makefile template and the others
60 # are replaced by the corresponding symbol definitions for the
61 # configuration.
62 #
63
64 %OBJS
65
66 %CFILES
67
68 %CXXFILES
69
70 %SFILES
71
72 %MACHDEP
73
74 #
75 # Machine-independent per-file flags
76 #
77
78 dp_backing_file.o_CFLAGS_ADD += -Wshorten-64-to-32
79 ubc_subr.o_CFLAGS_ADD += -Wshorten-64-to-32
80 vnode_pager.o_CFLAGS_ADD += -Wshorten-64-to-32
81 vm_unix.o_CFLAGS_ADD += -Wshorten-64-to-32
82 pthread_synch.o_CFLAGS_ADD += -Wno-unused-parameter -Wno-missing-prototypes
83 pthread_support.o_CFLAGS_ADD += -Wno-unused-parameter -Wno-missing-prototypes
84
85 # Objects that don't want -Wsign-compare
86 OBJS_NO_SIGN_COMPARE = \
87 radix.o \
88 route.o \
89 rtsock.o \
90 dhcp_options.o \
91 igmp.o \
92 in_cksum.o \
93 ip_divert.o \
94 ip_dummynet.o \
95 ip_flow.o \
96 ip_fw2.o \
97 ip_fw2_compat.o \
98 ip_icmp.o \
99 ip_input.o \
100 ip_output.o \
101 raw_ip.o \
102 tcp_cache.o \
103 tcp_input.o \
104 tcp_output.o \
105 tcp_subr.o \
106 tcp_usrreq.o \
107 tcp_timer.o \
108 udp_usrreq.o \
109 ah_input.o \
110 ah_core.o \
111 ah_output.o \
112 esp_core.o \
113 esp_input.o \
114 esp_output.o \
115 esp_rijndael.o \
116 ipsec.o \
117 dest6.o \
118 frag6.o \
119 icmp6.o \
120 in6.o \
121 in6_src.o \
122 in6_cksum.o \
123 ip6_fw.o \
124 ip6_forward.o \
125 in6_ifattach.o \
126 ip6_input.o \
127 ip6_output.o \
128 ipcomp_input.o \
129 ipcomp_output.o \
130 in6_proto.o \
131 mld6.o \
132 nd6.o \
133 nd6_nbr.o \
134 nd6_prproxy.o \
135 nd6_rtr.o \
136 raw_ip6.o \
137 route6.o \
138 scope6.o \
139 udp6_usrreq.o \
140 key.o \
141 keysock.o \
142 keydb.o \
143 des_setkey.o \
144 uipc_mbuf.o \
145 uipc_mbuf2.o \
146 uipc_socket.o \
147 uipc_socket2.o
148
149 $(foreach file,$(OBJS_NO_SIGN_COMPARE),$(eval $(call add_perfile_cflags,$(file),-Wno-sign-compare)))
150
151 # Objects that don't want -Wcast-align warning (8474835)
152 OBJS_NO_CAST_ALIGN = \
153 BTree.o \
154 BTreeAllocate.o \
155 BTreeMiscOps.o \
156 BTreeNodeOps.o \
157 BTreeScanner.o \
158 BTreeTreeOps.o \
159 CatalogUtilities.o \
160 audit_bsm_token.o \
161 audit_pipe.o \
162 audit_session.o \
163 bsd_i386.o \
164 decmpfs.o \
165 dtrace.o \
166 fasttrap.o \
167 fasttrap_isa.o \
168 fbt_arm.o \
169 fbt_x86.o \
170 hfs_attrlist.o \
171 hfs_btreeio.o \
172 hfs_catalog.o \
173 hfs_cnode.o \
174 hfs_endian.o \
175 hfs_hotfiles.o \
176 hfs_link.o \
177 hfs_quota.o \
178 hfs_readwrite.o \
179 hfs_search.o \
180 hfs_vfsops.o \
181 hfs_vnops.o \
182 hfs_xattr.o \
183 if_bond.o \
184 ip6_fw.o \
185 ip_dummynet.o \
186 ip_fw2.o \
187 kern_credential.o \
188 kern_descrip.o \
189 kern_event.o \
190 kern_exec.o \
191 kern_lockf.o \
192 kern_subr.o \
193 km.o \
194 lockstat.o \
195 mach_loader.o \
196 memdev.o \
197 nfs4_subs.o \
198 nfs4_vnops.o \
199 nfs_boot.o \
200 nfs_gss.o \
201 nfs_serv.o \
202 nfs_socket.o \
203 nfs_srvcache.o \
204 nfs_subs.o \
205 nfs_syscalls.o \
206 nfs_vfsops.o \
207 nfs_vnops.o \
208 proc_info.o \
209 pthread_synch.o \
210 qsort.o \
211 sdt.o \
212 shadow.o \
213 spec_vnops.o \
214 subr_log.o \
215 subr_prof.o \
216 sys_generic.o \
217 sys_pipe.o \
218 systemcalls.o \
219 systrace.o \
220 tcp_lro.o \
221 tty.o \
222 tty_compat.o \
223 tty_dev.o \
224 tty_ptmx.o \
225 tty_pty.o \
226 ubc_subr.o \
227 uipc_usrreq.o \
228 vfs_attrlist.o \
229 vfs_fsevents.o \
230 vfs_journal.o \
231 vfs_lookup.o \
232 vfs_syscalls.o \
233 vfs_utfconv.o \
234 vfs_vnops.o \
235 vfs_xattr.o \
236 vn.o \
237 munge.o \
238 aes.o \
239 aeskey.o \
240 sdt_arm.o \
241 uipc_mbuf.o \
242 kern_guarded.o
243
244 $(foreach file,$(OBJS_NO_CAST_ALIGN),$(eval $(call add_perfile_cflags,$(file),-Wno-cast-align)))
245
246 #
247 # This rule insures that the subr_prof.c does NOT get compiled with
248 # profiling. It implements mcount() and profiling it leads to recursion.
249 #
250
251 subr_prof.o_CFLAGS_RM = -pg
252
253 # Rebuild if per-file overrides change
254 ${OBJS}: $(firstword $(MAKEFILE_LIST))
255
256 # Rebuild if global compile flags change
257 $(COBJS): .CFLAGS
258 .CFLAGS: ALWAYS
259 $(_v)$(REPLACECONTENTS) $@ $(KCC) $(CFLAGS) $(INCFLAGS)
260 $(CXXOBJS): .CXXFLAGS
261 .CXXFLAGS: ALWAYS
262 $(_v)$(REPLACECONTENTS) $@ $(KC++) $(CXXFLAGS) $(INCFLAGS)
263 $(SOBJS): .SFLAGS
264 .SFLAGS: ALWAYS
265 $(_v)$(REPLACECONTENTS) $@ $(S_KCC) $(SFLAGS) $(INCFLAGS)
266
267 $(COMPONENT).filelist: $(OBJS)
268 @echo LDFILELIST $(COMPONENT)
269 $(_v)for obj in ${OBJS}; do \
270 echo $(TARGET)/$(CURRENT_KERNEL_CONFIG)/$${obj}; \
271 done > $(COMPONENT).filelist
272
273 MAKESYSCALLS = $(SRCROOT)/bsd/kern/makesyscalls.sh
274
275 init_sysent.c: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS)
276 @echo "Generating $@ from $<";
277 $(_v)$(MAKESYSCALLS) $< table > /dev/null
278
279 syscalls.c: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS)
280 @echo "Generating $@ from $<";
281 $(_v)$(MAKESYSCALLS) $< names > /dev/null
282
283 audit_kevents.c: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS)
284 @echo "Generating $@ from $<";
285 $(_v)$(MAKESYSCALLS) $< audit > /dev/null
286
287 do_all: $(COMPONENT).filelist
288
289 do_build_all:: do_all
290
291 %RULES
292
293 include $(MakeInc_rule)
294 include $(MakeInc_dir)