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