]> git.saurik.com Git - apple/xnu.git/blob - bsd/conf/Makefile.template
xnu-1699.22.73.tar.gz
[apple/xnu.git] / bsd / conf / Makefile.template
1 #
2 # Copyright (c) 2000-2004 Apple Computer, 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 #
31 # Export IDENT for sub-makefiles
32 #
33 export IDENT
34
35 export MakeInc_cmd=${SRCROOT}/makedefs/MakeInc.cmd
36 export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def
37 export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule
38 export MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir
39
40 include $(MakeInc_cmd)
41 include $(MakeInc_def)
42
43 #
44 # XXX: CFLAGS
45 #
46 CFLAGS+= -include meta_features.h -DARCH_PRIVATE -DDRIVER_PRIVATE \
47 -D_KERNEL_BUILD -DKERNEL_BUILD -DMACH_KERNEL -DBSD_BUILD \
48 -DBSD_KERNEL_PRIVATE -DLP64KERN=1 -DLP64_DEBUG=0 -I. $(CFLAGS_INLINE_CONFIG)
49
50 dp_backing_file.o_CFLAGS_ADD += -Wshorten-64-to-32
51 ubc_subr.o_CFLAGS_ADD += -Wshorten-64-to-32
52 vnode_pager.o_CFLAGS_ADD += -Wshorten-64-to-32
53 vm_unix.o_CFLAGS_ADD += -Wshorten-64-to-32
54
55 # Objects that don't want -Wsign-compare
56 OBJS_NO_SIGN_COMPARE = \
57 radix.o \
58 route.o \
59 rtsock.o \
60 dhcp_options.o \
61 igmp.o \
62 in_cksum.o \
63 ip_divert.o \
64 ip_dummynet.o \
65 ip_flow.o \
66 ip_fw2.o \
67 ip_fw2_compat.o \
68 ip_icmp.o \
69 ip_input.o \
70 ip_mroute.o \
71 ip_output.o \
72 raw_ip.o \
73 tcp_input.o \
74 tcp_output.o \
75 tcp_subr.o \
76 tcp_usrreq.o \
77 tcp_timer.o \
78 udp_usrreq.o \
79 ah_input.o \
80 ah_core.o \
81 ah_output.o \
82 esp_core.o \
83 esp_input.o \
84 esp_output.o \
85 esp_rijndael.o \
86 ipsec.o \
87 dest6.o \
88 frag6.o \
89 icmp6.o \
90 in6.o \
91 in6_src.o \
92 in6_cksum.o \
93 ip6_fw.o \
94 ip6_forward.o \
95 in6_ifattach.o \
96 ip6_input.o \
97 ip6_mroute.o \
98 ip6_output.o \
99 ipcomp_input.o \
100 ipcomp_output.o \
101 in6_proto.o \
102 mld6.o \
103 nd6.o \
104 nd6_nbr.o \
105 nd6_rtr.o \
106 raw_ip6.o \
107 route6.o \
108 scope6.o \
109 udp6_usrreq.o \
110 key.o \
111 keysock.o \
112 keydb.o \
113 des_setkey.o \
114 uipc_mbuf.o \
115 uipc_mbuf2.o \
116 uipc_socket.o \
117 uipc_socket2.o
118
119 $(foreach file,$(OBJS_NO_SIGN_COMPARE),$(eval $(call add_perfile_cflags,$(file),-Wno-sign-compare)))
120
121 #
122 # Directories for mig generated files
123 #
124 COMP_SUBDIRS =
125
126 #
127 # Make sure we don't remove this by accident if interrupted at the wrong
128 # time.
129 #
130 .PRECIOUS: Makefile
131
132 #
133 # Theses macros are filled in by the config program depending on the
134 # current configuration. The MACHDEP macro is replaced by the
135 # contents of the machine dependent makefile template and the others
136 # are replaced by the corresponding symbol definitions for the
137 # configuration.
138 #
139
140 %OBJS
141
142 %CFILES
143
144 %MFILES
145
146 %SFILES
147
148 %BFILES
149
150 %ORDERED
151 %MACHDEP
152
153 #
154 # This rule insures that the subr_prof.c does NOT get compiled with
155 # profiling. It implements mcount() and profiling it leads to recursion.
156 #
157
158 subr_prof.o_CFLAGS_RM = -pg
159
160 #
161 # OBJSDEPS is the set of files (defined in the machine dependent
162 # template if necessary) which all objects depend on (such as an
163 # in-line assembler expansion filter)
164 #
165 ${OBJS}: ${OBJSDEPS}
166
167
168 %LOAD
169
170 LDOBJS = $(OBJS)
171
172 $(COMPONENT).filelist: $(LDOBJS)
173 @echo LDFILELIST $(COMPONENT)
174 $(_v)( for obj in ${LDOBJS}; do \
175 echo $(TARGET)$(COMP_OBJ_DIR)/$(KERNEL_CONFIG)/$${obj}; \
176 done; ) > $(COMPONENT).filelist
177
178 MAKESYSCALLS = $(SRCROOT)/bsd/kern/makesyscalls.sh
179
180 init_sysent.c: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS)
181 @echo "Generating $@ from $<";
182 $(_v)$(MAKESYSCALLS) $< table > /dev/null
183
184 syscalls.c: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS)
185 @echo "Generating $@ from $<";
186 $(_v)$(MAKESYSCALLS) $< names > /dev/null
187
188 audit_kevents.c: $(SRCROOT)/bsd/kern/syscalls.master $(MAKESYSCALLS)
189 @echo "Generating $@ from $<";
190 $(_v)$(MAKESYSCALLS) $< audit > /dev/null
191
192 do_depend: do_all
193 $(_v)${MD} -u Makedep -f -d `ls *.d`;
194
195 do_all: $(COMPONENT).filelist
196
197 do_build_all: do_depend
198
199 %RULES
200
201 include $(MakeInc_rule)
202 include $(MakeInc_dir)