OSDN Git Service

* doc/install.texi: Document that installed native compiler for
[pf3gnuchains/gcc-fork.git] / libf2c / Makefile.in
1 # Makefile for GNU F77 compiler runtime.
2 #   Copyright (C) 1995-1998 Free Software Foundation, Inc.
3 #   Contributed by Dave Love (d.love@dl.ac.uk).
4 #
5 #This file is part of GNU Fortran.
6 #
7 #GNU Fortran is free software; you can redistribute it and/or modify
8 #it under the terms of the GNU General Public License as published by
9 #the Free Software Foundation; either version 2, or (at your option)
10 #any later version.
11 #
12 #GNU Fortran is distributed in the hope that it will be useful,
13 #but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 #GNU General Public License for more details.
16 #
17 #You should have received a copy of the GNU General Public License
18 #along with GNU Fortran; see the file COPYING.  If not, write to
19 #the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 #02111-1307, USA.
21
22 SHELL = /bin/sh
23 MAKEOVERRIDES=
24
25 #### Start of system configuration section. ####
26
27 srcdir = @srcdir@
28 VPATH = @srcdir@
29 prefix = @prefix@
30 exec_prefix = @exec_prefix@
31 target_alias = @target_alias@
32 gcc_version = @gcc_version@
33 gcc_version_trigger = @gcc_version_trigger@
34
35 top_builddir = .
36
37 libdir = $(exec_prefix)/lib
38 libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
39 #
40 # Versions should start at 0:0:0 - See libtool manual.
41 VERSION_MAJOR=0
42 VERSION_MINOR=0
43 VERSION_SUB=0
44
45 # Multilib support variables.
46 MULTISRCTOP =
47 MULTIBUILDTOP =
48 MULTIDIRS =
49 MULTISUBDIR =
50 MULTIDO = true
51 MULTICLEAN = true
52
53 # Not configured per top-level version, since that doesn't get passed
54 # Versions should start at 0:0:0 - See libtool manual.
55 # down at configure time, but overrridden by the top-level install
56 # target.
57 INSTALL = @INSTALL@
58 INSTALL_PROGRAM = @INSTALL_PROGRAM@
59 INSTALL_DATA = @INSTALL_DATA@
60
61 LIBTOOL = @LIBTOOL@
62 CC = @CC@
63 CFLAGS = @CFLAGS@
64
65 # List of variables to pass to sub-makes.
66 # Quote this way so that it can be used to set shell variables too.
67 FLAGS_TO_PASS= \
68         CC='$(CC)' \
69         LIBTOOL='$(LIBTOOL)' \
70         CFLAGS='$(CFLAGS)' \
71         CPPFLAGS='$(CPPFLAGS)' \
72         AR='$(AR)' \
73         RANLIB='$(RANLIB)' \
74         prefix='$(prefix)' \
75         exec_prefix='$(exec_prefix)' \
76         libdir='$(libdir)' \
77         libsubdir='$(libsubdir)' \
78         tooldir='$(tooldir)'
79
80 LIBG2C_BASE = libg2c
81 LIBG2C = $(LIBG2C_BASE).la
82
83 SUBDIRS = libI77 libF77 libU77
84
85 F2CEXT = abort derf derfc ef1asc ef1cmc erf erfc exit getarg getenv iargc \
86         signal system flush ftell fseek access besj0 besj1 besjn besy0 besy1 \
87         besyn chdir chmod ctime dbesj0 dbesj1 dbesjn dbesy0 dbesy1 dbesyn \
88         dtime etime fdate fgetc fget flush1 fnum fputc fput fstat gerror \
89         getcwd getgid getlog getpid getuid gmtime hostnm idate ierrno irand \
90         isatty itime kill link lnblnk lstat ltime mclock perror rand rename \
91         secnds second sleep srand stat symlnk time ttynam umask unlink \
92         vxttim alarm \
93         date_y2kbuggy date_y2kbug vxtidt_y2kbuggy vxtidt_y2kbug
94
95 .SUFFIXES:
96
97 # The logic here is partly dictated by the desire to keep the lib?77
98 # subdirs for compatibility with the Netlib version and because libU77
99 # has a different copyright; then the libe77 bit (EXTERNALly-callable
100 # versions) is funny.  Given that, as well as keeping things as simple
101 # as possible we want (at least) the following:
102 #  * Allow make to be run at the top level (all-target-libf2c), at this
103 #    level, or the subdirs of this level.  In the latter case we only
104 #    compile, rather than updating libg2c.a;
105 #  * A robust set of dependencies, so that we rebuild (as little as
106 #    possible) if a configuration file, g2c.h or any lib?77/*.c file
107 #    changes;
108 #  * Avoid unnecessary running of ar and ranlib;
109 #  * Expose parallelism where reasonable, but not as a priority.
110
111 # The intended top-level target here does a non-multilib build (via
112 # the dependency) and then (perhaps) builds multilibs.
113
114 all: all-unilib
115         $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="all-unilib"
116
117 # `all-unilib' is the overall target in the absence of multilibs,
118 # meant to be invoked via multi-do for multilibs.
119
120 # Its dependencies can be satisfied in parallel.  The [fiu]77 targets
121 # always invoke sub makes to check dependencies in the subdirs, else we'd
122 # have to maintain them at this level; we live with the overhead of
123 # some recursive makes which may do nothing.
124
125 all-unilib: i77 f77 u77 libE77.la
126         $(MAKE) $(FLAGS_TO_PASS) $(LIBG2C)
127
128 i77 f77 u77: g2c.h
129
130 # This target should normally only get invoked via `all-unilib' --
131 # after all's well in the subdirs -- actually to assemble the library.
132
133 $(LIBG2C): libF77.la libI77.la libU77.la libE77.la
134         rm -f $@ ;\
135         set -e; \
136         $(LIBTOOL) --mode=link $(CC) -o $@ \
137           -version-info $(VERSION_MAJOR):$(VERSION_MINOR):$(VERSION_SUB) \
138           -rpath $(prefix)/lib libE77.la libF77.la libI77.la libU77.la -lc -lm
139
140 i77:
141         cd libI77; $(MAKE) $(FLAGS_TO_PASS) all
142
143 f77:
144         cd libF77; $(MAKE) $(FLAGS_TO_PASS) all
145
146 u77:
147         cd libU77; $(MAKE) $(FLAGS_TO_PASS) all
148
149 libE77.la: f2cext.c
150         rm -f $@
151         if [ -d libE77 ]; then rm -f libE77/*.o libE77/*.lo; else mkdir libE77; fi
152         for name in $(F2CEXT); \
153         do \
154           echo $${name}; \
155           $(LIBTOOL) --mode=compile $(CC) -c -I. -I$(srcdir) -I../../include \
156             $(CPPFLAGS) $(CFLAGS) -DL$${name} $(srcdir)/f2cext.c \
157             -o libE77/L$${name}.o ; \
158           if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
159         done
160         $(LIBTOOL) --mode=link $(CC) -o libE77.la libE77/*.lo
161
162 f2cext.c: g2c.h
163
164 ${srcdir}/configure: configure.in
165         rm -f config.cache
166         cd $(srcdir) && autoconf
167
168 # Dependence on Makefile serializes for parallel make.
169 g2c.h: g2c.hin config.status Makefile
170 # Might try to avoid rebuilding everything if Makefile or configure
171 # changes and g2c.h doesn't; see also the Makefile rule.  Should
172 # depend on another stamp file rather than using the commented-out
173 # lines below, since g2c.h isn't necessarily brought up to date.
174 #       mv g2c.h g2c.x
175         $(SHELL) config.status
176 #       $(SHELL) $(srcdir)/../move-if-change g2c.h g2c.x && mv g2c.x g2c.h
177
178 Makefile: Makefile.in config.status
179 # Autoconf doc uses `./config.status'.  Is there a good reason to use $(SHELL)?
180           $(SHELL) config.status
181
182 config.status: configure $(gcc_version_trigger)
183 # Make sure we don't pick up a site config file and that configure
184 # gets run with correct values of variables such as CC.
185         CONFIG_SITE=no-such-file $(FLAGS_TO_PASS) \
186           $(SHELL) config.status --recheck
187
188 info install-info clean-info dvi TAGS dist installcheck installdirs:
189
190 check:
191         cd libU77; $(MAKE) G77DIR=../../../gcc/ check
192
193 install: all
194         $(LIBTOOL) --mode=install $(INSTALL_DATA) $(LIBG2C) $(libsubdir)/$(MULTISUBDIR)
195         (cd $(libsubdir)/$(MULTISUBDIR) ; mv -f $(LIBG2C_BASE).* $(prefix)/lib)
196         $(INSTALL_DATA) libfrtbegin.a $(libsubdir)/$(MULTISUBDIR)
197         $(RANLIB) $(libsubdir)/$(MULTISUBDIR)/libfrtbegin.a
198         $(INSTALL_DATA) g2c.h $(libsubdir)/include/g2c.h
199         @if [ -f f2c-install-ok -o -f $(srcdir)/f2c-install-ok ]; then \
200           echo ''; \
201           echo 'Warning: g77 no longer installs libf2c.a or f2c.h.'; \
202           echo '         You must do so yourself.  For more information,'; \
203           echo '         read "Distributing Binaries" in the g77 docs.'; \
204           echo '         (To turn off this warning, delete the file'; \
205           echo '         f2c-install-ok in the source or build directory.)'; \
206           echo ''; \
207         else true; fi
208         $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
209         @-$(LIBTOOL) --mode=finish $(prefix)/lib
210
211 install-strip:
212         $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
213
214 uninstall:
215         rm -f $(libsubdir)/$(MULTISUBDIR)/include/g2c.h $(libsubdir)/$(MULTISUBDIR)/$(LIBG2C_BASE).*
216         rm -f $(prefix)/lib/$(LIBG2C_BASE).so*
217         $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
218
219 mostlyclean:
220         rm -f $(LIBG2C) objlist
221         $(MAKE) DO=$@ DODIRS="$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do; \
222         $(MULTICLEAN) multi-clean DO=$@
223         rm -fr libE77 libE77.la
224
225 clean: mostlyclean
226         rm -f config.log
227         $(MAKE) DO=$@ DODIRS="$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do; \
228         $(MULTICLEAN) multi-clean DO=$@
229         rm -rf .libs
230
231 distclean: clean
232         rm -f g2c.h libE77.la
233         $(MAKE) DO=$@ DODIRS="$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do; \
234         $(MULTICLEAN) multi-clean DO=distclean
235         rm -f config.cache config.status Makefile
236
237 maintainer-clean:
238
239 rebuilt: configure
240
241 .PHONY: rebuilt mostlyclean clean distclean maintainer-clean all \
242         i77 f77 u77 check uninstall install-strip dist \
243         installcheck installdirs all-unilib
244
245 subdir_do:
246         @rootpre=`pwd`/; export rootpre; \
247         srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
248         for i in .. $(DODIRS); do \
249           if [ x$$i != x.. ]; then \
250             if [ -f ./$$i/Makefile ]; then \
251               if (cd ./$$i; $(MAKE) $(FLAGS_TO_PASS) $(DO)); then \
252                 true; \
253               else \
254                 exit 1; \
255               fi; \
256             else true; fi; \
257           else true; fi; \
258         done
259
260 # multidoings may be added here by configure.