OSDN Git Service

67d32fe5ecb643c6f466763a2502e64239e5464a
[pf3gnuchains/pf3gnuchains4x.git] / newlib / libc / Makefile.am
1 ## Process this file with automake to generate Makefile.in
2
3 AUTOMAKE_OPTIONS = cygnus
4
5 if HAVE_POSIX_DIR
6 POSIX_SUBDIR = posix
7 endif
8
9 if HAVE_SIGNAL_DIR
10 SIGNAL_SUBDIR = signal
11 endif
12
13 if HAVE_SYSCALL_DIR
14 SYSCALLS_SUBDIR = syscalls
15 endif
16
17 if HAVE_UNIX_DIR
18 UNIX_SUBDIR = unix
19 endif
20
21 # The order of SUBDIRS is important for the integrated documentation.
22 # Do not change the order without considering the doc impact.
23 SUBDIRS = argz stdlib ctype stdio string $(SIGNAL_SUBDIR) time locale sys reent \
24         $(extra_dir) errno misc machine $(UNIX_SUBDIR) $(POSIX_SUBDIR) $(SYSCALLS_SUBDIR) .
25
26 noinst_DATA = $(CRT0)
27
28 if USE_LIBTOOL
29 noinst_LTLIBRARIES = libc.la
30 SUBLIBS = \
31         argz/libargz.$(aext) \
32         stdlib/libstdlib.$(aext) \
33         ctype/libctype.$(aext) \
34         stdio/libstdio.$(aext) \
35         string/libstring.$(aext) \
36         $(LIBC_SIGNAL_LIB) \
37         time/libtime.$(aext) \
38         locale/liblocale.$(aext) \
39         $(LIBC_SYS_LIB) \
40         reent/libreent.$(aext) \
41         $(LIBC_EXTRA_LIB) \
42         errno/liberrno.$(aext) \
43         misc/libmisc.$(aext) \
44         $(LIBC_MACHINE_LIB) \
45         $(LIBC_UNIX_LIB) \
46         $(LIBC_POSIX_LIB) \
47         $(LIBC_SYSCALL_LIB)
48 else
49 noinst_LIBRARIES = libc.a
50 SUBLIBS = \
51         argz/lib.$(aext) \
52         stdlib/lib.$(aext) \
53         ctype/lib.$(aext) \
54         stdio/lib.$(aext) \
55         string/lib.$(aext) \
56         $(LIBC_SIGNAL_LIB) \
57         time/lib.$(aext) \
58         locale/lib.$(aext) \
59         $(LIBC_SYS_LIB) \
60         reent/lib.$(aext) \
61         $(LIBC_EXTRA_LIB) \
62         errno/lib.$(aext) \
63         misc/lib.$(aext) \
64         $(LIBC_MACHINE_LIB) \
65         $(LIBC_UNIX_LIB) \
66         $(LIBC_POSIX_LIB) \
67         $(LIBC_SYSCALL_LIB)
68 endif
69
70 libc_la_LDFLAGS = -Xcompiler -nostdlib
71
72 if USE_LIBTOOL
73 libc_la_SOURCES =
74 libc_la_LIBADD = $(SUBLIBS)
75 else
76 libc.a: $(SUBLIBS)
77         rm -f $@
78         rm -rf tmp
79         mkdir tmp
80         cd tmp; \
81          for i in $(SUBLIBS); do \
82            $(AR) x ../$$i; \
83          done; \
84         $(AR) $(AR_FLAGS) ../$@ *.o
85         $(RANLIB) $@
86         rm -rf tmp
87 endif # USE_LIBTOOL
88
89 $(SUBLIBS): ; @true
90
91 crt0.o: sys/crt0.o
92         rm -f $@
93         ln sys/crt0.o $@ >/dev/null 2>/dev/null || cp sys/crt0.o $@
94
95 sys/crt0.o: ; @true
96
97 info_TEXINFOS = libc.texinfo
98
99 # This is a list of the stmp-def files in each subdirectory which
100 # builds .def files.  We don't list subdirectories which don't build
101 # .def files; if the list of subdirectories changes, we must change
102 # this as well.
103 SUBDEFS = \
104         stdlib/stmp-def \
105         ctype/stmp-def \
106         stdio/stmp-def \
107         string/stmp-def \
108         $(LIBC_SIGNAL_DEF) \
109         time/stmp-def \
110         locale/stmp-def \
111         reent/stmp-def \
112         $(LIBC_EXTRA_DEF) \
113         misc/stmp-def
114
115 libc.info: sigset.texi targetdep.tex $(SUBDEFS)
116
117 stmp-sigset: config.status
118         if test -n "$(LIBC_SIGNAL_LIB)"; then \
119           echo "@set SIGNALS" >tmp.texi; \
120         else \
121           echo "@clear SIGNALS" >tmp.texi; \
122         fi
123         $(SHELL) $(newlib_basedir)/../move-if-change tmp.texi sigset.texi
124         touch $@
125
126 sigset.texi: stmp-sigset ; @true
127
128 stmp-targetdep: force
129         rm -f tmp.texi
130         targetdoc=`pwd`/tmp.texi; \
131         for d in $(SUBDIRS); do \
132           if test "$$d" != "."; then \
133             (cd $$d && $(MAKE) TARGETDOC=$${targetdoc} doc) || exit 1; \
134           fi; \
135         done
136         cat $(srcdir)/sys.tex >>tmp.texi
137         $(SHELL) $(newlib_basedir)/../move-if-change tmp.texi targetdep.tex
138         touch $@
139
140 targetdep.tex: stmp-targetdep ; @true
141
142 $(SUBDEFS): stmp-targetdep ; @true
143
144 .PHONY: force
145 force:
146
147 CLEANFILES = $(CRT0) \
148         sigset.texi stmp-sigset tmp.texi targetdep.tex stmp-targetdep
149
150 ACLOCAL_AMFLAGS = -I ..
151 CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host