]>
Commit | Line | Data |
---|---|---|
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 |
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 | # | |
39236c6e | 41 | CFLAGS+= -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 | # | |
39037602 | 48 | COMP_SUBDIRS = |
39236c6e A |
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 |
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 | |
39236c6e A |
82 | pthread_synch.o_CFLAGS_ADD += -Wno-unused-parameter -Wno-missing-prototypes |
83 | pthread_support.o_CFLAGS_ADD += -Wno-unused-parameter -Wno-missing-prototypes | |
6d2010ae | 84 | |
39037602 A |
85 | ip_icmp.o_CFLFAGS_ADD += -O0 |
86 | ||
6d2010ae A |
87 | # Objects that don't want -Wsign-compare |
88 | OBJS_NO_SIGN_COMPARE = \ | |
89 | radix.o \ | |
90 | route.o \ | |
91 | rtsock.o \ | |
92 | dhcp_options.o \ | |
93 | igmp.o \ | |
94 | in_cksum.o \ | |
95 | ip_divert.o \ | |
96 | ip_dummynet.o \ | |
97 | ip_flow.o \ | |
98 | ip_fw2.o \ | |
99 | ip_fw2_compat.o \ | |
100 | ip_icmp.o \ | |
101 | ip_input.o \ | |
6d2010ae A |
102 | ip_output.o \ |
103 | raw_ip.o \ | |
3e170ce0 | 104 | tcp_cache.o \ |
6d2010ae A |
105 | tcp_input.o \ |
106 | tcp_output.o \ | |
107 | tcp_subr.o \ | |
108 | tcp_usrreq.o \ | |
109 | tcp_timer.o \ | |
110 | udp_usrreq.o \ | |
111 | ah_input.o \ | |
112 | ah_core.o \ | |
113 | ah_output.o \ | |
114 | esp_core.o \ | |
115 | esp_input.o \ | |
116 | esp_output.o \ | |
117 | esp_rijndael.o \ | |
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 A |
129 | ip6_output.o \ |
130 | ipcomp_input.o \ | |
131 | ipcomp_output.o \ | |
132 | in6_proto.o \ | |
133 | mld6.o \ | |
134 | nd6.o \ | |
135 | nd6_nbr.o \ | |
316670eb | 136 | nd6_prproxy.o \ |
6d2010ae A |
137 | nd6_rtr.o \ |
138 | raw_ip6.o \ | |
139 | route6.o \ | |
140 | scope6.o \ | |
141 | udp6_usrreq.o \ | |
142 | key.o \ | |
143 | keysock.o \ | |
144 | keydb.o \ | |
145 | des_setkey.o \ | |
146 | uipc_mbuf.o \ | |
147 | uipc_mbuf2.o \ | |
148 | uipc_socket.o \ | |
149 | uipc_socket2.o | |
150 | ||
151 | $(foreach file,$(OBJS_NO_SIGN_COMPARE),$(eval $(call add_perfile_cflags,$(file),-Wno-sign-compare))) | |
152 | ||
39236c6e A |
153 | # Objects that don't want -Wcast-align warning (8474835) |
154 | OBJS_NO_CAST_ALIGN = \ | |
39236c6e A |
155 | audit_bsm_token.o \ |
156 | audit_pipe.o \ | |
157 | audit_session.o \ | |
158 | bsd_i386.o \ | |
159 | decmpfs.o \ | |
160 | dtrace.o \ | |
161 | fasttrap.o \ | |
162 | fasttrap_isa.o \ | |
163 | fbt_arm.o \ | |
164 | fbt_x86.o \ | |
39236c6e A |
165 | if_bond.o \ |
166 | ip6_fw.o \ | |
167 | ip_dummynet.o \ | |
168 | ip_fw2.o \ | |
169 | kern_credential.o \ | |
170 | kern_descrip.o \ | |
171 | kern_event.o \ | |
172 | kern_exec.o \ | |
173 | kern_lockf.o \ | |
174 | kern_subr.o \ | |
175 | km.o \ | |
176 | lockstat.o \ | |
177 | mach_loader.o \ | |
178 | memdev.o \ | |
179 | nfs4_subs.o \ | |
180 | nfs4_vnops.o \ | |
181 | nfs_boot.o \ | |
182 | nfs_gss.o \ | |
183 | nfs_serv.o \ | |
184 | nfs_socket.o \ | |
185 | nfs_srvcache.o \ | |
186 | nfs_subs.o \ | |
187 | nfs_syscalls.o \ | |
188 | nfs_vfsops.o \ | |
189 | nfs_vnops.o \ | |
190 | proc_info.o \ | |
191 | pthread_synch.o \ | |
192 | qsort.o \ | |
39236c6e | 193 | sdt.o \ |
39236c6e A |
194 | shadow.o \ |
195 | spec_vnops.o \ | |
196 | subr_log.o \ | |
197 | subr_prof.o \ | |
198 | sys_generic.o \ | |
199 | sys_pipe.o \ | |
200 | systemcalls.o \ | |
201 | systrace.o \ | |
202 | tcp_lro.o \ | |
203 | tty.o \ | |
204 | tty_compat.o \ | |
fe8ab488 | 205 | tty_dev.o \ |
39236c6e A |
206 | tty_ptmx.o \ |
207 | tty_pty.o \ | |
208 | ubc_subr.o \ | |
209 | uipc_usrreq.o \ | |
210 | vfs_attrlist.o \ | |
211 | vfs_fsevents.o \ | |
39236c6e | 212 | vfs_lookup.o \ |
39236c6e A |
213 | vfs_syscalls.o \ |
214 | vfs_utfconv.o \ | |
215 | vfs_vnops.o \ | |
216 | vfs_xattr.o \ | |
217 | vn.o \ | |
218 | munge.o \ | |
219 | aes.o \ | |
220 | aeskey.o \ | |
3e170ce0 A |
221 | sdt_arm.o \ |
222 | uipc_mbuf.o \ | |
223 | kern_guarded.o | |
39236c6e A |
224 | |
225 | $(foreach file,$(OBJS_NO_CAST_ALIGN),$(eval $(call add_perfile_cflags,$(file),-Wno-cast-align))) | |
1c79356b | 226 | |
55e303ae A |
227 | # |
228 | # This rule insures that the subr_prof.c does NOT get compiled with | |
229 | # profiling. It implements mcount() and profiling it leads to recursion. | |
230 | # | |
231 | ||
232 | subr_prof.o_CFLAGS_RM = -pg | |
233 | ||
fe8ab488 A |
234 | # Rebuild if per-file overrides change |
235 | ${OBJS}: $(firstword $(MAKEFILE_LIST)) | |
1c79356b | 236 | |
fe8ab488 A |
237 | # Rebuild if global compile flags change |
238 | $(COBJS): .CFLAGS | |
239 | .CFLAGS: ALWAYS | |
240 | $(_v)$(REPLACECONTENTS) $@ $(KCC) $(CFLAGS) $(INCFLAGS) | |
241 | $(CXXOBJS): .CXXFLAGS | |
242 | .CXXFLAGS: ALWAYS | |
243 | $(_v)$(REPLACECONTENTS) $@ $(KC++) $(CXXFLAGS) $(INCFLAGS) | |
244 | $(SOBJS): .SFLAGS | |
245 | .SFLAGS: ALWAYS | |
246 | $(_v)$(REPLACECONTENTS) $@ $(S_KCC) $(SFLAGS) $(INCFLAGS) | |
1c79356b | 247 | |
39037602 A |
248 | $(COMPONENT).filelist: $(OBJS) |
249 | @echo "$(ColorL)LDFILELIST$(Color0) $(ColorLF)$(COMPONENT)$(Color0)" | |
3e170ce0 | 250 | $(_v)for obj in ${OBJS}; do \ |
39236c6e | 251 | echo $(TARGET)/$(CURRENT_KERNEL_CONFIG)/$${obj}; \ |
3e170ce0 | 252 | done > $(COMPONENT).filelist |
b0d623f7 A |
253 | |
254 | MAKESYSCALLS = $(SRCROOT)/bsd/kern/makesyscalls.sh | |
255 | ||
256 | init_sysent.c: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS) | |
39037602 | 257 | @echo "[$(CMD_MC)] $(ColorH)GENERATING$(Color0) $(ColorLF)$@$(Color0) from $(ColorF)$<$(Color0)"; |
b0d623f7 A |
258 | $(_v)$(MAKESYSCALLS) $< table > /dev/null |
259 | ||
260 | syscalls.c: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS) | |
39037602 | 261 | @echo "[$(CMD_MC)] $(ColorH)GENERATING$(Color0) $(ColorLF)$@$(Color0) from $(ColorF)$<$(Color0)"; |
b0d623f7 A |
262 | $(_v)$(MAKESYSCALLS) $< names > /dev/null |
263 | ||
264 | audit_kevents.c: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS) | |
39037602 | 265 | @echo "[$(CMD_MC)] $(ColorH)GENERATING$(Color0) $(ColorLF)$@$(Color0) from $(ColorF)$<$(Color0)"; |
b0d623f7 | 266 | $(_v)$(MAKESYSCALLS) $< audit > /dev/null |
1c79356b | 267 | |
6d2010ae | 268 | do_all: $(COMPONENT).filelist |
1c79356b | 269 | |
39236c6e | 270 | do_build_all:: do_all |
1c79356b A |
271 | |
272 | %RULES | |
273 | ||
1c79356b A |
274 | include $(MakeInc_rule) |
275 | include $(MakeInc_dir) |