]> git.saurik.com Git - apple/libc.git/blob - gen/Makefile.inc
Libc-763.13.tar.gz
[apple/libc.git] / gen / Makefile.inc
1 # @(#)Makefile.inc 8.6 (Berkeley) 5/4/95
2 # $FreeBSD: src/lib/libc/gen/Makefile.inc,v 1.80 2001/08/17 22:09:15 dd Exp $
3
4 # machine-dependent gen sources
5 .sinclude "${.CURDIR}/${MACHINE_ARCH}/gen/Makefile.inc"
6
7 # machine-independent gen sources
8 .PATH: ${.CURDIR}/gen
9 CWD := ${.CURDIR}/gen
10
11 CFLAGS += -I${.CURDIR}/gen
12
13 GENMIGDEFS += asl_ipc.defs
14 GENMIGHDRS += ${GENMIGDEFS:.defs=.h}
15 GENMIGSRCS += ${GENMIGDEFS:.defs=User.c}
16
17 MISRCS += ${GENMIGSRCS} NSSystemDirectories.c \
18 asl.c asl_core.c asl_file.c asl_legacy1.c asl_msg.c asl_store.c asl_util.c \
19 assumes.c \
20 backtrace.c \
21 cache.c confstr.c crypt.c devname.c disklabel.c errlst.c \
22 filesec.c fts.c \
23 get_compat.c getloadavg.c getttyent.c getusershell.c getvfsbyname.c \
24 isinf.c isnan.c \
25 malloc.c nanosleep.c nftw.c magazine_malloc.c setlogin.c \
26 sigsetops.c _simple.c stack_logging.c stack_logging_disk.c strtofflags.c syslog.c \
27 thread_stack_pcs.c uname.c utmpx-darwin.c wordexp.c \
28 platfunc.c
29
30 .ifdef FEATURE_LEGACY_NXZONE_APIS
31 MISRCS += zone.c
32 .endif
33 .if !defined(LP64)
34 MISRCS += nlist.c
35 .endif
36
37 # DTrace USDT probes placed in magazine_malloc.c and malloc.c
38 ${SYMROOTINC}/magmallocProvider.h: ${.CURDIR}/gen/magmallocProvider.d
39 ${DTRACE} -o ${.TARGET} -C -h -s ${.ALLSRC}
40 magazine_malloc.${OBJSUFFIX}: ${SYMROOTINC}/magmallocProvider.h
41 malloc.${OBJSUFFIX}: ${SYMROOTINC}/magmallocProvider.h
42
43 # Force the ASL-related mig files to build first
44 BUILDFIRST += asl_ipcUser.c
45
46 CLEANFILES += ${GENMIGHDRS} ${GENMIGSRCS} ${GENMIGDEFS:.defs=Server.c}
47
48 LOCALHDRS += \
49 ${.CURDIR}/gen/asl_core.h \
50 ${.CURDIR}/gen/asl_file.h \
51 ${.CURDIR}/gen/asl_ipc.defs \
52 ${.CURDIR}/gen/asl_legacy1.h \
53 ${.CURDIR}/gen/asl_msg.h \
54 ${.CURDIR}/gen/asl_private.h \
55 ${.CURDIR}/gen/asl_store.h \
56 ${.CURDIR}/gen/assumes.h \
57 ${.CURDIR}/gen/_simple.h \
58 ${.CURDIR}/gen/stack_logging.h \
59 ${.CURDIR}/gen/utmpx_thread.h
60
61 CFLAGS-asl_file.c += -D_DARWIN_UNLIMITED_STREAMS
62 CFLAGS-asl_legacy1.c += -D_DARWIN_UNLIMITED_STREAMS
63 CFLAGS-asl_msg.c += -D_DARWIN_UNLIMITED_STREAMS
64 CFLAGS-asl_store.c += -D_DARWIN_UNLIMITED_STREAMS
65 CFLAGS-confstr.c += -I${.CURDIR}/darwin
66 CFLAGS-fmtmsg-fbsd.c += -D_DARWIN_UNLIMITED_STREAMS
67 CFLAGS-getcap-fbsd.c += -D_DARWIN_UNLIMITED_STREAMS
68 CFLAGS-getttyent.c += -D_DARWIN_UNLIMITED_STREAMS
69 CFLAGS-getusershell.c += -D_DARWIN_UNLIMITED_STREAMS
70 CFLAGS-glob-fbsd.c += -UDEBUG
71
72 # 4840357: workaround for compiler failure building libc_debug.a
73 .if make(lib${LIB}_debug.a)
74 CFLAGS-magazine_malloc.c += -funit-at-a-time
75 .endif
76
77 # Malloc uses count leading zeroes, not available in thumb
78 #.if (${MACHINE_ARCH} == arm)
79 #CFLAGS-scalable_malloc.c += -mno-thumb
80 #.endif
81
82 CFLAGS-stack_logging_disk.c += -D_DARWIN_UNLIMITED_STREAMS
83 CFLAGS-utmpx-nbsd.c += -D_DARWIN_UNLIMITED_STREAMS
84 CFLAGS-wordexp.c += -D_DARWIN_UNLIMITED_STREAMS
85
86 # also build 64-bit long double versions (ppc only)
87 LDBLSRCS += asl.c err.c syslog.c
88
89 .include "Makefile.fbsd_begin"
90 FBSDMISRCS = _rand48.c alarm.c arc4random.c assert.c \
91 basename.c clock.c closedir.c ctermid.c \
92 daemon.c dirname.c drand48.c erand48.c err.c exec.c \
93 fmtcheck.c fmtmsg.c fnmatch.c ftok.c \
94 getbsize.c getcap.c getcwd.c gethostname.c getpeereid.c \
95 getlogin.c getmntinfo.c getpagesize.c getprogname.c glob.c isatty.c \
96 jrand48.c lcong48.c lockf.c lrand48.c mrand48.c nice.c nrand48.c \
97 opendir.c pause.c popen.c pselect.c psignal.c raise.c readdir.c \
98 readpassphrase.c rewinddir.c scandir.c seed48.c seekdir.c \
99 sethostname.c setmode.c setprogname.c siginterrupt.c siglist.c \
100 signal.c sleep.c srand48.c stringlist.c sysconf.c sysctl.c \
101 sysctlbyname.c sysctlnametomib.c \
102 telldir.c termios.c time.c times.c \
103 ttyname.c ttyslot.c ualarm.c ulimit.c unvis.c usleep.c utime.c vis.c \
104 wait.c wait3.c waitpid.c
105
106 .ifdef FEATURE_LEGACY_64_APIS
107 # special case: getmntinfo64-fbsd.c is derived from getmntinfo.c with getmntinfo64.c.patch
108 .ifmake autopatch
109 .for _cwd in ${CWD} # This .for statement forces evaluation of ${CWD}
110 AUTOPATCHSRCS+= ${_cwd}/getmntinfo64-fbsd.c
111 ${_cwd}/getmntinfo64-fbsd.c: ${_cwd}/FreeBSD/getmntinfo.c
112 ${CP} ${.ALLSRC} ${.TARGET}
113 ${PATCH} ${.TARGET} ${.ALLSRC:S/getmntinfo/getmntinfo64/}.patch
114 .endfor # _cwd
115 .else # !autopatch
116 MISRCS+= getmntinfo64.c
117 .endif # autopatch
118 .endif # FEATURE_LEGACY_64_APIS
119
120 # special case: scandir_b-fbsd.c is derived from scandir.c with scandir_b.c.patch
121 .ifmake autopatch
122 .for _cwd in ${CWD} # This .for statement forces evaluation of ${CWD}
123 AUTOPATCHSRCS+= ${_cwd}/scandir_b-fbsd.c
124 ${_cwd}/scandir_b-fbsd.c: ${_cwd}/FreeBSD/scandir.c
125 ${CP} ${.ALLSRC} ${.TARGET}
126 ${PATCH} ${.TARGET} ${.ALLSRC:S/scandir/scandir_b/}.patch
127 .endfor # _cwd
128 .else # !autopatch
129 .ifdef FEATURE_BLOCKS
130 MISRCS+= scandir_b.c
131 .endif # FEATURE_BLOCKS
132 .endif # autopatch
133
134 PRE1050SRCS+= daemon.c
135 .if defined(LP64)
136 PRE1050SRCS+= pselect.c
137 .endif
138 .ifndef FEATURE_ONLY_UNIX_CONFORMANCE
139 # only patch timezone.c; don't build in base variant, but in other variants
140 FBSDPATCHSRCS += timezone.c
141 .endif
142
143 FBSDHDRS = rand48.h telldir.h
144 .include "Makefile.fbsd_end"
145
146 .include "Makefile.nbsd_begin"
147 NBSDMISRCS = utmpx.c
148 .include "Makefile.nbsd_end"
149
150 # private header files
151 INSTHDRS += ${.CURDIR}/gen/get_compat.h \
152 ${.CURDIR}/gen/execinfo.h
153 PRIV_INSTHDRS += ${.CURDIR}/gen/stack_logging.h
154
155 LEGACYSRCS += clock.c closedir.c confstr.c crypt.c fnmatch.c \
156 lockf.c nanosleep.c nftw.c nice.c opendir.c \
157 pause.c popen.c pselect.c rewinddir.c \
158 seekdir.c setmode.c sleep.c \
159 telldir.c termios.c timezone.c ttyname.c \
160 usleep.c wait.c waitpid.c
161 INODE32SRCS += fts.c getmntinfo.c glob.c nftw.c opendir.c \
162 readdir.c rewinddir.c scandir.c seekdir.c telldir.c
163 .ifdef FEATURE_BLOCKS
164 INODE32SRCS += scandir_b.c
165 .endif # FEATURE_BLOCKS
166 CANCELABLESRCS += lockf.c nanosleep.c pause.c pselect.c sleep.c termios.c \
167 usleep.c wait.c waitpid.c
168 CANCELABLE-DARWINEXTSNSRCS += pselect.c
169 DARWINEXTSNSRCS += popen.c pselect.c
170
171 DYLDSRCS += \
172 _simple.c \
173 arc4random.c \
174 closedir.c \
175 getcwd.c \
176 getpagesize.c \
177 nanosleep.c \
178 opendir.c \
179 readdir.c \
180 scandir.c \
181 sysctl.c \
182 sysctlbyname.c \
183 telldir.c \
184 usleep.c
185
186 # include __dirent.h to rename DIR structure elements
187 .for _src in closedir-fbsd.c opendir-fbsd.c readdir-fbsd.c rewinddir-fbsd.c \
188 scandir-fbsd.c seekdir-fbsd.c telldir-fbsd.c
189 CFLAGS-${_src} += -I${.CURDIR}/gen -include __dirent.h
190 .endfor
191 .ifdef FEATURE_BLOCKS
192 CFLAGS-scandir_b-fbsd.c += -I${.CURDIR}/gen -include __dirent.h
193 .endif # FEATURE_BLOCKS
194
195 # 4105292/4329702 different optimizations improves performance of
196 # drand48 and erand48
197 .if !make(lib${LIB}_debug.a)
198 .if (${MACHINE_ARCH} == i386)
199 OPTIMIZE-drand48-fbsd.c += -O1
200 OPTIMIZE-erand48-fbsd.c += -O1
201 .endif
202 .endif
203
204 # set the LIBC_ALIAS_* macros so we can decorate the symbol independent
205 # of other macro settings
206 CFLAGS-clock-fbsd.c += -DLIBC_ALIAS_CLOCK
207 CFLAGS-closedir-fbsd.c += -DLIBC_ALIAS_CLOSEDIR
208 CFLAGS-confstr.c += -DLIBC_ALIAS_CONFSTR
209 CFLAGS-crypt.c += -DLIBC_ALIAS_ENCRYPT -DLIBC_ALIAS_SETKEY
210 CFLAGS-fnmatch-fbsd.c += -DLIBC_ALIAS_FNMATCH
211 CFLAGS-fts.c += -DLIBC_ALIAS_FTS_CHILDREN -DLIBC_ALIAS_FTS_CLOSE -DLIBC_ALIAS_FTS_OPEN -DLIBC_ALIAS_FTS_OPEN_B -DLIBC_ALIAS_FTS_READ -DLIBC_ALIAS_FTS_SET
212 CFLAGS-glob-fbsd.c += -DLIBC_ALIAS_GLOB
213 CFLAGS-glob_b-fbsd.c += -DLIBC_ALIAS_GLOB_B
214 CFLAGS-lockf-fbsd.c += -DLIBC_ALIAS_LOCKF
215 CFLAGS-nanosleep.c += -DLIBC_ALIAS_NANOSLEEP
216 CFLAGS-nftw.c += -DLIBC_ALIAS_FTW -DLIBC_ALIAS_NFTW
217 CFLAGS-nice-fbsd.c += -DLIBC_ALIAS_NICE
218 CFLAGS-opendir-fbsd.c += -DLIBC_ALIAS___OPENDIR2 -DLIBC_ALIAS_OPENDIR
219 CFLAGS-rewinddir-fbsd.c += -DLIBC_ALIAS_REWINDDIR
220 CFLAGS-pause-fbsd.c += -DLIBC_ALIAS_PAUSE
221 CFLAGS-popen-fbsd.c += -DLIBC_ALIAS_POPEN
222 CFLAGS-pselect-fbsd.c += -DLIBC_ALIAS_PSELECT
223 CFLAGS-seekdir-fbsd.c += -DLIBC_ALIAS_SEEKDIR
224 CFLAGS-setmode-fbsd.c += -DLIBC_ALIAS_SETMODE
225 CFLAGS-sleep-fbsd.c += -DLIBC_ALIAS_SLEEP
226 CFLAGS-telldir-fbsd.c += -DLIBC_ALIAS__SEEKDIR -DLIBC_ALIAS_TELLDIR
227 CFLAGS-termios-fbsd.c += -DLIBC_ALIAS_TCDRAIN
228 CFLAGS-ttyname-fbsd.c += -DLIBC_ALIAS_TTYNAME_R
229 CFLAGS-usleep-fbsd.c += -DLIBC_ALIAS_USLEEP
230 CFLAGS-wait-fbsd.c += -DLIBC_ALIAS_WAIT
231 CFLAGS-waitpid-fbsd.c += -DLIBC_ALIAS_WAITPID
232
233 .if ${LIB} == "c"
234
235 MAN3 += asl.3 \
236 backtrace.3 \
237 confstr.3 crypt.3 devname.3 directory.3 fts.3 ftw.3 \
238 getdomainname.3 getloadavg.3 \
239 getttyent.3 getusershell.3 getvfsbyname.3 \
240 malloc.3 malloc_size.3 malloc_zone_malloc.3 nlist.3 posix_memalign.3 \
241 pwcache.3 setjmp.3 sigsetops.3 strtofflags.3 syslog.3 \
242 tcgetpgrp.3 tcsendbreak.3 tcsetattr.3 tcsetpgrp.3 tzset.3 \
243 uname.3 wordexp.3 intro.3
244
245 MAN5 += compat.5
246
247 .include "Makefile.fbsd_begin"
248 FBSDMAN3= alarm.3 arc4random.3 basename.3 clock.3 ctermid.3 \
249 daemon.3 dirname.3 err.3 exec.3 \
250 fmtcheck.3 fmtmsg.3 fnmatch.3 ftok.3 \
251 getbsize.3 getcap.3 getcontext.3 getcwd.3 \
252 gethostname.3 getmntinfo.3 getpagesize.3 getpass.3 \
253 getpeereid.3 getprogname.3 glob.3 \
254 lockf.3 makecontext.3 nice.3 \
255 pause.3 popen.3 pselect.3 psignal.3 \
256 raise.3 rand48.3 readpassphrase.3 \
257 scandir.3 setmode.3 \
258 siginterrupt.3 signal.3 signbit.3 sleep.3 \
259 stringlist.3 sysconf.3 sysctl.3 \
260 time.3 times.3 timezone.3 ttyname.3 \
261 ualarm.3 ucontext.3 ulimit.3 unvis.3 usleep.3 utime.3 \
262 vis.3
263 .include "Makefile.fbsd_end"
264
265 .include "Makefile.nbsd_begin"
266 NBSDMAN3= endutxent.3 getlastlogx.3
267 NBSDMAN5= utmpx.5
268 .include "Makefile.nbsd_end"
269
270 MLINKS+= arc4random.3 arc4random_addrandom.3 \
271 arc4random.3 arc4random_buf.3 \
272 arc4random.3 arc4random_stir.3 \
273 arc4random.3 arc4random_uniform.3
274
275 MLINKS+= asl.3 asl_add_log_file.3 \
276 asl.3 asl_close.3 \
277 asl.3 asl_free.3 \
278 asl.3 asl_get.3 \
279 asl.3 asl_key.3 \
280 asl.3 asl_log.3 \
281 asl.3 asl_new.3 \
282 asl.3 asl_open.3 \
283 asl.3 asl_remove_log_file.3 \
284 asl.3 asl_search.3 \
285 asl.3 asl_send.3 \
286 asl.3 asl_set.3 \
287 asl.3 asl_set_filter.3 \
288 asl.3 asl_set_query.3 \
289 asl.3 asl_unset.3 \
290 asl.3 asl_vlog.3 \
291 asl.3 aslresponse_free.3 \
292 asl.3 aslresponse_next.3
293
294 MLINKS+= backtrace.3 backtrace_symbols.3 \
295 backtrace.3 backtrace_symbols_fd.3
296
297 MLINKS+= crypt.3 encrypt.3 \
298 crypt.3 setkey.3
299
300 MLINKS+= ctermid.3 ctermid_r.3
301
302 MLINKS+= devname.3 devname_r.3
303
304 MLINKS+= directory.3 closedir.3 \
305 directory.3 dirfd.3 \
306 directory.3 opendir.3 \
307 directory.3 readdir.3 \
308 directory.3 readdir_r.3 \
309 directory.3 rewinddir.3 \
310 directory.3 seekdir.3 \
311 directory.3 telldir.3
312
313 MLINKS+= endutxent.3 getutxent.3 \
314 endutxent.3 getutxid.3 \
315 endutxent.3 getutxline.3 \
316 endutxent.3 pututxline.3 \
317 endutxent.3 setutxent.3
318
319 MLINKS+= err.3 err_set_exit.3 \
320 err.3 err_set_file.3 \
321 err.3 errc.3 \
322 err.3 errx.3 \
323 err.3 verr.3 \
324 err.3 verrc.3 \
325 err.3 verrx.3 \
326 err.3 vwarn.3 \
327 err.3 vwarnc.3 \
328 err.3 vwarnx.3 \
329 err.3 warn.3 \
330 err.3 warnc.3 \
331 err.3 warnx.3
332 .ifdef FEATURE_BLOCKS
333 MLINKS+= err.3 err_set_exit_b.3
334 .endif # FEATURE_BLOCKS
335
336 MLINKS+= exec.3 execl.3 \
337 exec.3 execle.3 \
338 exec.3 execlp.3 \
339 exec.3 execv.3 \
340 exec.3 execvp.3
341
342 MLINKS+= fts.3 fts_children.3 \
343 fts.3 fts_close.3 \
344 fts.3 fts_open.3 \
345 fts.3 fts_read.3 \
346 fts.3 fts_set.3
347 .ifdef FEATURE_BLOCKS
348 MLINKS+= fts.3 fts_open_b.3
349 .endif # FEATURE_BLOCKS
350
351 MLINKS+= ftw.3 nftw.3
352
353 MLINKS+= getcap.3 cgetcap.3 \
354 getcap.3 cgetclose.3 \
355 getcap.3 cgetent.3 \
356 getcap.3 cgetfirst.3 \
357 getcap.3 cgetmatch.3 \
358 getcap.3 cgetnext.3 \
359 getcap.3 cgetnum.3 \
360 getcap.3 cgetset.3 \
361 getcap.3 cgetstr.3 \
362 getcap.3 cgetustr.3
363
364 MLINKS+= getcontext.3 setcontext.3
365
366 MLINKS+= getcwd.3 getwd.3
367
368 MLINKS+= getdomainname.3 setdomainname.3
369
370 MLINKS+= getlastlogx.3 getlastlogxbyname.3 \
371 getlastlogx.3 getutmp.3 \
372 getlastlogx.3 getutmpx.3 \
373 getlastlogx.3 utmpxname.3
374
375 MLINKS+= gethostname.3 sethostname.3
376
377 MLINKS+= getprogname.3 setprogname.3
378
379 MLINKS+= getttyent.3 endttyent.3 \
380 getttyent.3 getttynam.3 \
381 getttyent.3 setttyent.3
382
383 MLINKS+= getusershell.3 endusershell.3 \
384 getusershell.3 setusershell.3
385
386 MLINKS+= glob.3 globfree.3
387
388 MLINKS+= malloc.3 calloc.3 \
389 malloc.3 free.3 \
390 malloc.3 realloc.3 \
391 malloc.3 reallocf.3 \
392 malloc.3 valloc.3
393
394 MLINKS+= makecontext.3 swapcontext.3
395
396 MLINKS+= malloc_size.3 malloc_good_size.3
397
398 MLINKS+= malloc_zone_malloc.3 malloc_create_zone.3 \
399 malloc_zone_malloc.3 malloc_destroy_zone.3 \
400 malloc_zone_malloc.3 malloc_default_zone.3 \
401 malloc_zone_malloc.3 malloc_zone_from_ptr.3 \
402 malloc_zone_malloc.3 malloc_zone_calloc.3 \
403 malloc_zone_malloc.3 malloc_zone_valloc.3 \
404 malloc_zone_malloc.3 malloc_zone_realloc.3 \
405 malloc_zone_malloc.3 malloc_zone_memalign.3 \
406 malloc_zone_malloc.3 malloc_zone_free.3
407
408 MLINKS+= popen.3 pclose.3
409
410 MLINKS+= psignal.3 sys_siglist.3 \
411 psignal.3 sys_signame.3
412
413 MLINKS+= psignal.3 strsignal.3 \
414 psignal.3 sys_siglist.3 \
415 psignal.3 sys_signame.3
416
417 MLINKS+= pwcache.3 group_from_gid.3 \
418 pwcache.3 user_from_uid.3
419
420 MLINKS+= rand48.3 _rand48.3 \
421 rand48.3 drand48.3 \
422 rand48.3 erand48.3 \
423 rand48.3 jrand48.3 \
424 rand48.3 lcong48.3 \
425 rand48.3 lrand48.3 \
426 rand48.3 mrand48.3 \
427 rand48.3 nrand48.3 \
428 rand48.3 seed48.3 \
429 rand48.3 srand48.3
430
431 MLINKS+= scandir.3 alphasort.3
432 .ifdef FEATURE_BLOCKS
433 MLINKS+= scandir.3 scandir_b.3
434 .endif # FEATURE_BLOCKS
435
436 MLINKS+= strtofflags.3 fflagstostr.3
437
438 MLINKS+= setjmp.3 _longjmp.3 \
439 setjmp.3 _setjmp.3 \
440 setjmp.3 longjmp.3 \
441 setjmp.3 longjmperr.3 \
442 setjmp.3 longjmperror.3 \
443 setjmp.3 siglongjmp.3 \
444 setjmp.3 sigsetjmp.3
445
446 MLINKS+= setmode.3 getmode.3
447
448 MLINKS+= sigsetops.3 sigaddset.3 \
449 sigsetops.3 sigdelset.3 \
450 sigsetops.3 sigemptyset.3 \
451 sigsetops.3 sigfillset.3 \
452 sigsetops.3 sigismember.3
453
454 MLINKS+= stringlist.3 sl_add.3 \
455 stringlist.3 sl_find.3 \
456 stringlist.3 sl_free.3 \
457 stringlist.3 sl_init.3
458
459 MLINKS+= sysctl.3 sysctlbyname.3 \
460 sysctl.3 sysctlnametomib.3
461
462 MLINKS+= syslog.3 closelog.3 \
463 syslog.3 openlog.3 \
464 syslog.3 setlogmask.3 \
465 syslog.3 vsyslog.3
466
467 MLINKS+= tcsendbreak.3 tcdrain.3 \
468 tcsendbreak.3 tcflow.3 \
469 tcsendbreak.3 tcflush.3
470
471 MLINKS+= tcsetattr.3 cfgetispeed.3 \
472 tcsetattr.3 cfgetospeed.3 \
473 tcsetattr.3 cfmakeraw.3 \
474 tcsetattr.3 cfsetispeed.3 \
475 tcsetattr.3 cfsetospeed.3 \
476 tcsetattr.3 cfsetspeed.3 \
477 tcsetattr.3 tcgetattr.3
478
479 MLINKS+= ttyname.3 isatty.3 \
480 ttyname.3 ttyslot.3
481
482 MLINKS+= tzset.3 tzsetwall.3
483
484 MLINKS+= unvis.3 strunvis.3 \
485 unvis.3 strunvisx.3
486
487 MLINKS+= vis.3 strvis.3 \
488 vis.3 strvisx.3
489
490 MLINKS+= wordexp.3 wordfree.3
491 .endif