source: trunk/src/gcc/libf2c/Makefile.in@ 1036

Last change on this file since 1036 was 64, checked in by bird, 22 years ago

OS/2 workaround for the parallel build workaround ': $(MAKE) ; $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do'.

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