OSDN Git Service

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