]> git.saurik.com Git - apple/libc.git/blob - stdlib/Makefile.inc
c33b88311a7264c4ec376b2b91d346bcff0835e5
[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 DYLDSRCS += atexit.c exit.c gettimeofday.c heapsort.c merge.c qsort.c reallocf.c realpath.c
103
104 # set the LIBC_ALIAS_* macros so we can decorate the symbol independent
105 # of other macro settings
106 CFLAGS-getopt-fbsd.c += -DLIBC_ALIAS_GETOPT
107 CFLAGS-putenv-fbsd.c += -DLIBC_ALIAS_PUTENV
108 CFLAGS-realpath-fbsd.c += -DLIBC_ALIAS_REALPATH
109 CFLAGS-setenv-fbsd.c += -DLIBC_ALIAS_SETENV -DLIBC_ALIAS_UNSETENV
110 CFLAGS-system-fbsd.c += -DLIBC_ALIAS_SYSTEM
111
112 .if ${LIB} == "c"
113 MAN3+= a64l.3 grantpt.3 psort.3
114 MAN3+= strtod_l.3 strtol_l.3
115
116 .include "Makefile.fbsd_begin"
117 FBSDMAN3= abort.3 abs.3 alloca.3 atexit.3 atof.3 atoi.3 atol.3 bsearch.3 \
118 div.3 exit.3 getenv.3 getopt.3 getopt_long.3 getsubopt.3 \
119 hcreate.3 imaxabs.3 imaxdiv.3 insque.3 labs.3 ldiv.3 llabs.3 lldiv.3 \
120 lsearch.3 memory.3 qsort.3 radixsort.3 rand.3 random.3 realpath.3 \
121 strtod.3 strtol.3 strtoul.3 system.3 tsearch.3
122 .include "Makefile.fbsd_end"
123
124 .include "Makefile.nbsd_begin"
125 NBSDMAN3= strfmon.3
126 .include "Makefile.nbsd_end"
127
128 .include "Makefile.obsd_begin"
129 OBSDMAN3= ecvt.3
130 .include "Makefile.obsd_end"
131
132 MLINKS+= a64l.3 l64a.3
133
134 .ifdef FEATURE_BLOCKS
135 MLINKS+= atexit.3 atexit_b.3
136 .endif # FEATURE_BLOCKS
137
138 MLINKS+= atof.3 atof_l.3
139
140 MLINKS+= atoi.3 atoi_l.3
141
142 MLINKS+= atol.3 atol_l.3 \
143 atol.3 atoll.3 \
144 atol.3 atoll_l.3
145
146 .ifdef FEATURE_BLOCKS
147 MLINKS+= bsearch.3 bsearch_b.3
148 .endif # FEATURE_BLOCKS
149
150 MLINKS+= ecvt.3 fcvt.3 \
151 ecvt.3 gcvt.3
152
153 MLINKS+= exit.3 _Exit.3
154
155 MLINKS+= getenv.3 putenv.3 \
156 getenv.3 setenv.3 \
157 getenv.3 unsetenv.3
158
159 MLINKS+= getopt_long.3 getopt_long_only.3
160
161 MLINKS+= grantpt.3 posix_openpt.3 \
162 grantpt.3 ptsname.3 \
163 grantpt.3 unlockpt.3
164
165 MLINKS+= hcreate.3 hdestroy.3 \
166 hcreate.3 hsearch.3
167
168 MLINKS+= insque.3 remque.3
169
170 MLINKS+= lsearch.3 lfind.3
171
172 MLINKS+= psort.3 psort_r.3
173 .ifdef FEATURE_BLOCKS
174 MLINKS+= psort.3 psort_b.3
175 .endif # FEATURE_BLOCKS
176
177 MLINKS+= qsort.3 heapsort.3 \
178 qsort.3 mergesort.3 \
179 qsort.3 qsort_r.3
180 .ifdef FEATURE_BLOCKS
181 MLINKS+= qsort.3 heapsort_b.3 \
182 qsort.3 mergesort_b.3 \
183 qsort.3 qsort_b.3
184 .endif # FEATURE_BLOCKS
185
186 MLINKS+= radixsort.3 sradixsort.3
187
188 MLINKS+= rand.3 rand_r.3 \
189 rand.3 srand.3 \
190 rand.3 sranddev.3
191
192 MLINKS+= random.3 initstate.3 \
193 random.3 setstate.3 \
194 random.3 srandom.3 \
195 random.3 srandomdev.3
196
197 MLINKS+=strfmon.3 strfmon_l.3
198
199 MLINKS+= strtod.3 strtof.3 \
200 strtod.3 strtold.3
201
202 MLINKS+= strtod_l.3 strtof_l.3 \
203 strtod_l.3 strtold_l.3
204
205 MLINKS+= strtol.3 strtoll.3 \
206 strtol.3 strtoq.3 \
207 strtol.3 strtoimax.3
208
209 MLINKS+= strtol_l.3 strtoimax_l.3 \
210 strtol_l.3 strtoll_l.3 \
211 strtol_l.3 strtoq_l.3 \
212 strtol_l.3 strtoul_l.3 \
213 strtol_l.3 strtoull_l.3 \
214 strtol_l.3 strtoumax_l.3 \
215 strtol_l.3 strtouq_l.3
216
217 MLINKS+= strtoul.3 strtoull.3 \
218 strtoul.3 strtoumax.3 \
219 strtoul.3 strtouq.3
220
221 MLINKS+= tsearch.3 tdelete.3 \
222 tsearch.3 tfind.3 \
223 tsearch.3 twalk.3
224 .endif