]> git.saurik.com Git - apple/libc.git/blob - stdlib/Makefile.inc
Libc-594.9.1.tar.gz
[apple/libc.git] / stdlib / Makefile.inc
1 # from @(#)Makefile.inc 8.3 (Berkeley) 2/4/95
2 # $FreeBSD: src/lib/libc/stdlib/Makefile.inc,v 1.45 2003/04/05 07:33:46 tjr Exp $
3
4 # machine-dependent stdlib sources
5 .sinclude "${.CURDIR}/${MACHINE_ARCH}/stdlib/Makefile.inc"
6
7 # machine-independent stdlib sources
8 .PATH: ${.CURDIR}/stdlib
9 CWD := ${.CURDIR}/stdlib
10
11 MISRCS+=a64l.c grantpt.c l64a.c
12 .ifdef FEATURE_BLOCKS
13 MISRCS+=qsort_b.c
14 .endif # FEATURE_BLOCKS
15
16 .include "Makefile.fbsd_begin"
17 FBSDMISRCS=_Exit_.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \
18 bsearch.c div.c exit.c getenv.c getopt.c getopt_long.c getsubopt.c \
19 hcreate.c heapsort.c imaxabs.c imaxdiv.c insque.c labs.c \
20 ldiv.c llabs.c lldiv.c lsearch.c merge.c putenv.c qsort.c qsort_r.c \
21 radixsort.c rand.c random.c reallocf.c realpath.c remque.c setenv.c \
22 strhash.c strtoimax.c strtol.c strtoll.c strtoq.c strtoul.c \
23 strtoull.c strtoumax.c strtouq.c system.c tdelete.c tfind.c tsearch.c \
24 twalk.c
25 FBSDHDRS= atexit.h
26 .include "Makefile.fbsd_end"
27
28 # special cases: heapsort_b-fbsd.c, merge_b-fbsd.c
29 .for _file in heapsort merge
30 .ifmake autopatch
31 .for _cwd in ${CWD} # This .for statement forces evaluation of ${CWD}
32 AUTOPATCHSRCS+= ${_cwd}/${_file}_b-fbsd.c
33 ${_cwd}/${_file}_b-fbsd.c: ${_cwd}/FreeBSD/${_file}.c
34 ${CP} ${.ALLSRC} ${.TARGET}
35 ${PATCH} ${.TARGET} ${.ALLSRC:S/${_file}/${_file}_b/}.patch
36 .endfor # _cwd
37 .else # !autopatch
38 .ifdef FEATURE_BLOCKS
39 MISRCS+= ${_file}_b.c
40 .endif # FEATURE_BLOCKS
41 .endif # autopatch
42 .endfor # _file
43
44 # special cases: heapsort_r-fbsd.c
45 .for _file in heapsort
46 .ifmake autopatch
47 .for _cwd in ${CWD} # This .for statement forces evaluation of ${CWD}
48 AUTOPATCHSRCS+= ${_cwd}/${_file}_r-fbsd.c
49 ${_cwd}/${_file}_r-fbsd.c: ${_cwd}/FreeBSD/${_file}.c
50 ${CP} ${.ALLSRC} ${.TARGET}
51 ${PATCH} ${.TARGET} ${.ALLSRC:S/${_file}/${_file}_r/}.patch
52 .endfor # _cwd
53 .else # !autopatch
54 MISRCS+= ${_file}_r.c
55 .endif # autopatch
56 .endfor # _file
57
58 # special cases: psort{,_b,_r}-fbsd.c psort.3
59 .for _cwd in ${CWD} # This .for statement forces evaluation of ${CWD}
60 .ifmake autopatch
61 AUTOPATCHSRCS+= ${_cwd}/psort-fbsd.c
62 ${_cwd}/psort-fbsd.c: ${_cwd}/qsort-fbsd.c
63 ${CP} ${.ALLSRC} ${.TARGET}
64 ${PATCH} ${.TARGET} ${_cwd}/psort.c.patch
65 .for _file in psort_b psort_r
66 AUTOPATCHSRCS+= ${_cwd}/${_file}-fbsd.c
67 ${_cwd}/${_file}-fbsd.c: ${_cwd}/psort-fbsd.c
68 ${LN} ${.ALLSRC} ${.TARGET}
69 .endfor # _file
70 AUTOPATCHMAN+= ${_cwd}/psort.3
71 ${_cwd}/psort.3: ${_cwd}/qsort.3
72 ${CP} ${.ALLSRC} ${.TARGET}
73 ${PATCH} ${.TARGET} ${_cwd}/psort.3.patch
74 .else # !autopatch
75 MISRCS+= psort.c psort_r.c
76 CFLAGS-psort_r-fbsd.c += -DI_AM_PSORT_R
77 .ifdef FEATURE_BLOCKS
78 MISRCS+= psort_b.c
79 CFLAGS-psort_b-fbsd.c += -DI_AM_PSORT_B
80 .endif # FEATURE_BLOCKS
81 .endif # autopatch
82 .endfor # _cwd
83
84 .include "Makefile.nbsd_begin"
85 NBSDMISRCS = strfmon.c
86 .include "Makefile.nbsd_end"
87
88 # 4302056: compile qsort.c and bsearch.c with -fexceptions
89 .for _src in qsort-fbsd.c bsearch-fbsd.c
90 CFLAGS-${_src} += -fexceptions
91 .endfor
92
93 PRIV_INSTHDRS += ${SRCROOT}/stdlib/atexit.h
94
95 .include "Makefile.obsd_begin"
96 OBSDMISRCS=ecvt.c gcvt.c
97 .include "Makefile.obsd_end"
98
99 LEGACYSRCS+= getopt.c putenv.c realpath.c setenv.c system.c
100 DARWINEXTSNSRCS += realpath.c
101 CANCELABLESRCS += system.c
102
103 # set the LIBC_ALIAS_* macros so we can decorate the symbol independent
104 # of other macro settings
105 CFLAGS-getopt-fbsd.c += -DLIBC_ALIAS_GETOPT
106 CFLAGS-putenv-fbsd.c += -DLIBC_ALIAS_PUTENV
107 CFLAGS-realpath-fbsd.c += -DLIBC_ALIAS_REALPATH
108 CFLAGS-setenv-fbsd.c += -DLIBC_ALIAS_SETENV -DLIBC_ALIAS_UNSETENV
109 CFLAGS-system-fbsd.c += -DLIBC_ALIAS_SYSTEM
110
111 .if ${LIB} == "c"
112 MAN3+= a64l.3 grantpt.3 psort.3
113 MAN3+= strtod_l.3 strtol_l.3
114
115 .include "Makefile.fbsd_begin"
116 FBSDMAN3= abort.3 abs.3 alloca.3 atexit.3 atof.3 atoi.3 atol.3 bsearch.3 \
117 div.3 exit.3 getenv.3 getopt.3 getopt_long.3 getsubopt.3 \
118 hcreate.3 imaxabs.3 imaxdiv.3 insque.3 labs.3 ldiv.3 llabs.3 lldiv.3 \
119 lsearch.3 memory.3 qsort.3 radixsort.3 rand.3 random.3 realpath.3 \
120 strtod.3 strtol.3 strtoul.3 system.3 tsearch.3
121 .include "Makefile.fbsd_end"
122
123 .include "Makefile.nbsd_begin"
124 NBSDMAN3= strfmon.3
125 .include "Makefile.nbsd_end"
126
127 .include "Makefile.obsd_begin"
128 OBSDMAN3= ecvt.3
129 .include "Makefile.obsd_end"
130
131 MLINKS+= a64l.3 l64a.3
132
133 .ifdef FEATURE_BLOCKS
134 MLINKS+= atexit.3 atexit_b.3
135 .endif # FEATURE_BLOCKS
136
137 MLINKS+= atof.3 atof_l.3
138
139 MLINKS+= atoi.3 atoi_l.3
140
141 MLINKS+= atol.3 atol_l.3 \
142 atol.3 atoll.3 \
143 atol.3 atoll_l.3
144
145 .ifdef FEATURE_BLOCKS
146 MLINKS+= bsearch.3 bsearch_b.3
147 .endif # FEATURE_BLOCKS
148
149 MLINKS+= ecvt.3 fcvt.3 \
150 ecvt.3 gcvt.3
151
152 MLINKS+= exit.3 _Exit.3
153
154 MLINKS+= getenv.3 putenv.3 \
155 getenv.3 setenv.3 \
156 getenv.3 unsetenv.3
157
158 MLINKS+= getopt_long.3 getopt_long_only.3
159
160 MLINKS+= grantpt.3 posix_openpt.3 \
161 grantpt.3 ptsname.3 \
162 grantpt.3 unlockpt.3
163
164 MLINKS+= hcreate.3 hdestroy.3 \
165 hcreate.3 hsearch.3
166
167 MLINKS+= insque.3 remque.3
168
169 MLINKS+= lsearch.3 lfind.3
170
171 MLINKS+= psort.3 psort_r.3
172 .ifdef FEATURE_BLOCKS
173 MLINKS+= psort.3 psort_b.3
174 .endif # FEATURE_BLOCKS
175
176 MLINKS+= qsort.3 heapsort.3 \
177 qsort.3 mergesort.3 \
178 qsort.3 qsort_r.3
179 .ifdef FEATURE_BLOCKS
180 MLINKS+= qsort.3 heapsort_b.3 \
181 qsort.3 mergesort_b.3 \
182 qsort.3 qsort_b.3
183 .endif # FEATURE_BLOCKS
184
185 MLINKS+= radixsort.3 sradixsort.3
186
187 MLINKS+= rand.3 rand_r.3 \
188 rand.3 srand.3 \
189 rand.3 sranddev.3
190
191 MLINKS+= random.3 initstate.3 \
192 random.3 setstate.3 \
193 random.3 srandom.3 \
194 random.3 srandomdev.3
195
196 MLINKS+=strfmon.3 strfmon_l.3
197
198 MLINKS+= strtod.3 strtof.3 \
199 strtod.3 strtold.3
200
201 MLINKS+= strtod_l.3 strtof_l.3 \
202 strtod_l.3 strtold_l.3
203
204 MLINKS+= strtol.3 strtoll.3 \
205 strtol.3 strtoq.3 \
206 strtol.3 strtoimax.3
207
208 MLINKS+= strtol_l.3 strtoimax_l.3 \
209 strtol_l.3 strtoll_l.3 \
210 strtol_l.3 strtoq_l.3 \
211 strtol_l.3 strtoul_l.3 \
212 strtol_l.3 strtoull_l.3 \
213 strtol_l.3 strtoumax_l.3 \
214 strtol_l.3 strtouq_l.3
215
216 MLINKS+= strtoul.3 strtoull.3 \
217 strtoul.3 strtoumax.3 \
218 strtoul.3 strtouq.3
219
220 MLINKS+= tsearch.3 tdelete.3 \
221 tsearch.3 tfind.3 \
222 tsearch.3 twalk.3
223 .endif