]> git.saurik.com Git - apple/xnu.git/blame - bsd/conf/Makefile.template
xnu-2782.20.48.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 \
102 tcp_input.o \
103 tcp_output.o \
104 tcp_subr.o \
105 tcp_usrreq.o \
106 tcp_timer.o \
107 udp_usrreq.o \
108 ah_input.o \
109 ah_core.o \
110 ah_output.o \
111 esp_core.o \
112 esp_input.o \
113 esp_output.o \
114 esp_rijndael.o \
115 ipsec.o \
116 dest6.o \
117 frag6.o \
118 icmp6.o \
119 in6.o \
120 in6_src.o \
121 in6_cksum.o \
122 ip6_fw.o \
123 ip6_forward.o \
124 in6_ifattach.o \
125 ip6_input.o \
6d2010ae
A
126 ip6_output.o \
127 ipcomp_input.o \
128 ipcomp_output.o \
129 in6_proto.o \
130 mld6.o \
131 nd6.o \
132 nd6_nbr.o \
316670eb 133 nd6_prproxy.o \
6d2010ae
A
134 nd6_rtr.o \
135 raw_ip6.o \
136 route6.o \
137 scope6.o \
138 udp6_usrreq.o \
139 key.o \
140 keysock.o \
141 keydb.o \
142 des_setkey.o \
143 uipc_mbuf.o \
144 uipc_mbuf2.o \
145 uipc_socket.o \
146 uipc_socket2.o
147
148$(foreach file,$(OBJS_NO_SIGN_COMPARE),$(eval $(call add_perfile_cflags,$(file),-Wno-sign-compare)))
149
39236c6e
A
150# Objects that don't want -Wcast-align warning (8474835)
151OBJS_NO_CAST_ALIGN = \
152 BTree.o \
153 BTreeAllocate.o \
154 BTreeMiscOps.o \
155 BTreeNodeOps.o \
156 BTreeScanner.o \
157 BTreeTreeOps.o \
158 CatalogUtilities.o \
159 audit_bsm_token.o \
160 audit_pipe.o \
161 audit_session.o \
162 bsd_i386.o \
163 decmpfs.o \
164 dtrace.o \
165 fasttrap.o \
166 fasttrap_isa.o \
167 fbt_arm.o \
168 fbt_x86.o \
39236c6e
A
169 hfs_attrlist.o \
170 hfs_btreeio.o \
171 hfs_catalog.o \
172 hfs_cnode.o \
173 hfs_endian.o \
174 hfs_hotfiles.o \
175 hfs_link.o \
176 hfs_quota.o \
177 hfs_readwrite.o \
178 hfs_search.o \
179 hfs_vfsops.o \
180 hfs_vnops.o \
181 hfs_xattr.o \
182 if_bond.o \
183 ip6_fw.o \
184 ip_dummynet.o \
185 ip_fw2.o \
186 kern_credential.o \
187 kern_descrip.o \
188 kern_event.o \
189 kern_exec.o \
190 kern_lockf.o \
191 kern_subr.o \
192 km.o \
193 lockstat.o \
194 mach_loader.o \
195 memdev.o \
196 nfs4_subs.o \
197 nfs4_vnops.o \
198 nfs_boot.o \
199 nfs_gss.o \
200 nfs_serv.o \
201 nfs_socket.o \
202 nfs_srvcache.o \
203 nfs_subs.o \
204 nfs_syscalls.o \
205 nfs_vfsops.o \
206 nfs_vnops.o \
207 proc_info.o \
208 pthread_synch.o \
209 qsort.o \
39236c6e 210 sdt.o \
39236c6e
A
211 shadow.o \
212 spec_vnops.o \
213 subr_log.o \
214 subr_prof.o \
215 sys_generic.o \
216 sys_pipe.o \
217 systemcalls.o \
218 systrace.o \
219 tcp_lro.o \
220 tty.o \
221 tty_compat.o \
fe8ab488 222 tty_dev.o \
39236c6e
A
223 tty_ptmx.o \
224 tty_pty.o \
225 ubc_subr.o \
226 uipc_usrreq.o \
227 vfs_attrlist.o \
228 vfs_fsevents.o \
229 vfs_journal.o \
230 vfs_lookup.o \
39236c6e
A
231 vfs_syscalls.o \
232 vfs_utfconv.o \
233 vfs_vnops.o \
234 vfs_xattr.o \
235 vn.o \
236 munge.o \
237 aes.o \
238 aeskey.o \
239 sdt_arm.o
240
241$(foreach file,$(OBJS_NO_CAST_ALIGN),$(eval $(call add_perfile_cflags,$(file),-Wno-cast-align)))
1c79356b 242
55e303ae
A
243#
244# This rule insures that the subr_prof.c does NOT get compiled with
245# profiling. It implements mcount() and profiling it leads to recursion.
246#
247
248subr_prof.o_CFLAGS_RM = -pg
249
fe8ab488
A
250# Rebuild if per-file overrides change
251${OBJS}: $(firstword $(MAKEFILE_LIST))
1c79356b 252
fe8ab488
A
253# Rebuild if global compile flags change
254$(COBJS): .CFLAGS
255.CFLAGS: ALWAYS
256 $(_v)$(REPLACECONTENTS) $@ $(KCC) $(CFLAGS) $(INCFLAGS)
257$(CXXOBJS): .CXXFLAGS
258.CXXFLAGS: ALWAYS
259 $(_v)$(REPLACECONTENTS) $@ $(KC++) $(CXXFLAGS) $(INCFLAGS)
260$(SOBJS): .SFLAGS
261.SFLAGS: ALWAYS
262 $(_v)$(REPLACECONTENTS) $@ $(S_KCC) $(SFLAGS) $(INCFLAGS)
1c79356b 263
fe8ab488 264$(COMPONENT).filelist: $(OBJS)
b0d623f7 265 @echo LDFILELIST $(COMPONENT)
fe8ab488 266 $(_v)( for obj in ${OBJS}; do \
39236c6e 267 echo $(TARGET)/$(CURRENT_KERNEL_CONFIG)/$${obj}; \
6d2010ae 268 done; ) > $(COMPONENT).filelist
b0d623f7
A
269
270MAKESYSCALLS = $(SRCROOT)/bsd/kern/makesyscalls.sh
271
272init_sysent.c: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS)
273 @echo "Generating $@ from $<";
274 $(_v)$(MAKESYSCALLS) $< table > /dev/null
275
276syscalls.c: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS)
277 @echo "Generating $@ from $<";
278 $(_v)$(MAKESYSCALLS) $< names > /dev/null
279
280audit_kevents.c: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS)
281 @echo "Generating $@ from $<";
282 $(_v)$(MAKESYSCALLS) $< audit > /dev/null
1c79356b 283
6d2010ae 284do_all: $(COMPONENT).filelist
1c79356b 285
39236c6e 286do_build_all:: do_all
1c79356b
A
287
288%RULES
289
1c79356b
A
290include $(MakeInc_rule)
291include $(MakeInc_dir)