fixed more binutils issues (newer gcc/libc)
[zpugcc/jano.git] / toolchain / gcc / newlib / libc / Makefile.am
blob9b6183467ce5a85de01ec8d37c39fe2554068257
1 ## Process this file with automake to generate Makefile.in
3 AUTOMAKE_OPTIONS = cygnus
5 if HAVE_POSIX_DIR
6 POSIX_SUBDIR = posix
7 endif
9 if HAVE_SIGNAL_DIR
10 SIGNAL_SUBDIR = signal
11 endif
13 if HAVE_SYSCALL_DIR
14 SYSCALLS_SUBDIR = syscalls
15 endif
17 if HAVE_UNIX_DIR
18 UNIX_SUBDIR = unix
19 endif
21 if HAVE_STDIO64_DIR
22 STDIO64_SUBDIR = stdio64
23 endif
25 if ENABLE_NEWLIB_ICONV
26 NEWLIB_ICONV_DIRS = iconv
27 NEWLIB_ICONV_LIBS = iconv/ces/lib.$(aext) iconv/ccs/lib.$(aext) iconv/lib/lib.$(aext)
28 else
29 NEWLIB_ICONV_DIRS =
30 NEWLIB_ICONV_LIBS =
31 endif
33 # The order of SUBDIRS is important for the integrated documentation.
34 # Do not change the order without considering the doc impact.
35 SUBDIRS = argz stdlib ctype search stdio $(STDIO64_SUBDIR) string $(SIGNAL_SUBDIR) time locale sys reent \
36         $(extra_dir) errno misc machine $(UNIX_SUBDIR) $(POSIX_SUBDIR) $(SYSCALLS_SUBDIR) $(NEWLIB_ICONV_DIRS) .
38 noinst_DATA = $(CRT0)
40 if USE_LIBTOOL
41 noinst_LTLIBRARIES = libc.la
42 SUBLIBS = \
43         argz/libargz.$(aext) \
44         stdlib/libstdlib.$(aext) \
45         ctype/libctype.$(aext) \
46         search/libsearch.$(aext) \
47         stdio/libstdio.$(aext) \
48         $(LIBC_STDIO64_LIB) \
49         string/libstring.$(aext) \
50         $(LIBC_SIGNAL_LIB) \
51         time/libtime.$(aext) \
52         locale/liblocale.$(aext) \
53         $(LIBC_SYS_LIB) \
54         reent/libreent.$(aext) \
55         $(LIBC_EXTRA_LIB) \
56         errno/liberrno.$(aext) \
57         misc/libmisc.$(aext) \
58         $(LIBC_MACHINE_LIB) \
59         $(LIBC_UNIX_LIB) \
60         $(LIBC_POSIX_LIB) \
61         $(LIBC_SYSCALL_LIB)
62 else
63 noinst_LIBRARIES = libc.a
64 SUBLIBS = \
65         argz/lib.$(aext) \
66         stdlib/lib.$(aext) \
67         ctype/lib.$(aext) \
68         search/lib.$(aext) \
69         stdio/lib.$(aext) \
70         $(LIBC_STDIO64_LIB) \
71         string/lib.$(aext) \
72         $(LIBC_SIGNAL_LIB) \
73         time/lib.$(aext) \
74         locale/lib.$(aext) \
75         $(LIBC_SYS_LIB) \
76         reent/lib.$(aext) \
77         $(LIBC_EXTRA_LIB) \
78         errno/lib.$(aext) \
79         misc/lib.$(aext) \
80         $(LIBC_MACHINE_LIB) \
81         $(LIBC_UNIX_LIB) \
82         $(LIBC_POSIX_LIB) \
83         $(LIBC_SYSCALL_LIB) \
84         $(NEWLIB_ICONV_LIBS)
85 endif
87 libc_la_LDFLAGS = -Xcompiler -nostdlib
89 if USE_LIBTOOL
90 libc_la_SOURCES =
91 libc_la_LIBADD = $(SUBLIBS)
92 libc_la_DEPENDENCIES = $(SUBLIBS)
93 else
94 libc.a: $(SUBLIBS)
95         rm -f $@
96         rm -rf tmp
97         mkdir tmp
98         cd tmp; \
99          for i in $(SUBLIBS); do \
100            $(AR) x ../$$i; \
101          done; \
102         $(AR) $(AR_FLAGS) ../$@ *.o
103         $(RANLIB) $@
104         rm -rf tmp
105 endif # USE_LIBTOOL
107 $(SUBLIBS): ; @true
109 crt0.o: sys/crt0.o
110         rm -f $@
111         ln sys/crt0.o $@ >/dev/null 2>/dev/null || cp sys/crt0.o $@
113 sys/crt0.o: ; @true
115 info_TEXINFOS = libc.texinfo
117 # This is a list of the stmp-def files in each subdirectory which
118 # builds .def files.  We don't list subdirectories which don't build
119 # .def files; if the list of subdirectories changes, we must change
120 # this as well.
121 SUBDEFS = \
122         stdlib/stmp-def \
123         ctype/stmp-def \
124         stdio/stmp-def \
125         $(LIBC_STDIO64_DEF) \
126         string/stmp-def \
127         $(LIBC_SIGNAL_DEF) \
128         time/stmp-def \
129         locale/stmp-def \
130         reent/stmp-def \
131         $(LIBC_EXTRA_DEF) \
132         misc/stmp-def
134 libc.info: sigset.texi extra.texi stdio64.texi iconvset.texi \
135         targetdep.tex $(SUBDEFS)
137 stmp-sigset: config.status
138         if test -n "$(LIBC_SIGNAL_LIB)"; then \
139           echo "@set SIGNALS" >tmp.texi; \
140         else \
141           echo "@clear SIGNALS" >tmp.texi; \
142         fi
143         $(SHELL) $(newlib_basedir)/../move-if-change tmp.texi sigset.texi
144         touch $@
146 sigset.texi: stmp-sigset ; @true
148 stmp-iconvset: config.status
149         if test -n "$(NEWLIB_ICONV_LIBS)"; then \
150           echo "@set ICONV" >tmp.texi; \
151         else \
152           echo "@clear ICONV" >tmp.texi; \
153         fi
154         $(SHELL) $(newlib_basedir)/../move-if-change tmp.texi iconvset.texi
155         touch $@
157 iconvset.texi: stmp-iconvset ; @true
159 stmp-extra: config.status
160         if test -n "$(LIBC_EXTRA_LIB)"; then \
161           echo "@set EXTRA" >tmp.texi; \
162         else \
163           echo "@clear EXTRA" >tmp.texi; \
164         fi
165         $(SHELL) $(newlib_basedir)/../move-if-change tmp.texi extra.texi
166         touch $@
168 extra.texi: stmp-extra ; @true
170 stmp-stdio64: config.status
171         if test -n "$(LIBC_STDIO64_LIB)"; then \
172           echo "@set STDIO64" >tmp.texi; \
173         else \
174           echo "@clear STDIO64" >tmp.texi; \
175         fi
176         $(SHELL) $(newlib_basedir)/../move-if-change tmp.texi stdio64.texi
177         touch $@
179 stdio64.texi: stmp-stdio64 ; @true
181 stmp-targetdep: force
182         rm -f tmp.texi
183         targetdoc=`pwd`/tmp.texi; \
184         for d in $(SUBDIRS); do \
185           if test "$$d" != "."; then \
186             (cd $$d && $(MAKE) TARGETDOC=$${targetdoc} doc) || exit 1; \
187           fi; \
188         done
189         cat $(srcdir)/sys.tex >>tmp.texi
190         $(SHELL) $(newlib_basedir)/../move-if-change tmp.texi targetdep.tex
191         touch $@
193 targetdep.tex: stmp-targetdep ; @true
195 $(SUBDEFS): stmp-targetdep ; @true
197 .PHONY: force
198 force:
200 CLEANFILES = $(CRT0) \
201         sigset.texi stmp-sigset extra.texi stmp-extra \
202         stdio64.texi stmp-stdio64 tmp.texi targetdep.tex stmp-targetdep
204 ACLOCAL_AMFLAGS = -I ..
205 CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host