fixes for host gcc 4.6.1
[zpugcc/jano.git] / toolchain / gcc / newlib / Makefile.am
blobf1539fcbe208dae451e8d32c5715cf239aa19068
1 ## Process this file with automake to generate Makefile.in
3 AUTOMAKE_OPTIONS = cygnus dejagnu
5 # Multilib support variables.
6 MULTISRCTOP =
7 MULTIBUILDTOP =
8 MULTIDIRS =
9 MULTISUBDIR =
10 MULTIDO = true
11 MULTICLEAN = true
13 LIBTOOL_VERSION_INFO = 0:0:0
15 if NEWLIB_HW_FP
16 MATHDIR = mathfp
17 else
18 MATHDIR = math
19 endif
21 # Work around what appears to be a GNU make bug handling MAKEFLAGS
22 # values defined in terms of make variables, as is the case for CC and
23 # friends when we are called from the top level Makefile.
24 AM_MAKEFLAGS = \
25         "AR_FLAGS=$(AR_FLAGS)" \
26         "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
27         "CFLAGS=$(CFLAGS)" \
28         "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
29         "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
30         "LDFLAGS=$(LDFLAGS)" \
31         "LIBCFLAGS=$(LIBCFLAGS)" \
32         "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
33         "MAKE=$(MAKE)" \
34         "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
35         "PICFLAG=$(PICFLAG)" \
36         "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
37         "SHELL=$(SHELL)" \
38         "EXPECT=$(EXPECT)" \
39         "RUNTEST=$(RUNTEST)" \
40         "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
41         "exec_prefix=$(exec_prefix)" \
42         "infodir=$(infodir)" \
43         "libdir=$(libdir)" \
44         "prefix=$(prefix)" \
45         "tooldir=$(tooldir)" \
46         "top_toollibdir=$(toollibdir)" \
47         "AR=$(AR)" \
48         "AS=$(AS)" \
49         "CC=$(CC_FOR_NEWLIB)" \
50         "LD=$(LD)" \
51         "LIBCFLAGS=$(LIBCFLAGS)" \
52         "NM=$(NM)" \
53         "PICFLAG=$(PICFLAG)" \
54         "RANLIB=$(RANLIB)" \
55         "DESTDIR=$(DESTDIR)"
57 FLAGS_TO_PASS=$(AM_MAKEFLAGS)
59 if HAVE_DOC
60 DOCDIR = doc
61 else
62 DOCDIR =
63 endif
65 SUBDIRS = libc libm \
66         $(DOCDIR) . $(EXTRA_DIRS)
68 tooldir = $(exec_prefix)/$(host_alias)
69 toollibdir = $(tooldir)/lib$(MULTISUBDIR)
71 AR_FLAGS = rc
73 if USE_LIBTOOL
74 toollib_LTLIBRARIES = libm.la \
75         libc.la
76 else
77 toollib_LIBRARIES = libm.a \
78         libc.a
79 endif
81 noinst_DATA = stmp-targ-include
83 toollib_DATA = $(CRT0) $(CRT1)
86 # The functions ldexp, frexp and modf are traditionally supplied in
87 # both libc.a and libm.a.  We build them in libm.a and copy them over,
88 # along with some required supporting routines.
89 MATHOBJS_IN_LIBC = \
90         s_isinf.$(oext) sf_isinf.$(oext) \
91         s_isnan.$(oext) sf_isnan.$(oext) \
92         s_ldexp.$(oext) sf_ldexp.$(oext) \
93         s_frexp.$(oext) sf_frexp.$(oext) \
94         s_modf.$(oext) \
95         sf_modf.$(oext) s_scalbn.$(oext) \
96         sf_scalbn.$(oext) \
97         s_finite.$(oext) sf_finite.$(oext) \
98         s_copysign.$(oext) sf_copysign.$(oext) \
99         s_infconst.$(oext)
101 LIBC_OBJECTLISTS = \
102         $(POSIX_OBJECTLIST) \
103         $(SIGNAL_OBJECTLIST) \
104         $(SYSCALL_OBJECTLIST) \
105         $(UNIX_OBJECTLIST) \
106         $(STDIO64_OBJECTLIST) \
107         libc/argz/objectlist.awk.in \
108         libc/stdlib/objectlist.awk.in \
109         libc/time/objectlist.awk.in \
110         libc/ctype/objectlist.awk.in \
111         libc/search/objectlist.awk.in \
112         libc/string/objectlist.awk.in \
113         libc/locale/objectlist.awk.in \
114         libc/misc/objectlist.awk.in \
115         libc/reent/objectlist.awk.in \
116         libc/errno/objectlist.awk.in \
117         libc/stdio/objectlist.awk.in \
118         $(MACHINE_OBJECTLIST) \
119         $(SYS_OBJECTLIST) \
120         $(SYS_MACH_OBJECTLIST)
122 LIBM_OBJECTLISTS = \
123         libm/$(MATHDIR)/objectlist.awk.in \
124         libm/common/objectlist.awk.in \
125         $(LIBM_MACHINE_OBJECTLIST)
127 libm_la_LDFLAGS = -version-info $(LIBTOOL_VERSION_INFO) -release newlib -no-undefined -Xcompiler -nostdlib -Xlinker --version-script=$(srcdir)/libc/sys/linux/shared.ld -objectlist libm-libtool-objectlist
129 libc_la_LDFLAGS = -version-info $(LIBTOOL_VERSION_INFO) -release newlib -no-undefined -Xcompiler -nostdlib -Xlinker --version-script=$(srcdir)/libc/sys/linux/shared.ld -objectlist libc-libtool-objectlist
131 if USE_LIBTOOL
132 libm_la_SOURCES =
133 libm_la_DEPENDENCIES = libm-libtool-objectlist
135 # objects listed later in LIBM_OBJECTLISTS will override those listed earlier
136 libm-libtool-objectlist: $(LIBM_OBJECTLISTS)
137         cat $(LIBM_OBJECTLISTS) | $(AWK) '{ libm[$$1] = $$2 }; END { for (x in libm) printf ("%s\n", libm[x]) }' > $@
139 libc_la_SOURCES =
140 libc_la_DEPENDENCIES = libc-libtool-objectlist
142 # objects listed later in LIBM_OBJECTLISTS and LIBC_OBJECTLISTS will override those listed earlier
143 libc-libtool-objectlist: $(LIBM_OBJECTLISTS) $(LIBC_OBJECTLISTS)
144         cat $(LIBM_OBJECTLISTS) $(LIBC_OBJECTLISTS) |  $(AWK) '{ libc[$$1] = $$2 }; END { for (x in libc) printf ("%s\n", libc[x]) }' > $@
146 else
148 libc.a: libc/libc.a libm.a
149         rm -rf libc.a libg.a tmp
150         mkdir tmp
151         cd tmp; \
152          $(AR) x ../libm.a $(MATHOBJS_IN_LIBC) ; \
153          $(AR) x ../libc/libc.a ; \
154          $(AR) $(AR_FLAGS) ../$@ *.o
155         $(RANLIB) libc.a
156         ln libc.a libg.a >/dev/null 2>/dev/null || cp libc.a libg.a
157         rm -rf tmp
159 libc/libc.a: ; @true
161 libm.a: libm/libm.a
162         rm -f $@
163         ln libm/libm.a $@ >/dev/null 2>/dev/null || cp libm/libm.a $@
165 libm/libm.a: ; @true
167 endif # USE_LIBTOOL
169 crt0.o: $(CRT0_DIR)$(CRT0)
170         rm -f $@
171         ln $(CRT0_DIR)$(CRT0) $@ >/dev/null 2>/dev/null \
172          || cp $(CRT0_DIR)$(CRT0) $@
174 $(CRT0_DIR)$(CRT0): ; @true
176 crt1.o: $(CRT1_DIR)$(CRT1)
177         rm -f $@
178         ln $(CRT0_DIR)$(CRT0) $@ >/dev/null 2>/dev/null \
179          || cp $(CRT0_DIR)$(CRT0) $@
181 $(CRT1_DIR)$(CRT1): ; @true
184 all-recursive: stmp-targ-include
186 # The targ-include directory just holds the includes files for the
187 # particular system and machine we have been configured for.  It is
188 # used while building.
189 stmp-targ-include: config.status
190         -rm -rf targ-include stmp-targ-include
191         mkdir targ-include targ-include/sys targ-include/machine
192         cp newlib.h targ-include/newlib.h
193         -for i in $(srcdir)/libc/machine/$(machine_dir)/machine/*.h; do \
194             if [ -f $$i ]; then \
195               cp $$i targ-include/machine/`basename $$i`; \
196             else true; fi ; \
197           done
198         -for i in $(srcdir)/libc/sys/$(sys_dir)/include/*.h; do \
199             if [ -f $$i ]; then \
200               cp $$i targ-include/`basename $$i`; \
201             else true; fi ; \
202           done
203         -for i in $(srcdir)/libc/sys/$(sys_dir)/sys/*.h; do \
204             if [ -f $$i ]; then \
205               cp $$i targ-include/sys/`basename $$i`; \
206             else true; fi ; \
207           done
208         -for i in $(srcdir)/libc/sys/$(sys_dir)/machine/*.h; do \
209             if [ -f $$i ]; then \
210               cp $$i targ-include/machine/`basename $$i`; \
211             else true; fi ; \
212           done
213         -for i in $(srcdir)/libc/sys/$(sys_dir)/machine/$(machine_dir)/*.h; do \
214             if [ -f $$i ]; then \
215               cp $$i targ-include/machine/`basename $$i`; \
216             else true; fi ; \
217           done
218         -for i in $(srcdir)/libc/sys/$(sys_dir)/machine/$(machine_dir)/include/*.h; do \
219             if [ -f $$i ]; then \
220               cp $$i targ-include/machine/`basename $$i`; \
221             else true; fi ; \
222           done
223         touch $@
225 CLEANFILES = targ-include stmp-targ-include
227 install-data-local:     install-toollibLIBRARIES
228 if USE_LIBTOOL
229 else
230         rm -f $(DESTDIR)$(toollibdir)/libg.a
231         ln $(DESTDIR)$(toollibdir)/libc.a $(DESTDIR)$(toollibdir)/libg.a >/dev/null 2>/dev/null || cp $(DESTDIR)$(toollibdir)/libc.a $(DESTDIR)$(toollibdir)/libg.a
232 endif
233         $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do # $(MAKE)
234         -if [ -z "$(MULTISUBDIR)" ]; then \
235           $(mkinstalldirs) $(DESTDIR)$(tooldir)/include; \
236           for i in $(srcdir)/libc/include/*.h; do \
237            $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/`basename $$i`; \
238           done; \
239           $(INSTALL_DATA) newlib.h $(DESTDIR)$(tooldir)/include/newlib.h; \
240           $(mkinstalldirs) $(DESTDIR)$(tooldir)/include/machine; \
241           for i in $(srcdir)/libc/include/machine/*.h; do \
242            $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/machine/`basename $$i`; \
243           done; \
244           for i in $(srcdir)/libc/machine/$(machine_dir)/machine/*.h; do \
245             if [ -f $$i ]; then \
246              $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/machine/`basename $$i`; \
247             else true; fi ; \
248           done; \
249           $(mkinstalldirs) $(DESTDIR)$(tooldir)/include/sys; \
250           for i in $(srcdir)/libc/include/sys/*.h; do \
251            $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/sys/`basename $$i`; \
252           done; \
253           for i in $(srcdir)/libc/sys/$(sys_dir)/sys/*.h; do \
254             if [ -f $$i ]; then \
255              $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/sys/`basename $$i`; \
256             else true; fi ; \
257           done ; \
258           for i in $(srcdir)/libc/sys/$(sys_dir)/machine/*.h; do \
259             if [ -f $$i ]; then \
260              $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/machine/`basename $$i`; \
261             else true; fi ; \
262           done ; \
263           for i in $(srcdir)/libc/sys/$(sys_dir)/include/*.h; do \
264             if [ -f $$i ]; then \
265              $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/`basename $$i`; \
266             else true; fi ; \
267           done ; \
268           for i in $(srcdir)/libc/sys/$(sys_dir)/machine/$(machine_dir)/include/*.h; do \
269             if [ -f $$i ]; then \
270              $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/machine/`basename $$i`; \
271             else true; fi ; \
272           done ; \
273         else true; fi
275 # Force makedoc to be built before building info files.
276 info-recursive: doc/makedoc
277 dvi-recursive: doc/makedoc
278 doc/makedoc:
279         cd doc && $(MAKE) all
281 CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
283 # Multilib support.
284 .PHONY: all-multi check-multi mostlyclean-multi clean-multi distclean-multi \
285         maintainer-clean-multi
287 all-recursive: all-multi
288 check-recursive: check-multi
289 mostlyclean-recursive: mostlyclean-multi
290 clean-recursive: clean-multi
291 distclean-recursive: distclean-multi
292 maintainer-clean-recursive: maintainer-clean-multi
294 # The $(MAKE) comments below are to enable parallel building.
295 all-multi:
296         $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do # $(MAKE)
297 check-multi:
298         $(MULTIDO) $(AM_MAKEFLAGS) DO=check multi-do # $(MAKE)
299 mostlyclean-multi:
300         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean # $(MAKE)
301 clean-multi:
302         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean # $(MAKE)
303 distclean-multi:
304         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean # $(MAKE)
305 maintainer-clean-multi:
306         $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean # $(MAKE)
308 MAKEOVERRIDES=
310 # dejagnu support
312 RUNTESTFLAGS=
314 site.exp: Makefile
315         @echo 'Making a new site.exp file...'
316         @test ! -f site.bak || rm -f site.bak
317         @echo '## these variables are automatically generated by make ##' > $@-t
318         @echo '# Do not edit here.  If you wish to override these values' >> $@-t
319         @echo '# edit the last section' >> $@-t
320         @echo 'set tool $(DEJATOOL)' >> $@-t
321         @echo 'set tool_version $(VERSION)' >> $@-t
322         @echo 'set srcdir $(srcdir)/testsuite' >> $@-t
323         @echo 'set objdir' `pwd` >> $@-t
324         @echo 'set multibuildtop ./$(MULTIBUILDTOP)' >> $@-t
325         @echo 'set host_alias $(build_alias)' >> $@-t
326         @echo 'set host_triplet $(build_triplet)' >> $@-t
327         @echo 'set target_alias $(host_alias)' >> $@-t
328         @echo 'set target_triplet $(host_triplet)' >> $@-t
329         @echo '## All variables above are generated by configure. Do Not Edit ##' >> $@-t
330         @test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' site.exp >> $@-t
331         @test ! -f site.exp || mv site.exp site.bak
332         @mv $@-t site.exp
334 check-DEJAGNU: site.exp
335         @if [ -d testsuite ] ; then \
336           true ; \
337         else \
338           mkdir testsuite ; \
339         fi
340         @rm -f testsuite/site.exp
341         @cp site.exp testsuite/site.exp
342         @rootme=`pwd` ; \
343         export rootme ; \
344         srcdir=`cd ${srcdir}; pwd` ; \
345         export srcdir ; \
346         EXPECT=`if [ -f $${rootme}/${MULTIBUILDTOP}../../expect/expect ] ; then \
347                   echo $${rootme}/${MULTIBUILDTOP}../../expect/expect ; \
348                 else \
349                   echo expect ; \
350                 fi` ; \
351         export EXPECT ; \
352         echo "Found expect: $${EXPECT}" ; \
353         if [ -f $(top_builddir)/$(MULTIBUILDTOP)../../expect/expect ] ; then \
354           TCL_LIBRARY=`cd $(top_srcdir)/../tcl/library && pwd` ; \
355           export TCL_LIBRARY ; \
356           echo "Found TCL library directory: $${TCL_LIBRARY}" ; \
357         fi ; \
358         RUNTEST=`if [ -f $${srcdir}/../dejagnu/runtest ] ; then \
359                    echo $${srcdir}/../dejagnu/runtest ; \
360                  else \
361                    echo runtest ; \
362                  fi` ; \
363         export RUNTEST ; \
364         echo "Found runtest: $${RUNTEST}" ; \
365         cd testsuite ; \
366         if $(SHELL) -c "$$RUNTEST --version" > /dev/null 2>&1 ; then \
367            $$RUNTEST --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite $(RUNTESTFLAGS) ; \
368            : ; \
369         else \
370            echo "WARNING: could not find \`runtest'" 1>&2 ; \
371         fi