]>
Commit | Line | Data |
---|---|---|
81fea2b1 | 1 | # Makefile for GNU F77 compiler runtime. |
b53c05f5 | 2 | # Copyright (C) 1995-1998 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 | ||
22 | SHELL = /bin/sh | |
23 | ||
24 | #### Start of system configuration section. #### | |
25 | ||
26 | srcdir = @srcdir@ | |
b53c05f5 | 27 | VPATH = @srcdir@ |
81fea2b1 JL |
28 | prefix = @prefix@ |
29 | exec_prefix = @exec_prefix@ | |
0f1d4fad | 30 | target_alias = @target_alias@ |
6174dcf3 | 31 | gcc_version = @gcc_version@ |
f1943b77 | 32 | gcc_version_trigger = @gcc_version_trigger@ |
81fea2b1 | 33 | |
81fea2b1 | 34 | libdir = $(exec_prefix)/lib |
6174dcf3 | 35 | libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version) |
81fea2b1 | 36 | |
b53c05f5 DL |
37 | # Not configured per top-level version, since that doesn't get passed |
38 | # down at configure time, but overrridden by the top-level install | |
39 | # target. | |
40 | INSTALL = @INSTALL@ | |
41 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
42 | INSTALL_DATA = @INSTALL_DATA@ | |
81fea2b1 | 43 | |
b53c05f5 | 44 | AR = @AR@ |
81fea2b1 JL |
45 | AR_FLAGS = rc |
46 | ||
b53c05f5 | 47 | RANLIB = @RANLIB@ |
81fea2b1 | 48 | |
b53c05f5 DL |
49 | CC = @CC@ |
50 | CFLAGS = @CFLAGS@ | |
81fea2b1 | 51 | |
b53c05f5 DL |
52 | # List of variables to pass to sub-makes. |
53 | # Quote this way so that it can be used to set shell variables too. | |
54 | # Currently no use for PICFLAG, RUNTESTFLAGS -- check usage. | |
81fea2b1 | 55 | FLAGS_TO_PASS= \ |
b53c05f5 DL |
56 | CC='$(CC)' \ |
57 | CFLAGS='$(CFLAGS)' \ | |
58 | CPPFLAGS='$(CPPFLAGS)' \ | |
59 | AR='$(AR)' \ | |
60 | RANLIB='$(RANLIB)' | |
61 | PICFLAG='$(PICFLAG)' \ | |
62 | RUNTESTFLAGS='$(RUNTESTFLAGS)' | |
81fea2b1 | 63 | |
f30bc2e7 | 64 | LIBG2C = libg2c.a |
81fea2b1 | 65 | |
b53c05f5 | 66 | SUBDIRS = libI77 libF77 libU77 |
81fea2b1 JL |
67 | |
68 | F2CEXT = abort derf derfc ef1asc ef1cmc erf erfc exit getarg getenv iargc \ | |
69 | signal system flush ftell fseek access besj0 besj1 besjn besy0 besy1 \ | |
70 | besyn chdir chmod ctime date dbesj0 dbesj1 dbesjn dbesy0 dbesy1 dbesyn \ | |
71 | dtime etime fdate fgetc fget flush1 fnum fputc fput fstat gerror \ | |
72 | getcwd getgid getlog getpid getuid gmtime hostnm idate ierrno irand \ | |
73 | isatty itime kill link lnblnk lstat ltime mclock perror rand rename \ | |
28ef523e | 74 | secnds second sleep srand stat symlnk time ttynam umask unlink \ |
81fea2b1 JL |
75 | vxtidt vxttim alarm |
76 | ||
b53c05f5 DL |
77 | # These dependencies can be satisfied in parallel. They update stamp |
78 | # files which the $(LIBG2C) target checks in the sub-make. (Probably | |
79 | # only one stamp file is really needed.) | |
80 | all: i77 f77 u77 e77 | |
0176af44 | 81 | $(MAKE) $(FLAGS_TO_PASS) $(LIBG2C) |
81fea2b1 | 82 | |
b53c05f5 DL |
83 | i77 f77 u77: g2c.h |
84 | ||
85 | $(LIBG2C): stamp-libi77 stamp-libf77 stamp-libu77 stamp-libe77 | |
f30bc2e7 | 86 | rm -f $(LIBG2C) |
b53c05f5 DL |
87 | set -e; \ |
88 | for i in $(SUBDIRS); \ | |
89 | do (cd $$i && $(MAKE) $(FLAGS_TO_PASS) LIBG2C=../$(LIBG2C) archive); \ | |
90 | done | |
2929d7a2 | 91 | objs=""; for i in $(F2CEXT); do objs="$$objs libE77/L$$i.o"; done; \ |
f30bc2e7 CB |
92 | $(AR) $(AR_FLAGS) $(LIBG2C) $$objs |
93 | $(RANLIB) $(LIBG2C) | |
81fea2b1 | 94 | |
b53c05f5 | 95 | i77: |
f30bc2e7 | 96 | cd libI77; $(MAKE) $(FLAGS_TO_PASS) all |
81fea2b1 | 97 | |
b53c05f5 | 98 | f77: |
f30bc2e7 | 99 | cd libF77; $(MAKE) $(FLAGS_TO_PASS) all |
81fea2b1 | 100 | |
b53c05f5 | 101 | u77: |
f30bc2e7 | 102 | cd libU77; $(MAKE) $(FLAGS_TO_PASS) all |
81fea2b1 JL |
103 | |
104 | stamp-libe77: $(srcdir)/f2cext.c | |
f30bc2e7 | 105 | if [ -d libE77 ]; then rm -f libE77/*.o; else mkdir libE77; fi |
81fea2b1 JL |
106 | for name in $(F2CEXT); \ |
107 | do \ | |
108 | echo $${name}; \ | |
109 | $(CC) -c -I. -I$(srcdir) -I../../include $(CPPFLAGS) $(CFLAGS) \ | |
f30bc2e7 | 110 | -DL$${name} $(srcdir)/f2cext.c \ |
81fea2b1 JL |
111 | -o libE77/L$${name}.o; \ |
112 | if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ | |
113 | done | |
b53c05f5 | 114 | echo timestamp >stamp-libe77 |
81fea2b1 JL |
115 | |
116 | ${srcdir}/configure: ${srcdir}/configure.in | |
b53c05f5 DL |
117 | rm -f config.cache |
118 | cd $(srcdir) && autoconf | |
119 | ||
120 | # Dependence on Makefile serializes for parallel make. | |
121 | g2c.h: $(srcdir)/g2c.h.in config.status Makefile | |
122 | # Might try to avoid rebuilding everything if Makefile or configure | |
123 | # changes and g2c.h doesn't; see also the Makefile rule. Should | |
124 | # depend on another stamp file rather than using the commented-out | |
125 | # lines below, since g2c.h isn't necessarily brought up to date. | |
126 | # mv g2c.h g2c.x | |
9992b2e1 | 127 | $(SHELL) config.status |
b53c05f5 DL |
128 | # $(srcdir)/../move-if-change g2c.h g2c.x && mv g2c.x g2c.h |
129 | ||
130 | Makefile: $(srcdir)/Makefile.in config.status | |
131 | # Autoconf doc uses `./config.status'. Is there a good reason to use | |
132 | $(SHELL) config.status | |
133 | ||
f1943b77 | 134 | config.status: $(srcdir)/configure $(gcc_version_trigger) |
b53c05f5 DL |
135 | # Make sure we don't pick up a site config file and that configure |
136 | # gets run with correct values of variables such as CC. | |
137 | CONFIG_SITE=no-such-file $(FLAGS_TO_PASS) \ | |
138 | $(SHELL) config.status --recheck | |
81fea2b1 | 139 | |
b53c05f5 | 140 | info install-info clean-info dvi TAGS dist installcheck installdirs: |
9992b2e1 DL |
141 | |
142 | check: | |
143 | cd libU77; $(MAKE) G77DIR=../../../gcc/ check | |
12346e71 | 144 | |
b53c05f5 | 145 | install: all |
f30bc2e7 CB |
146 | $(INSTALL_DATA) $(LIBG2C) $(libsubdir)/$(LIBG2C).n |
147 | ( cd $(libsubdir) ; $(RANLIB) $(LIBG2C).n ) | |
148 | mv -f $(libsubdir)/$(LIBG2C).n $(libsubdir)/$(LIBG2C) | |
149 | $(INSTALL_DATA) g2c.h $(libsubdir)/include/g2c.h | |
150 | @if [ -f f2c-install-ok -o -f $(srcdir)/f2c-install-ok ]; then \ | |
151 | echo ''; \ | |
152 | echo 'Warning: g77 no longer installs libf2c.a or f2c.h.'; \ | |
153 | echo ' You must do so yourself. For more information,'; \ | |
154 | echo ' read "Distributing Binaries" in the g77 docs.'; \ | |
155 | echo ' (To turn off this warning, delete the file'; \ | |
156 | echo ' f2c-install-ok in the source or build directory.)'; \ | |
157 | echo ''; \ | |
158 | fi | |
81fea2b1 | 159 | |
b53c05f5 DL |
160 | install-strip: |
161 | $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install | |
162 | ||
163 | uninstall: | |
164 | rm -f $(libsubdir)/include/g2c.h $(libsubdir)/$(LIBG2C) | |
165 | ||
81fea2b1 | 166 | mostlyclean: |
b53c05f5 DL |
167 | rm -f $(LIBG2C) |
168 | for i in $(SUBDIRS); do (cd $$i && $(MAKE) mostlyclean); done | |
81fea2b1 JL |
169 | rm -fr libE77 |
170 | ||
b53c05f5 DL |
171 | clean: mostlyclean |
172 | rm -f config.log | |
173 | for i in $(SUBDIRS); do (cd $$i && $(MAKE) clean); done | |
f30bc2e7 | 174 | |
b53c05f5 DL |
175 | distclean: clean |
176 | rm -f Makefile config.cache config.status g2c.h stamp-libe77 | |
177 | for i in $(SUBDIRS); do (cd $$i && $(MAKE) distclean); done | |
f30bc2e7 CB |
178 | |
179 | maintainer-clean: | |
81fea2b1 | 180 | |
b53c05f5 | 181 | rebuilt: ${srcdir}/configure |
81fea2b1 | 182 | |
b53c05f5 DL |
183 | .PHONY: rebuilt mostlyclean clean distclean maintainer-clean all \ |
184 | i77 f77 u77 e77 check uninstall install-strip dist \ | |
185 | installcheck installdirs |