]> git.saurik.com Git - apple/xnu.git/blame - bsd/conf/Makefile.template
xnu-3248.60.10.tar.gz
[apple/xnu.git] / bsd / conf / Makefile.template
CommitLineData
91447636 1#
316670eb 2# Copyright (c) 2000-2011 Apple Inc. All rights reserved.
91447636 3#
6601e61a 4# @APPLE_LICENSE_HEADER_START@
91447636 5#
8f6c56a5
A
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#
6601e61a 20# @APPLE_LICENSE_HEADER_END@
91447636
A
21#
22
1c79356b
A
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
1c79356b
A
30export MakeInc_cmd=${SRCROOT}/makedefs/MakeInc.cmd
31export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def
32export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule
33export MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir
34
35include $(MakeInc_cmd)
36include $(MakeInc_def)
37
38#
39# XXX: CFLAGS
40#
39236c6e 41CFLAGS+= -include meta_features.h -DDRIVER_PRIVATE \
9bccf70c 42 -D_KERNEL_BUILD -DKERNEL_BUILD -DMACH_KERNEL -DBSD_BUILD \
39236c6e
A
43 -DBSD_KERNEL_PRIVATE -DLP64_DEBUG=0
44
45#
46# Directories for mig generated files
47#
48COMP_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
fe8ab488
A
68%CXXFILES
69
39236c6e
A
70%SFILES
71
72%MACHDEP
73
74#
75# Machine-independent per-file flags
76#
0b4e3aa0 77
6d2010ae
A
78dp_backing_file.o_CFLAGS_ADD += -Wshorten-64-to-32
79ubc_subr.o_CFLAGS_ADD += -Wshorten-64-to-32
80vnode_pager.o_CFLAGS_ADD += -Wshorten-64-to-32
81vm_unix.o_CFLAGS_ADD += -Wshorten-64-to-32
39236c6e
A
82pthread_synch.o_CFLAGS_ADD += -Wno-unused-parameter -Wno-missing-prototypes
83pthread_support.o_CFLAGS_ADD += -Wno-unused-parameter -Wno-missing-prototypes
6d2010ae
A
84
85# Objects that don't want -Wsign-compare
86OBJS_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 \
6d2010ae
A
100 ip_output.o \
101 raw_ip.o \
3e170ce0 102 tcp_cache.o \
6d2010ae
A
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 \
6d2010ae
A
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 \
316670eb 134 nd6_prproxy.o \
6d2010ae
A
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
39236c6e
A
151# Objects that don't want -Wcast-align warning (8474835)
152OBJS_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 \
39236c6e
A
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 \
39236c6e 211 sdt.o \
39236c6e
A
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 \
fe8ab488 223 tty_dev.o \
39236c6e
A
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 \
39236c6e
A
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 \
3e170ce0
A
240 sdt_arm.o \
241 uipc_mbuf.o \
242 kern_guarded.o
39236c6e
A
243
244$(foreach file,$(OBJS_NO_CAST_ALIGN),$(eval $(call add_perfile_cflags,$(file),-Wno-cast-align)))
1c79356b 245
55e303ae
A
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
251subr_prof.o_CFLAGS_RM = -pg
252
fe8ab488
A
253# Rebuild if per-file overrides change
254${OBJS}: $(firstword $(MAKEFILE_LIST))
1c79356b 255
fe8ab488
A
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)
1c79356b 266
fe8ab488 267$(COMPONENT).filelist: $(OBJS)
b0d623f7 268 @echo LDFILELIST $(COMPONENT)
3e170ce0 269 $(_v)for obj in ${OBJS}; do \
39236c6e 270 echo $(TARGET)/$(CURRENT_KERNEL_CONFIG)/$${obj}; \
3e170ce0 271 done > $(COMPONENT).filelist
b0d623f7
A
272
273MAKESYSCALLS = $(SRCROOT)/bsd/kern/makesyscalls.sh
274
275init_sysent.c: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS)
276 @echo "Generating $@ from $<";
277 $(_v)$(MAKESYSCALLS) $< table > /dev/null
278
279syscalls.c: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS)
280 @echo "Generating $@ from $<";
281 $(_v)$(MAKESYSCALLS) $< names > /dev/null
282
283audit_kevents.c: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS)
284 @echo "Generating $@ from $<";
285 $(_v)$(MAKESYSCALLS) $< audit > /dev/null
1c79356b 286
6d2010ae 287do_all: $(COMPONENT).filelist
1c79356b 288
39236c6e 289do_build_all:: do_all
1c79356b
A
290
291%RULES
292
1c79356b
A
293include $(MakeInc_rule)
294include $(MakeInc_dir)