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 $
4 # machine-dependent stdlib sources
5 .sinclude "${.CURDIR}/${MACHINE_ARCH}/stdlib/Makefile.inc"
7 # machine-independent stdlib sources
8 .PATH: ${.CURDIR}/stdlib
9 CWD := ${.CURDIR}/stdlib
11 MISRCS+=a64l.c grantpt.c l64a.c
14 .endif # FEATURE_BLOCKS
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 \
26 .include "Makefile.fbsd_end"
28 # special cases: heapsort_b-fbsd.c, merge_b-fbsd.c
29 .for _file in heapsort merge
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
40 .endif # FEATURE_BLOCKS
44 # special cases: heapsort_r-fbsd.c
45 .for _file in heapsort
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
58 # special cases: psort{,_b,_r}-fbsd.c psort.3
59 .for _cwd in ${CWD} # This .for statement forces evaluation of ${CWD}
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}
70 AUTOPATCHMAN+= ${_cwd}/psort.3
71 ${_cwd}/psort.3: ${_cwd}/qsort.3
72 ${CP} ${.ALLSRC} ${.TARGET}
73 ${PATCH} ${.TARGET} ${_cwd}/psort.3.patch
75 MISRCS+= psort.c psort_r.c
76 CFLAGS-psort_r-fbsd.c += -DI_AM_PSORT_R
79 CFLAGS-psort_b-fbsd.c += -DI_AM_PSORT_B
80 .endif # FEATURE_BLOCKS
84 .include "Makefile.nbsd_begin"
85 NBSDMISRCS = strfmon.c
86 .include "Makefile.nbsd_end"
88 # 4302056: compile qsort.c and bsearch.c with -fexceptions
89 .for _src in qsort-fbsd.c bsearch-fbsd.c
90 CFLAGS-${_src} += -fexceptions
93 PRIV_INSTHDRS += ${SRCROOT}/stdlib/atexit.h
95 .include "Makefile.obsd_begin"
96 OBSDMISRCS=ecvt.c gcvt.c
97 .include "Makefile.obsd_end"
99 LEGACYSRCS+= getopt.c putenv.c realpath.c setenv.c system.c
100 DARWINEXTSNSRCS += realpath.c
101 CANCELABLESRCS += system.c
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
112 MAN3+= a64l.3 grantpt.3 psort.3
113 MAN3+= strtod_l.3 strtol_l.3
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"
123 .include "Makefile.nbsd_begin"
125 .include "Makefile.nbsd_end"
127 .include "Makefile.obsd_begin"
129 .include "Makefile.obsd_end"
131 MLINKS+= a64l.3 l64a.3
133 .ifdef FEATURE_BLOCKS
134 MLINKS+= atexit.3 atexit_b.3
135 .endif # FEATURE_BLOCKS
137 MLINKS+= atof.3 atof_l.3
139 MLINKS+= atoi.3 atoi_l.3
141 MLINKS+= atol.3 atol_l.3 \
145 .ifdef FEATURE_BLOCKS
146 MLINKS+= bsearch.3 bsearch_b.3
147 .endif # FEATURE_BLOCKS
149 MLINKS+= ecvt.3 fcvt.3 \
152 MLINKS+= exit.3 _Exit.3
154 MLINKS+= getenv.3 putenv.3 \
158 MLINKS+= getopt_long.3 getopt_long_only.3
160 MLINKS+= grantpt.3 posix_openpt.3 \
161 grantpt.3 ptsname.3 \
164 MLINKS+= hcreate.3 hdestroy.3 \
167 MLINKS+= insque.3 remque.3
169 MLINKS+= lsearch.3 lfind.3
171 MLINKS+= psort.3 psort_r.3
172 .ifdef FEATURE_BLOCKS
173 MLINKS+= psort.3 psort_b.3
174 .endif # FEATURE_BLOCKS
176 MLINKS+= qsort.3 heapsort.3 \
177 qsort.3 mergesort.3 \
179 .ifdef FEATURE_BLOCKS
180 MLINKS+= qsort.3 heapsort_b.3 \
181 qsort.3 mergesort_b.3 \
183 .endif # FEATURE_BLOCKS
185 MLINKS+= radixsort.3 sradixsort.3
187 MLINKS+= rand.3 rand_r.3 \
191 MLINKS+= random.3 initstate.3 \
192 random.3 setstate.3 \
194 random.3 srandomdev.3
196 MLINKS+=strfmon.3 strfmon_l.3
198 MLINKS+= strtod.3 strtof.3 \
201 MLINKS+= strtod_l.3 strtof_l.3 \
202 strtod_l.3 strtold_l.3
204 MLINKS+= strtol.3 strtoll.3 \
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
216 MLINKS+= strtoul.3 strtoull.3 \
217 strtoul.3 strtoumax.3 \
220 MLINKS+= tsearch.3 tdelete.3 \