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