OSDN Git Service

Make selection of uClibc floating point support in printf, etc. seperate
[uclinux-h8/uClibc.git] / libc / stdlib / Makefile
1 # Makefile for uClibc
2 #
3 # Copyright (C) 2000 by Lineo, inc.
4 #
5 # This program is free software; you can redistribute it and/or modify it under
6 # the terms of the GNU Library General Public License as published by the Free
7 # Software Foundation; either version 2 of the License, or (at your option) any
8 # later version.
9 #
10 # This program is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 # FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
13 # details.
14 #
15 # You should have received a copy of the GNU Library General Public License
16 # along with this program; if not, write to the Free Software Foundation, Inc.,
17 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 #
19 # Derived in part from the Linux-8086 C library, the GNU C Library, and several
20 # other sundry sources.  Files within this library are copyright by their
21 # respective copyright holders.
22
23 TOPDIR=../../
24 include $(TOPDIR)Rules.mak
25
26 DIRS = $(MALLOC)
27 ALL_SUBDIRS = malloc malloc-930716 malloc-simple
28
29 MSRC=strto_l.c
30 MOBJ=strtol.o strtoul.o strto_l.o
31
32 MSRC1=strto_ll.c
33 MOBJ1=strtoll.o strtoull.o strto_ll.o
34
35 MSRC2=atexit.c
36 MOBJ2=atexit.o exit.o
37
38
39 CSRC =  abort.c getenv.c mktemp.c qsort.c realpath.c abs.c bsearch.c \
40         mkstemp.c putenv.c rand.c random.c setenv.c system.c div.c ldiv.c \
41         getpt.c ptsname.c grantpt.c unlockpt.c
42 ifeq ($(HAS_FLOATING_POINT),true)
43         CSRC += strtod.c
44 endif
45 COBJS=$(patsubst %.c,%.o, $(CSRC))
46
47
48 OBJS=$(MOBJ) $(MOBJ2) $(COBJS)
49 ifeq ($(HAS_LONG_LONG),true)
50         OBJS += $(MOBJ1)
51 endif
52
53 all: $(OBJS) $(LIBC)
54
55 $(LIBC): ar-target subdirs
56
57 ar-target: $(OBJS)
58         $(AR) $(ARFLAGS) $(LIBC) $(OBJS)
59
60 $(MOBJ): $(MSRC)
61         $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
62         $(STRIPTOOL) -x -R .note -R .comment $*.o
63
64 $(MOBJ1): $(MSRC1)
65         $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
66         $(STRIPTOOL) -x -R .note -R .comment $*.o
67
68 $(MOBJ2): $(MSRC2)
69         $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
70         $(STRIPTOOL) -x -R .note -R .comment $*.o
71
72 $(COBJS): %.o : %.c
73         $(CC) $(CFLAGS) -c $< -o $@
74         $(STRIPTOOL) -x -R .note -R .comment $*.o
75
76 $(OBJ): Makefile
77
78 subdirs: $(patsubst %, _dir_%, $(DIRS))
79 subdirs_clean: $(patsubst %, _dirclean_%, $(ALL_SUBDIRS))
80
81 $(patsubst %, _dir_%, $(DIRS)) : dummy
82         $(MAKE) -C $(patsubst _dir_%, %, $@)
83
84 $(patsubst %, _dirclean_%, $(ALL_SUBDIRS)) : dummy
85         $(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
86
87 clean: subdirs_clean
88         rm -f *.[oa] *~ core
89
90 .PHONY: dummy
91
92