OSDN Git Service

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