]> git.saurik.com Git - apple/libc.git/blob - Makefile.xbs
Libc-391.1.21.tar.gz
[apple/libc.git] / Makefile.xbs
1 # This is a replacement for bsd.lib.mk for the libc project to get it
2 # doing the Right Thing in XBS, which is substantially different than
3 # the BSD build system.
4 #
5 # The main problems arise when libc.a isn't meant to be static, but
6 # libc_static.a is. We also build a debug version of the library
7 # in addition to shared, static, and profile. Also, we build all
8 # versions of libc with debugging enabled, unstripped. The BSD style
9 # is to strip every object file after it is built but here, libc.a
10 # will get merged into the larger libSystem.dylib, which will eventually
11 # be stripped. We also don't build a libc.dylib, since it will be
12 # munged into libSystem.dylib.
13 #
14 # And another difference, B&I wishes to build the 4 incarnations of Libc
15 # in parallel on different machines. To do this, we must look at the
16 # RC_ProjectName variable (which B&I sets) to determine which of the 4
17 # versions of Libc we will be building. Remember that the installhdrs
18 # pass should only be invoked on one of the 4 versions, and man pages
19 # should only be installed once as well. Both of these get done when
20 # we're invoked as "Libc".
21
22 .PATH: .
23 .MAIN: all
24 all: libc.a libc_static.a libc_debug.a libc_profile.a
25 install: installhdrs install_libc.a install_libc_static.a \
26 install_libc_profile.a install_libc_debug.a autopatchman maninstall
27
28 .SUFFIXES:
29 .SUFFIXES: .o .po .So .do
30 .SUFFIXES: .S .s .c .cc .cpp .cxx .m .C
31 .SUFFIXES: -fbsd.c -nbsd.c -obsd.c -uuid.c .3-uuid.in .3
32 .SUFFIXES: .f .y .l .defs .h
33 .SUFFIXES: User.c User.o User.po User.So User.do
34 .SUFFIXES: Server.c Server.o Server.po Server.So Server.do
35
36 OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
37 DOBJS+= ${OBJS:.o=.do}
38 POBJS+= ${OBJS:.o=.po} ${STATICOBJS:.o=.po}
39 SOBJS+= ${OBJS:.o=.So}
40
41 #### 128-bit Long Double libc-ldbl128 for Panther ####################
42 .if (${MACHINE_ARCH} == ppc)
43 LIB128= ${LIB}-ldbl128
44 LDBL_128_SRCS= _hdtoa.c _ldbl_util.c _ldtoa.c asprintf.c err.c fprintf.c \
45 fscanf.c fwprintf.c fwscanf.c gdtoa-strtopdd.c machdep_ldisdd.c \
46 printf.c scanf.c snprintf.c sprintf.c sscanf.c swprintf.c swscanf.c \
47 vasprintf.c vfprintf.c vfscanf.c vfwprintf.c vfwscanf.c vprintf.c \
48 vscanf.c vsnprintf.c vsprintf.c vsscanf.c vswprintf.c vswscanf.c \
49 vwprintf.c vwscanf.c wcstold.c wprintf.c wscanf.c \
50 oldldbl64.s oldsyslog.c LDBL/oldsyslog-LDBL.c \
51 LDBL/err-LDBL.c LDBL/vfprintf-LDBL.c LDBL/vfwprintf-LDBL.c
52 LDBL_128_OBJS= ${LDBL_128_SRCS:R:S/$/.o/g}
53 LDBL_128_DOBJS= ${LDBL_128_OBJS:.o=.do}
54 LDBL_128_POBJS= ${LDBL_128_OBJS:.o=.po}
55 LDBL_128_SOBJS= ${LDBL_128_OBJS:.o=.So}
56
57 LDBLSRCS2+= oldsyslog.c
58 SRCS2+= oldldbl64.s oldsyslog.c
59 OBJS2+= ${SRCS2:N*.h:R:S/$/.o/g}
60 DOBJS2+= ${OBJS2:.o=.do}
61 POBJS2+= ${OBJS2:.o=.po}
62 SOBJS2+= ${OBJS2:.o=.So}
63 .endif
64
65 #### Variant Rules ####################################################
66 # The following magic is used for variants to avoid the exponental explosion
67 # of suffix rules. To add a variant, select a name (typically all-caps).
68 # Add that name to the VARIANTS variable. Create a CFLAGS_XXX variable
69 # (XXX is the variant name) that contains the extra flags to pass to the
70 # compiler (currently, no slashes are permitted in the flags). Then, just
71 # define a XXXSRCS variable with the names of the files to recompile with the
72 # additional flags. For auto-patched files, don't use the auto-patched file
73 # name. Just use the original file name.
74 #
75 # Note that this magic also deals with combinations of variants; e.g.,
76 # for two variants XXX and YYY, there are three variant combinations,
77 # XXX, XXX-YYY and YYY. In this example, you can use XXX-YYYSRCS to
78 # specify sources that will build with both the CFLAGS_XXX and CFLAGS_YYY
79 # flags set. The variants are always in alphabetic order.
80 #
81 VARIANTS=
82 # Append the 64-bit long double sources (ppc only)
83 .if (${MACHINE_ARCH} == ppc)
84 VARIANTS+= LDBL
85 MDSRCS += ldbl64.s
86 .endif
87 # build UNIX03 variant except on ppc64
88 .if (${MACHINE_ARCH} != ppc64)
89 VARIANTS+= UNIX03
90 .endif
91 CFLAGS+= ${VARIANTCFLAGS}
92
93 CFLAGS_UNIX03= -U__DARWIN_UNIX03 -D__DARWIN_UNIX03=1
94 CFLAGS_LDBL= -mlong-double-64 -DLDBL_COMPAT
95
96 .for _v in ${VARIANTS}
97 COMBOARGS+= ${_v}/${CFLAGS_${_v}}
98 .endfor
99 .ifdef COMBOARGS
100 # makeCombos is a perl script that creates all the variant combinations
101 # and all the combinations of flags
102 VARIANTCOMBOCFLAGS != ${.CURDIR}/makeCombos ${COMBOARGS}
103 .endif
104 # For each of the variant combinations as target (and possibly suffixed with
105 # _D, _P, and _S for the four kinds on compile styles, we create a subdirectory
106 # to do the compiling in, and then call bsdmake with the new directory, and
107 # setting VARIANTCFLAGS, which are the extra flags to be added to CFLAGS.
108 .for _v in ${VARIANTCOMBOCFLAGS}
109 VARIANTCOMBOS+= ${_v:H:S,/,,}
110 ${_v:H:S,/,,}:
111 .ifdef ${_v:H:S,/,,}SRCS
112 mkdir -p ${MAKEOBJDIR}/${_v:H:S,/,,}; \
113 MAKEOBJDIR="$(MAKEOBJDIR)/${_v:H:S,/,,}" VARIANTCFLAGS="-DBUILDING_VARIANT ${_v:T:S/@/ /g}" bsdmake -C "${.CURDIR}" build_${_v:H:S,/,,}
114 .endif
115 ${_v:H:S,/,,}_D:
116 .ifdef ${_v:H:S,/,,}SRCS
117 mkdir -p ${MAKEOBJDIR}/${_v:H:S,/,,}; \
118 MAKEOBJDIR="$(MAKEOBJDIR)/${_v:H:S,/,,}" VARIANTCFLAGS="-DBUILDING_VARIANT ${_v:T:S/@/ /g}" bsdmake -C "${.CURDIR}" build_${_v:H:S,/,,}_D
119 .endif
120 ${_v:H:S,/,,}_P:
121 .ifdef ${_v:H:S,/,,}SRCS
122 mkdir -p ${MAKEOBJDIR}/${_v:H:S,/,,}; \
123 MAKEOBJDIR="$(MAKEOBJDIR)/${_v:H:S,/,,}" VARIANTCFLAGS="-DBUILDING_VARIANT ${_v:T:S/@/ /g}" bsdmake -C "${.CURDIR}" build_${_v:H:S,/,,}_P
124 .endif
125 ${_v:H:S,/,,}_S:
126 .ifdef ${_v:H:S,/,,}SRCS
127 mkdir -p ${MAKEOBJDIR}/${_v:H:S,/,,}; \
128 MAKEOBJDIR="$(MAKEOBJDIR)/${_v:H:S,/,,}" VARIANTCFLAGS="-DBUILDING_VARIANT ${_v:T:S/@/ /g}" bsdmake -C "${.CURDIR}" build_${_v:H:S,/,,}_S
129 .endif
130 .endfor
131
132 .for _v in ${VARIANTCOMBOS}
133 # Variant suffix rules so the filenames are unique and Libsystem won't complain
134 # because of ambiguities with -sectorder
135 .SUFFIXES: -${_v}.o -${_v}.do -${_v}.po -${_v}.So
136 .o-${_v}.o .do-${_v}.do .po-${_v}.po .So-${_v}.So:
137 mv ${.IMPSRC} ${.TARGET}
138
139 # These are the build targets of the above bsdmake calls, which just builds
140 # using the standard rules, but with the additional flags.
141 VARIANTOBJS+= ${${_v}SRCS:N*.h:R:S/$/-${_v}.o/g:S,^,${_v}/,g}
142 build_${_v}: ${${_v}SRCS:N*.h:R:S/$/-${_v}.o/g}
143 build_${_v}_D: ${${_v}SRCS:N*.h:R:S/$/-${_v}.do/g} ${${_v}SRCS2:N*.h:R:S/$/-${_v}.do/g}
144 build_${_v}_P: ${${_v}SRCS:N*.h:R:S/$/-${_v}.po/g} ${${_v}SRCS2:N*.h:R:S/$/-${_v}.po/g}
145 build_${_v}_S: ${${_v}SRCS:N*.h:R:S/$/-${_v}.So/g} ${${_v}SRCS2:N*.h:R:S/$/-${_v}.So/g}
146 .endfor
147 # These variables, plus VARIANTOBJS above, are the extra binaries that get
148 # added to the .a files. Note that these objects are in subdirectories
149 # of the main build directory.
150 VARIANTDOBJS+= ${VARIANTOBJS:.o=.do}
151 VARIANTPOBJS+= ${VARIANTOBJS:.o=.po}
152 VARIANTSOBJS+= ${VARIANTOBJS:.o=.So}
153 #### FreeBSD Rules ##################################################
154 FBSDFLAGS= -I${.CURDIR}/fbsdcompat -include _fbsd_compat_.h
155
156 -fbsd.c.o:
157 ${CC} -static ${FBSDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \
158 -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET}
159 -fbsd.c.po:
160 ${CC} -pg -DPROFILE ${FBSDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \
161 -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET}
162 -fbsd.c.So:
163 ${CC} ${FBSDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \
164 -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET}
165 -fbsd.c.do:
166 ${CC} -g -DDEBUG ${FBSDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \
167 -c ${.IMPSRC} -o ${.TARGET}
168
169 #### NetBSD Rules ##################################################
170 NBSDFLAGS= -I${.CURDIR}/nbsdcompat -include _nbsd_compat_.h
171
172 -nbsd.c.o:
173 ${CC} -static ${NBSDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \
174 -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET}
175 -nbsd.c.po:
176 ${CC} -pg -DPROFILE ${NBSDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \
177 -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET}
178 -nbsd.c.So:
179 ${CC} ${NBSDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \
180 -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET}
181 -nbsd.c.do:
182 ${CC} -g -DDEBUG ${NBSDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \
183 -c ${.IMPSRC} -o ${.TARGET}
184
185 #### OpenBSD Rules ##################################################
186 OBSDFLAGS=
187
188 -obsd.c.o:
189 ${CC} -static ${OBSDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \
190 -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET}
191 -obsd.c.po:
192 ${CC} -pg -DPROFILE ${OBSDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \
193 -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET}
194 -obsd.c.So:
195 ${CC} ${OBSDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \
196 -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET}
197 -obsd.c.do:
198 ${CC} -g -DDEBUG ${OBSDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \
199 -c ${.IMPSRC} -o ${.TARGET}
200
201 #### UUID Rules ######################################################
202 UUIDFLAGS= -I${.CURDIR}/uuid -include uuid-config.h
203
204 -uuid.c.o:
205 ${CC} -static ${UUIDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \
206 -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET}
207 -uuid.c.po:
208 ${CC} -pg -DPROFILE ${UUIDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \
209 -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET}
210 -uuid.c.So:
211 ${CC} ${UUIDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \
212 -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET}
213 -uuid.c.do:
214 ${CC} -g -DDEBUG ${UUIDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \
215 -c ${.IMPSRC} -o ${.TARGET}
216 .3-uuid.in.3:
217 sed -f ${.CURDIR}/uuid/uuidman.sed ${.IMPSRC} > ${.TARGET}
218
219 #### Standard C Rules #################################################
220 .c.o User.cUser.o Server.cServer.o:
221 ${CC} -static ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \
222 -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET}
223 .c.po User.cUser.po Server.cServer.po:
224 ${CC} -pg -DPROFILE ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \
225 -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET}
226 .c.So User.cUser.So Server.cServer.So:
227 ${CC} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \
228 -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET}
229 .c.do User.cUser.do Server.cServer.do:
230 ${CC} -g -DDEBUG ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \
231 -c ${.IMPSRC} -o ${.TARGET}
232
233 #### Standard Assembler Rules #########################################
234 .s.o:
235 ${CC} -static -x assembler-with-cpp ${CFLAGS:M-[BIDF]*} \
236 ${CFLAGS-${.IMPSRC:T}:M-[BIDF]*} ${AINC} \
237 -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET}
238 .s.po:
239 ${CC} -pg -DPROFILE -x assembler-with-cpp ${CFLAGS:M-[BIDF]*} \
240 ${CFLAGS-${.IMPSRC:T}:M-[BIDF]*} ${AINC} \
241 -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET}
242 .s.So:
243 ${CC} -x assembler-with-cpp ${CFLAGS:M-[BIDF]*} \
244 ${CFLAGS-${.IMPSRC:T}:M-[BIDF]*} ${AINC} \
245 -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET}
246 .s.do:
247 ${CC} -g -DDEBUG -x assembler-with-cpp ${CFLAGS:M-[BIDF]*} \
248 ${CFLAGS-${.IMPSRC:T}:M-[BIDF]*} ${AINC} \
249 -c ${.IMPSRC} -o ${.TARGET}
250
251 #### mig Rules ########################################################
252 .defs.h .defsUser.c .defsServer.c:
253 mig -arch ${MACHINE_ARCH} -cc ${CC} -user ${.PREFIX}User.c -server ${.PREFIX}Server.c -header ${.PREFIX}.h ${.IMPSRC}
254
255 gen_mig_defs: ${SRVMIGHDRS} ${MIGHDRS}
256 gen_md_mig_defs: ${MD_MIGHDRS}
257
258 #### Library Rules ####################################################
259 lib${LIB}_static.a:: ${VARIANTCOMBOS} ${OBJS} ${STATICOBJS}
260 @${ECHO} building static ${LIB} library
261 @rm -f lib${LIB}_static.a
262 @${AR} cq lib${LIB}_static.a `lorder ${OBJS} ${STATICOBJS} ${VARIANTOBJS} | tsort -q` ${ARADD}
263 ${RANLIB} lib${LIB}_static.a
264
265 lib${LIB}_profile.a:: ${VARIANTCOMBOS:S/$/_P/g} ${POBJS} ${POBJS2}
266 @${ECHO} building profiled ${LIB} library
267 @rm -f lib${LIB}_profile.a
268 @${AR} cq lib${LIB}_profile.a `lorder ${POBJS} ${VARIANTPOBJS} | tsort -q` ${ARADD}
269 ${RANLIB} lib${LIB}_profile.a
270 .if (${MACHINE_ARCH} == ppc)
271 @${ECHO} building profiled ${LIB128} library
272 @rm -f lib${LIB128}_profile.a
273 @${AR} cq lib${LIB128}_profile.a ${LDBL_128_POBJS}
274 .endif
275
276 lib${LIB}_debug.a:: ${VARIANTCOMBOS:S/$/_D/g} ${DOBJS} ${DOBJS2}
277 @${ECHO} building debug ${LIB} library
278 @rm -f lib${LIB}_debug.a
279 @${AR} cq lib${LIB}_debug.a `lorder ${DOBJS} ${VARIANTDOBJS} | tsort -q` ${ARADD}
280 ${RANLIB} lib${LIB}_debug.a
281 .if (${MACHINE_ARCH} == ppc)
282 @${ECHO} building debug ${LIB128} library
283 @rm -f lib${LIB128}_debug.a
284 @${AR} cq lib${LIB128}_debug.a ${LDBL_128_DOBJS}
285 .endif
286
287 lib${LIB}.a:: ${VARIANTCOMBOS:S/$/_S/g} ${SOBJS} ${SOBJS2}
288 @${ECHO} building standard ${LIB} library
289 @rm -f lib${LIB}.a
290 @${AR} cq lib${LIB}.a `lorder ${SOBJS} ${VARIANTSOBJS} | tsort -q` ${ARADD}
291 ${RANLIB} lib${LIB}.a
292 .if (${MACHINE_ARCH} == ppc)
293 @${ECHO} building standard ${LIB128} library
294 @rm -f lib${LIB128}.a
295 @${AR} cq lib${LIB128}.a ${LDBL_128_SOBJS}
296 .endif
297
298 CLEANFILES += ${DOBJS} libc_static.a libc_profile.a libc_debug.a
299
300 INCDIR = ${DESTDIR}/usr/include
301 LOCINCDIR = ${DESTDIR}/usr/local/include
302 SYSTEMFRAMEWORK = ${DESTDIR}/System/Library/Frameworks/System.framework
303 PRIVHDRS = ${SYSTEMFRAMEWORK}/Versions/B/PrivateHeaders
304 KERNELFRAMEWORK = ${DESTDIR}/System/Library/Frameworks/Kernel.framework
305 PRIVKERNELHDRS = ${KERNELFRAMEWORK}/Versions/A/PrivateHeaders
306
307 installhdrs-md: gen_md_mig_defs
308 mkdir -p ${INCDIR}/mach/${MACHINE_ARCH}
309 ${INSTALL} -c -m 444 ${MD_MIGHDRS} ${INCDIR}/mach/${MACHINE_ARCH}
310
311 installhdrs: autopatchhdrs gen_mig_defs
312 mkdir -p ${INCDIR}/arpa
313 mkdir -p ${INCDIR}/libkern
314 mkdir -p ${INCDIR}/mach
315 mkdir -p ${INCDIR}/machine
316 mkdir -p ${INCDIR}/malloc
317 mkdir -p ${INCDIR}/objc
318 mkdir -p ${INCDIR}/protocols
319 mkdir -p ${INCDIR}/servers
320 mkdir -p ${INCDIR}/sys
321 mkdir -p ${INCDIR}/xlocale
322 ${INSTALL} -c -m 444 ${INSTHDRS} ${INCDIR}
323 ${INSTALL} -c -m 444 ${ARPA_INSTHDRS} ${INCDIR}/arpa
324 ${INSTALL} -c -m 444 ${LIBKERN_INSTHDRS} ${INCDIR}/libkern
325 ${INSTALL} -c -m 444 ${MACH_INSTHDRS} ${INCDIR}/mach
326 ${INSTALL} -c -m 444 ${MACHINE_INSTHDRS} ${INCDIR}/machine
327 ${INSTALL} -c -m 444 ${MALLOC_INSTHDRS} ${INCDIR}/malloc
328 ${INSTALL} -c -m 444 ${OBJC_INSTHDRS} ${INCDIR}/objc
329 ${INSTALL} -c -m 444 ${PROTO_INSTHDRS} ${INCDIR}/protocols
330 ${INSTALL} -c -m 444 ${SRVHDRS} ${INCDIR}/servers
331 ${INSTALL} -c -m 444 ${SYS_INSTHDRS} ${INCDIR}/sys
332 ${INSTALL} -c -m 444 ${XLOCALE_INSTHDRS} ${INCDIR}/xlocale
333 mkdir -p ${LOCINCDIR}
334 ${INSTALL} -c -m 444 ${LOCALHDRS} ${LOCINCDIR}
335 mkdir -p ${PRIVHDRS}/architecture/ppc
336 mkdir -p ${PRIVHDRS}/btree
337 mkdir -p ${PRIVHDRS}/machine
338 mkdir -p ${PRIVHDRS}/objc
339 mkdir -p ${PRIVHDRS}/uuid
340 mkdir -p ${PRIVHDRS}/sys
341 mkdir -p ${PRIVKERNELHDRS}/uuid
342 ${INSTALL} -c -m 444 ${PRIV_INSTHDRS} ${PRIVHDRS}
343 ${INSTALL} -c -m 444 ${SRCROOT}/ppc/sys/processor_facilities.h ${PRIVHDRS}/architecture/ppc
344 ${INSTALL} -c -m 444 ${SYMROOT}/btree.h ${PRIVHDRS}/btree
345 ${INSTALL} -c -m 444 ${SYMROOT}/bt_extern.h ${PRIVHDRS}/btree
346 ${INSTALL} -c -m 444 ${SRCROOT}/internat/NXCType.h ${PRIVHDRS}/objc
347 mv ${DESTDIR}/usr/include/asm.h ${PRIVHDRS}/machine
348 mv ${INCDIR}/servers/srvbootstrap.h ${INCDIR}/servers/bootstrap.h
349 @for i in `find ${DESTDIR}/usr/include/mach ${DESTDIR}/usr/include/servers -name \*.h`; do \
350 x=`fgrep '<mach/mig.h>' $$i | uniq -d`; \
351 if [ -n "$$x" ]; then \
352 echo patching $$i; \
353 ed - $$i < ${SRCROOT}/fixdups.ed; \
354 fi; \
355 done
356 ${INSTALL} -c -m 444 ${SYS_INSTHDRS} ${PRIVHDRS}/sys
357 ${INSTALL} -c -m 444 ${PRIVUUID_INSTHDRS} ${PRIVHDRS}/uuid
358 ${INSTALL} -c -m 444 ${PRIVUUID_INSTHDRS} ${PRIVKERNELHDRS}/uuid
359 ${INSTALL} -c -m 444 ${INSTHDRS_AUTOPATCH:S,^,${SYMROOT}/,} ${INCDIR}
360 .for _h in ${STRIP_HDRS}
361 chmod u+w ${INCDIR}/${_h}
362 ed - ${INCDIR}/${_h} < ${.CURDIR}/strip-header.ed
363 chmod u-w ${INCDIR}/${_h}
364 .endfor
365
366 install_lib${LIB}_static.a:
367 ${INSTALL} -c -m 444 lib${LIB}_static.a ${DESTDIR}/usr/local/lib/system/
368 install_lib${LIB}_profile.a:
369 ${INSTALL} -c -m 444 lib${LIB}_profile.a ${DESTDIR}/usr/local/lib/system
370 install_lib${LIB}_debug.a:
371 ${INSTALL} -c -m 444 lib${LIB}_debug.a ${DESTDIR}/usr/local/lib/system/
372 install_lib${LIB}.a:
373 ${INSTALL} -c -m 444 lib${LIB}.a ${DESTDIR}/usr/local/lib/system/
374
375 autopatch: autopatchhdrs ${AUTOPATCHSRCS}
376 autopatchhdrs: ${AUTOPATCHHDRS}
377 autopatchman: ${AUTOPATCHMAN}
378
379 clean:
380 rm -f ${OBJS} ${POBJS} ${DOBJS} ${SOBJS} ${CLEANFILES}
381 rm -f lib${LIB}.a lib${LIB}_static.a lib${LIB}_profile.a \
382 lib${LIB}_debug.a