]> git.saurik.com Git - apple/xnu.git/blame - bsd/conf/Makefile.template
xnu-6153.11.26.tar.gz
[apple/xnu.git] / bsd / conf / Makefile.template
CommitLineData
91447636 1#
39037602 2# Copyright (c) 2000-2016 Apple Inc. All rights reserved.
91447636 3#
6601e61a 4# @APPLE_LICENSE_HEADER_START@
39037602 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.
39037602 11#
8f6c56a5
A
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.
39037602 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 43 -DBSD_KERNEL_PRIVATE -DLP64_DEBUG=0
5ba3f43e 44SFLAGS+= -include meta_features.h
39236c6e
A
45
46#
47# Directories for mig generated files
48#
39037602 49COMP_SUBDIRS =
39236c6e
A
50
51#
52# Make sure we don't remove this by accident if interrupted at the wrong
53# time.
54#
55.PRECIOUS: Makefile
56
57#
58# Theses macros are filled in by the config program depending on the
59# current configuration. The MACHDEP macro is replaced by the
60# contents of the machine dependent makefile template and the others
61# are replaced by the corresponding symbol definitions for the
62# configuration.
63#
64
65%OBJS
66
67%CFILES
68
fe8ab488
A
69%CXXFILES
70
39236c6e
A
71%SFILES
72
73%MACHDEP
74
75#
76# Machine-independent per-file flags
77#
0b4e3aa0 78
6d2010ae
A
79dp_backing_file.o_CFLAGS_ADD += -Wshorten-64-to-32
80ubc_subr.o_CFLAGS_ADD += -Wshorten-64-to-32
81vnode_pager.o_CFLAGS_ADD += -Wshorten-64-to-32
82vm_unix.o_CFLAGS_ADD += -Wshorten-64-to-32
39236c6e
A
83pthread_synch.o_CFLAGS_ADD += -Wno-unused-parameter -Wno-missing-prototypes
84pthread_support.o_CFLAGS_ADD += -Wno-unused-parameter -Wno-missing-prototypes
6d2010ae
A
85
86# Objects that don't want -Wsign-compare
87OBJS_NO_SIGN_COMPARE = \
88 radix.o \
89 route.o \
90 rtsock.o \
91 dhcp_options.o \
92 igmp.o \
93 in_cksum.o \
94 ip_divert.o \
95 ip_dummynet.o \
96 ip_flow.o \
97 ip_fw2.o \
98 ip_fw2_compat.o \
99 ip_icmp.o \
100 ip_input.o \
6d2010ae
A
101 ip_output.o \
102 raw_ip.o \
3e170ce0 103 tcp_cache.o \
6d2010ae
A
104 tcp_input.o \
105 tcp_output.o \
106 tcp_subr.o \
107 tcp_usrreq.o \
108 tcp_timer.o \
109 udp_usrreq.o \
110 ah_input.o \
111 ah_core.o \
112 ah_output.o \
113 esp_core.o \
114 esp_input.o \
115 esp_output.o \
116 esp_rijndael.o \
5ba3f43e 117 esp_chachapoly.o \
6d2010ae
A
118 ipsec.o \
119 dest6.o \
120 frag6.o \
121 icmp6.o \
122 in6.o \
123 in6_src.o \
124 in6_cksum.o \
125 ip6_fw.o \
126 ip6_forward.o \
127 in6_ifattach.o \
128 ip6_input.o \
6d2010ae 129 ip6_output.o \
6d2010ae
A
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 = \
39236c6e
A
153 audit_bsm_token.o \
154 audit_pipe.o \
155 audit_session.o \
156 bsd_i386.o \
157 decmpfs.o \
158 dtrace.o \
159 fasttrap.o \
160 fasttrap_isa.o \
d9a64523 161 fbt.o \
39236c6e
A
162 fbt_arm.o \
163 fbt_x86.o \
39236c6e
A
164 if_bond.o \
165 ip6_fw.o \
166 ip_dummynet.o \
167 ip_fw2.o \
168 kern_credential.o \
169 kern_descrip.o \
170 kern_event.o \
171 kern_exec.o \
172 kern_lockf.o \
173 kern_subr.o \
174 km.o \
175 lockstat.o \
176 mach_loader.o \
177 memdev.o \
178 nfs4_subs.o \
179 nfs4_vnops.o \
180 nfs_boot.o \
181 nfs_gss.o \
182 nfs_serv.o \
183 nfs_socket.o \
184 nfs_srvcache.o \
185 nfs_subs.o \
186 nfs_syscalls.o \
187 nfs_vfsops.o \
188 nfs_vnops.o \
189 proc_info.o \
190 pthread_synch.o \
191 qsort.o \
39236c6e 192 sdt.o \
39236c6e
A
193 shadow.o \
194 spec_vnops.o \
195 subr_log.o \
196 subr_prof.o \
197 sys_generic.o \
198 sys_pipe.o \
199 systemcalls.o \
200 systrace.o \
201 tcp_lro.o \
202 tty.o \
203 tty_compat.o \
fe8ab488 204 tty_dev.o \
39236c6e
A
205 tty_ptmx.o \
206 tty_pty.o \
207 ubc_subr.o \
208 uipc_usrreq.o \
209 vfs_attrlist.o \
210 vfs_fsevents.o \
39236c6e 211 vfs_lookup.o \
39236c6e
A
212 vfs_syscalls.o \
213 vfs_utfconv.o \
214 vfs_vnops.o \
215 vfs_xattr.o \
216 vn.o \
217 munge.o \
218 aes.o \
219 aeskey.o \
3e170ce0
A
220 sdt_arm.o \
221 uipc_mbuf.o \
222 kern_guarded.o
39236c6e
A
223
224$(foreach file,$(OBJS_NO_CAST_ALIGN),$(eval $(call add_perfile_cflags,$(file),-Wno-cast-align)))
1c79356b 225
813fb2f6
A
226# Relax -Waddress-of-packed-member on networking (28123676)
227OBJS_NO_PACKED_ADDRESS = \
228 ah_core.o \
229 ah_input.o \
d9a64523 230 dlil.o \
813fb2f6
A
231 esp_input.o \
232 esp_output.o \
233 frag6.o \
234 icmp6.o \
235 if_stf.o \
236 in6_cksum.o \
237 in6_gif.o \
238 ip6_forward.o \
239 ip6_input.o \
240 ip6_output.o \
5ba3f43e 241 iptap.o \
813fb2f6
A
242 ipsec.o \
243 mld6.o \
244 mptcp_opt.o \
d9a64523 245 nat464_utils.o \
813fb2f6
A
246 nd6.o \
247 nd6_nbr.o \
248 nd6_prproxy.o \
249 nd6_rtr.o \
250 necp.o \
cb323159 251 packet_mangler.o \
813fb2f6
A
252 pf.o \
253 pf_norm.o \
254 pktap.o \
255 raw_ip6.o \
256 tcp_input.o \
257 tcp_subr.o \
258 udp6_output.o \
259 udp6_usrreq.o \
cb323159
A
260 udp_usrreq.o \
261 sixxlowpan.o
813fb2f6 262
813fb2f6
A
263$(foreach file,$(OBJS_NO_PACKED_ADDRESS),$(eval $(call add_perfile_cflags,$(file),-Wno-address-of-packed-member)))
264
55e303ae
A
265#
266# This rule insures that the subr_prof.c does NOT get compiled with
267# profiling. It implements mcount() and profiling it leads to recursion.
268#
269
270subr_prof.o_CFLAGS_RM = -pg
271
fe8ab488
A
272# Rebuild if per-file overrides change
273${OBJS}: $(firstword $(MAKEFILE_LIST))
1c79356b 274
fe8ab488
A
275# Rebuild if global compile flags change
276$(COBJS): .CFLAGS
277.CFLAGS: ALWAYS
278 $(_v)$(REPLACECONTENTS) $@ $(KCC) $(CFLAGS) $(INCFLAGS)
279$(CXXOBJS): .CXXFLAGS
280.CXXFLAGS: ALWAYS
281 $(_v)$(REPLACECONTENTS) $@ $(KC++) $(CXXFLAGS) $(INCFLAGS)
282$(SOBJS): .SFLAGS
283.SFLAGS: ALWAYS
284 $(_v)$(REPLACECONTENTS) $@ $(S_KCC) $(SFLAGS) $(INCFLAGS)
1c79356b 285
39037602 286$(COMPONENT).filelist: $(OBJS)
cb323159 287 $(call makelog,$(ColorL)LDFILELIST$(Color0) $(ColorLF)$(COMPONENT)$(Color0))
3e170ce0 288 $(_v)for obj in ${OBJS}; do \
cb323159 289 $(ECHO) $(TARGET)/$(CURRENT_KERNEL_CONFIG)/$${obj}; \
3e170ce0 290 done > $(COMPONENT).filelist
b0d623f7
A
291
292MAKESYSCALLS = $(SRCROOT)/bsd/kern/makesyscalls.sh
293
294init_sysent.c: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS)
cb323159 295 $(call makelog,[$(CMD_MC)] $(ColorH)GENERATING$(Color0) $(ColorLF)$@$(Color0) from $(ColorF)$<$(Color0))
b0d623f7
A
296 $(_v)$(MAKESYSCALLS) $< table > /dev/null
297
298syscalls.c: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS)
cb323159 299 $(call makelog,[$(CMD_MC)] $(ColorH)GENERATING$(Color0) $(ColorLF)$@$(Color0) from $(ColorF)$<$(Color0))
b0d623f7
A
300 $(_v)$(MAKESYSCALLS) $< names > /dev/null
301
302audit_kevents.c: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS)
cb323159 303 $(call makelog,[$(CMD_MC)] $(ColorH)GENERATING$(Color0) $(ColorLF)$@$(Color0) from $(ColorF)$<$(Color0))
b0d623f7 304 $(_v)$(MAKESYSCALLS) $< audit > /dev/null
1c79356b 305
5ba3f43e 306systrace_args.c: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS)
cb323159 307 $(call makelog,[$(CMD_MC)] $(ColorH)GENERATING$(Color0) $(ColorLF)$@$(Color0) from $(ColorF)$<$(Color0))
5ba3f43e
A
308 $(_v)$(MAKESYSCALLS) $< systrace > /dev/null
309
6d2010ae 310do_all: $(COMPONENT).filelist
1c79356b 311
39236c6e 312do_build_all:: do_all
1c79356b
A
313
314%RULES
315
1c79356b
A
316include $(MakeInc_rule)
317include $(MakeInc_dir)