Daily bump.
[official-gcc.git] / libf2c / Makefile.in
blobef42e39d1a7f076fd3cdd8f16140e7957081c219
1 # Makefile for GNU F77 compiler runtime.
2 # Copyright (C) 1995-1998, 2001, 2002 Free Software Foundation, Inc.
3 # Contributed by Dave Love (d.love@dl.ac.uk).
5 #This file is part of GNU Fortran.
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.
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.
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.
22 SHELL = /bin/sh
23 MAKEOVERRIDES=
24 .NOEXPORTS:
26 #### Start of system configuration section. ####
28 srcdir = @glibcpp_srcdir@
29 VPATH = @glibcpp_srcdir@
30 prefix = @prefix@
31 exec_prefix = @exec_prefix@
32 target_alias = @target_alias@
33 gcc_version = @gcc_version@
34 gcc_version_trigger = @gcc_version_trigger@
35 top_srcdir = @top_srcdir@
36 toplevel_srcdir = @toplevel_srcdir@
37 toolexecdir = @glibcpp_toolexecdir@
38 glibcpp_toolexecdir = @glibcpp_toolexecdir@
39 glibcpp_toolexeclibdir = @glibcpp_toolexeclibdir@
41 top_builddir = .
43 libdir = $(exec_prefix)/lib
44 libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
46 # Versions should start at 0:0:0 - See libtool manual.
47 VERSION_MAJOR=0
48 VERSION_MINOR=0
49 VERSION_SUB=0
51 # Multilib support variables.
52 MULTISRCTOP =
53 MULTIBUILDTOP =
54 MULTIDIRS =
55 MULTISUBDIR =
56 MULTIDO = true
57 MULTICLEAN = true
59 # Not configured per top-level version, since that doesn't get passed
60 # Versions should start at 0:0:0 - See libtool manual.
61 # down at configure time, but overrridden by the top-level install
62 # target.
63 INSTALL = @INSTALL@
64 INSTALL_PROGRAM = @INSTALL_PROGRAM@
65 INSTALL_DATA = @INSTALL_DATA@
67 LIBTOOL = @LIBTOOL@
68 CC = @CC@
69 CFLAGS = @CFLAGS@
70 AR = @AR@
71 RANLIB = @RANLIB@
73 # List of variables to pass to sub-makes.
74 # Quote this way so that it can be used to set shell variables too.
75 FLAGS_TO_PASS= \
76 CC='$(CC)' \
77 LD='$(LD)' \
78 LIBTOOL='$(LIBTOOL)' \
79 CFLAGS='$(CFLAGS)' \
80 CPPFLAGS='$(CPPFLAGS)' \
81 AR='$(AR)' \
82 RANLIB='$(RANLIB)' \
83 prefix='$(prefix)' \
84 exec_prefix='$(exec_prefix)' \
85 libdir='$(libdir)' \
86 libsubdir='$(libsubdir)' \
87 tooldir='$(tooldir)'
89 LIBG2C_BASE = libg2c
90 LIBG2C = $(LIBG2C_BASE).la
92 SUBDIRS = libI77 libF77 libU77
94 F2CEXT = abort derf derfc ef1asc ef1cmc erf erfc exit getarg getenv iargc \
95 signal system flush ftell fseek access besj0 besj1 besjn besy0 besy1 \
96 besyn chdir chmod ctime dbesj0 dbesj1 dbesjn dbesy0 dbesy1 dbesyn \
97 dtime etime fdate fgetc fget flush1 fnum fputc fput fstat gerror \
98 getcwd getgid getlog getpid getuid gmtime hostnm idate ierrno irand \
99 isatty itime kill link lnblnk lstat ltime mclock perror rand rename \
100 secnds second sleep srand stat symlnk time ttynam umask unlink \
101 vxttim alarm \
102 date_y2kbuggy date_y2kbug vxtidt_y2kbuggy vxtidt_y2kbug
104 .SUFFIXES:
106 # The logic here is partly dictated by the desire to keep the lib?77
107 # subdirs for compatibility with the Netlib version and because libU77
108 # has a different copyright; then the libe77 bit (EXTERNALly-callable
109 # versions) is funny. Given that, as well as keeping things as simple
110 # as possible we want (at least) the following:
111 # * Allow make to be run at the top level (all-target-libf2c), at this
112 # level, or the subdirs of this level. In the latter case we only
113 # compile, rather than updating libg2c.a;
114 # * A robust set of dependencies, so that we rebuild (as little as
115 # possible) if a configuration file, g2c.h or any lib?77/*.c file
116 # changes;
117 # * Avoid unnecessary running of ar and ranlib;
118 # * Expose parallelism where reasonable, but not as a priority.
120 # The intended top-level target here does a non-multilib build (via
121 # the dependency) and then (perhaps) builds multilibs.
123 all: all-unilib
124 $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="all-unilib"
126 # `all-unilib' is the overall target in the absence of multilibs,
127 # meant to be invoked via multi-do for multilibs.
129 # Its dependencies can be satisfied in parallel. The [fiu]77 targets
130 # update stamp files (object file lists, actually, see the subdir
131 # makefiles) on which the $(LIBG2C) depends. The stamp files
132 # s-lib[fiu]77 are intentionally not targets, since we're only meant
133 # to come in at the level of this target. The [fiu]77 targets always
134 # invoke sub makes to check dependencies in the subdirs, else we'd
135 # have to maintain them at this level; we live with the overhead of
136 # some recursive makes which may do nothing.
138 all-unilib: i77 f77 u77 s-libe77
139 $(MAKE) $(FLAGS_TO_PASS) $(LIBG2C)
141 i77 f77 u77: g2c.h
143 # This target should normally only get invoked via `all-unilib' --
144 # after all's well in the subdirs -- actually to assemble the library.
145 # The stamp files contain the object lists of each component of the
146 # library. The point of breaking them up is to avoid command-line
147 # length limitations.
149 $(LIBG2C): s-libi77 s-libf77 s-libu77 s-libe77
150 $(LIBTOOL) --mode=link $(CC) -o $@ \
151 -version-info $(VERSION_MAJOR):$(VERSION_MINOR):$(VERSION_SUB) \
152 -rpath $(libdir)$(MULTISUBDIR) \
153 -objectlist s-libe77 \
154 -objectlist s-libf77 \
155 -objectlist s-libi77 \
156 -objectlist s-libu77 \
159 i77:
160 cd libI77; $(MAKE) $(FLAGS_TO_PASS) all
162 f77:
163 cd libF77; $(MAKE) $(FLAGS_TO_PASS) all
165 u77:
166 cd libU77; $(MAKE) $(FLAGS_TO_PASS) all
168 s-libe77: f2cext.c
169 if [ -d libE77 ]; then rm -f libE77/*.o libE77/*.lo; else mkdir libE77; fi
170 -rm -f $@.T $@
171 for name in $(F2CEXT); \
172 do \
173 echo $${name}; \
174 $(LIBTOOL) --mode=compile $(CC) -c -I. -I$(srcdir) -I../../include \
175 $(CPPFLAGS) $(CFLAGS) -DL$${name} $(srcdir)/f2cext.c \
176 -o libE77/L$${name}.lo ; \
177 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
178 echo libE77/L$${name}.lo >> $@.T; \
179 done
180 mv $@.T $@
182 f2cext.c: g2c.h
184 ${srcdir}/configure: configure.in
185 rm -f config.cache
186 cd $(srcdir) && autoconf
188 # Dependence on Makefile serializes for parallel make.
189 g2c.h: g2c.hin config.status Makefile
190 # Might try to avoid rebuilding everything if Makefile or configure
191 # changes and g2c.h doesn't; see also the Makefile rule. Should
192 # depend on another stamp file rather than using the commented-out
193 # lines below, since g2c.h isn't necessarily brought up to date.
194 # mv g2c.h g2c.x
195 $(SHELL) config.status
196 # $(SHELL) $(srcdir)/../move-if-change g2c.h g2c.x && mv g2c.x g2c.h
198 Makefile: Makefile.in config.status
199 # Autoconf doc uses `./config.status'. Is there a good reason to use $(SHELL)?
200 $(SHELL) config.status
202 config.status: configure $(gcc_version_trigger)
203 # Make sure we don't pick up a site config file and that configure
204 # gets run with correct values of variables such as CC.
205 CONFIG_SITE=no-such-file $(FLAGS_TO_PASS) \
206 $(SHELL) config.status --recheck
208 info install-info clean-info dvi TAGS dist installcheck installdirs:
210 check:
211 cd libU77; $(MAKE) G77DIR=../../../gcc/ check
213 install: all
214 $(SHELL) $(toplevel_srcdir)/mkinstalldirs $(glibcpp_toolexeclibdir)
215 $(LIBTOOL) --mode=install $(INSTALL) $(LIBG2C) $(glibcpp_toolexeclibdir)
216 $(INSTALL_DATA) libfrtbegin.a $(glibcpp_toolexeclibdir)
217 $(RANLIB) $(glibcpp_toolexeclibdir)/libfrtbegin.a
218 $(INSTALL_DATA) g2c.h $(libsubdir)/include/g2c.h
219 $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
220 @-$(LIBTOOL) --mode=finish $(glibcpp_toolexeclibdir)
222 install-strip:
223 $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
225 uninstall:
226 rm -f $(libsubdir)/include/g2c.h
227 rm -f $(glibcpp_toolexeclibdir)/libfrtbegin.a
228 $(LIBTOOL) --mode=uninstall rm -f $(glibcpp_toolexeclibdir)$(LIBG2C_BASE).la
229 $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="$@"
231 mostlyclean:
232 rm -f $(LIBG2C) objlist
233 $(MAKE) DO=$@ DODIRS="$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do; \
234 $(MULTICLEAN) multi-clean DO=$@
235 rm -fr libE77 s-libe77
237 clean: mostlyclean
238 rm -f config.log
239 $(MAKE) DO=$@ DODIRS="$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do; \
240 $(MULTICLEAN) multi-clean DO=$@
241 rm -rf .libs
243 distclean: clean
244 rm -f g2c.h s-libe77
245 $(MAKE) DO=$@ DODIRS="$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do; \
246 $(MULTICLEAN) multi-clean DO=distclean
247 rm -f config.cache config.status Makefile
249 maintainer-clean:
251 rebuilt: configure
253 .PHONY: rebuilt mostlyclean clean distclean maintainer-clean all \
254 i77 f77 u77 check uninstall install-strip dist \
255 installcheck installdirs all-unilib
257 subdir_do:
258 @rootpre=`pwd`/; export rootpre; \
259 srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
260 for i in .. $(DODIRS); do \
261 if [ x$$i != x.. ]; then \
262 if [ -f ./$$i/Makefile ]; then \
263 if (cd ./$$i; $(MAKE) $(FLAGS_TO_PASS) $(DO)); then \
264 true; \
265 else \
266 exit 1; \
267 fi; \
268 else true; fi; \
269 else true; fi; \
270 done
272 # multidoings may be added here by configure.