OSDN Git Service

202e25df2ffa3f6415036712792c03082b509a96
[uclinux-h8/uclibc-ng.git] / libc / stdlib / Makefile.in
1 # Makefile for uClibc
2 #
3 # Copyright (C) 2000 by Lineo, inc.
4 # Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
5 #
6 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
7 #
8
9 include $(top_srcdir)libc/stdlib/malloc/Makefile.in
10 include $(top_srcdir)libc/stdlib/malloc-simple/Makefile.in
11 include $(top_srcdir)libc/stdlib/malloc-standard/Makefile.in
12
13 CSRC := \
14         abort.c getenv.c mkdtemp.c mktemp.c realpath.c mkstemp.c \
15         rand.c random.c random_r.c setenv.c system.c div.c ldiv.c lldiv.c \
16         getpt.c ptsname.c grantpt.c unlockpt.c gcvt.c drand48-iter.c jrand48.c \
17         jrand48_r.c lrand48.c lrand48_r.c mrand48.c mrand48_r.c nrand48.c \
18         nrand48_r.c rand_r.c srand48.c srand48_r.c seed48.c seed48_r.c \
19         valloc.c posix_memalign.c a64l.c l64a.c
20 ifeq ($(UCLIBC_HAS_ARC4RANDOM),y)
21 CSRC += arc4random.c
22 endif
23 ifeq ($(UCLIBC_HAS_LFS),y)
24 CSRC += mkstemp64.c
25 endif
26 ifeq ($(UCLIBC_HAS_FLOATS),y)
27 CSRC += drand48.c drand48_r.c erand48.c erand48_r.c
28 endif
29
30 # multi source stdlib.c
31 CSRC += abs.c labs.c atoi.c atol.c strtol.c strtoul.c _stdlib_strto_l.c \
32         qsort.c bsearch.c \
33         llabs.c atoll.c strtoll.c strtoull.c _stdlib_strto_ll.c
34 # (aliases) strtoq.o strtouq.o
35 ifeq ($(UCLIBC_HAS_FLOATS),y)
36 CSRC += atof.c
37 endif
38 ifeq ($(UCLIBC_HAS_XLOCALE),y)
39 CSRC += strtol_l.c strtoul_l.c _stdlib_strto_l_l.c \
40         strtoll_l.c strtoull_l.c _stdlib_strto_ll_l.c
41 endif
42 ifeq ($(UCLIBC_HAS_WCHAR),y)
43 CSRC += mblen.c mbtowc.c wctomb.c mbstowcs.c wcstombs.c \
44         _stdlib_mb_cur_max.c _stdlib_wcsto_l.c _stdlib_wcsto_ll.c \
45         wcstol.c wcstoul.c wcstoll.c wcstoull.c
46 ifeq ($(UCLIBC_HAS_XLOCALE),y)
47 CSRC +=_stdlib_wcsto_l_l.c _stdlib_wcsto_ll_l.c \
48         wcstol_l.c wcstoul_l.c wcstoll_l.c wcstoull_l.c
49 endif
50 endif
51
52 # multi source _strtod.c
53 ifeq ($(UCLIBC_HAS_FLOATS),y)
54 CSRC += strtod.c strtof.c strtold.c __strtofpmax.c __fp_range_check.c
55 ifeq ($(UCLIBC_HAS_XLOCALE),y)
56 CSRC += strtod_l.c strtof_l.c strtold_l.c __strtofpmax_l.c
57 endif
58 ifeq ($(UCLIBC_HAS_WCHAR),y)
59 CSRC += wcstod.c wcstof.c wcstold.c __wcstofpmax.c
60 ifeq ($(UCLIBC_HAS_XLOCALE),y)
61 CSRC += wcstod_l.c wcstof_l.c wcstold_l.c __wcstofpmax_l.c
62 endif
63 endif
64 endif
65 # (aliases) wcstoq.o wcstouq.o
66 # wcstod wcstof wcstold
67
68 # multi source _atexit.c
69 CSRC += __cxa_atexit.c __cxa_finalize.c __exit_handler.c exit.c on_exit.c
70 ifeq ($(COMPAT_ATEXIT),y)
71 CSRC += old_atexit.c
72 endif
73
74 STDLIB_DIR := $(top_srcdir)libc/stdlib
75 STDLIB_OUT := $(top_builddir)libc/stdlib
76
77 STDLIB_SRC := $(patsubst %.c,$(STDLIB_DIR)/%.c,$(CSRC))
78 STDLIB_OBJ := $(patsubst %.c,$(STDLIB_OUT)/%.o,$(CSRC))
79
80 libc-y += $(STDLIB_OBJ)
81 libc-static-y += $(STDLIB_OUT)/atexit.o
82 # this should always be the PIC version, because it could be used in shared libs
83 libc-nonshared-y += $(STDLIB_OUT)/atexit.os
84
85 libc-nomulti-y += $(STDLIB_OUT)/labs.o $(STDLIB_OUT)/atol.o $(STDLIB_OUT)/_stdlib_strto_l.o $(STDLIB_OUT)/_stdlib_strto_ll.o
86 libc-nomulti-$(UCLIBC_HAS_XLOCALE) += $(STDLIB_OUT)/_stdlib_strto_l_l.o $(STDLIB_OUT)/_stdlib_strto_ll_l.o
87
88 objclean-y += stdlib_objclean
89
90 stdlib_objclean:
91         $(RM) $(STDLIB_OUT)/*.{o,os,oS}