# Makefile for GNU F77 compiler runtime.
#   Copyright (C) 1995-1997 Free Software Foundation, Inc.
#   Contributed by Dave Love (d.love@dl.ac.uk).
#
#This file is part of GNU Fortran.
#
#GNU Fortran is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2, or (at your option)
#any later version.
#
#GNU Fortran is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with GNU Fortran; see the file COPYING.  If not, write to
#the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#02111-1307, USA.

#### Start of system configuration section. ####

# $(srcdir) must be set to the g77 runtime source directory
# (g77/f/runtime/).

srcdir = .
VPATH = .

top_srcdir = @top_srcdir@

INSTALL = @INSTALL@		# installs aren't actually done from here
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
RANLIB = ar s
RANLIB_TEST = @RANLIB_TEST@

CFLAGS = -O2 -Zmt
CPPFLAGS = -DSTDC_HEADERS=1 -D_POSIX_SOURCE=1 -DRETSIGTYPE=void -DMISSING_FILE_ELEMS=1 -DNO_EOF_CHAR_CHECK=1 -DSkip_f2c_Undefs=1 
LDFLAGS = 
LIBS = 
CGFLAGS = -g0

CROSS =

objext = .o

transform=@program_transform_name@

prefix = @prefix@
exec_prefix = @exec_prefix@

AR = ar
AR_FLAGS = rc

# Directory in which to install scripts.
bindir = $(exec_prefix)/bin

# Directory in which to install library files.
libdir = $(prefix)/lib

# Directory in which to install documentation info files.
infodir = $(prefix)/info

#### End of system configuration section. ####

#SHELL = /bin/sh

#lib = ../../libf2c.a
LIB = g2c.a

OBJ =   F77_aloc.o \
	abort_.o \
	access_.o \
	alarm_.o \
	backspace.o \
	bes.o \
	c_abs.o \
	c_cos.o \
	c_div.o \
	c_exp.o \
	c_log.o \
	c_sin.o \
	c_sqrt.o \
	cabs.o \
	chdir_.o \
	chmod_.o \
	close.o \
	ctime_.o \
	d_abs.o \
	d_acos.o \
	d_asin.o \
	d_atan.o \
	d_atn2.o \
	d_cnjg.o \
	d_cos.o \
	d_cosh.o \
	d_dim.o \
	d_exp.o \
	d_imag.o \
	d_int.o \
	d_lg10.o \
	d_log.o \
	d_mod.o \
	d_nint.o \
	d_prod.o \
	d_sign.o \
	d_sin.o \
	d_sinh.o \
	d_sqrt.o \
	d_tan.o \
	d_tanh.o \
	date_.o \
	dbes.o \
	derf_.o \
	derfc_.o \
	dfe.o \
	dolio.o \
	dtime_.o \
	due.o \
	ef1asc_.o \
	ef1cmc_.o \
	endfile.o \
	erf_.o \
	erfc_.o \
	err.o \
	etime_.o \
	exit_.o \
	fdate_.o \
	fgetc_.o \
	flush1_.o \
	fmt.o \
	fmtlib.o \
	fnum_.o \
	fputc_.o \
	fstat_.o \
	ftell_.o \
	gerror_.o \
	getarg_.o \
	getcwd_.o \
	getenv_.o \
	getgid_.o \
	getlog_.o \
	getpid_.o \
	getuid_.o \
	gmtime_.o \
	h_abs.o \
	h_dim.o \
	h_dnnt.o \
	h_indx.o \
	h_len.o \
	h_mod.o \
	h_nint.o \
	h_sign.o \
	hl_ge.o \
	hl_gt.o \
	hl_le.o \
	hl_lt.o \
	hostnm_.o \
	i_abs.o \
	i_dim.o \
	i_dnnt.o \
	i_indx.o \
	i_len.o \
	i_mod.o \
	i_nint.o \
	i_sign.o \
	iargc_.o \
	idate_.o \
	ierrno_.o \
	iio.o \
	ilnw.o \
	inquire.o \
	irand_.o \
	isatty_.o \
	itime_.o \
	kill_.o \
	l_ge.o \
	l_gt.o \
	l_le.o \
	l_lt.o \
	lbitbits.o \
	lbitshft.o \
	link_.o \
	lnblnk_.o \
	lread.o \
	lstat_.o \
	ltime_.o \
	lwrite.o \
	main.o \
	mclock_.o \
	open.o \
	perror_.o \
	pow_ci.o \
	pow_dd.o \
	pow_di.o \
	pow_hh.o \
	pow_ii.o \
	pow_qq.o \
	pow_ri.o \
	pow_zi.o \
	pow_zz.o \
	qbitbits.o \
	qbitshft.o \
	r_abs.o \
	r_acos.o \
	r_asin.o \
	r_atan.o \
	r_atn2.o \
	r_cnjg.o \
	r_cos.o \
	r_cosh.o \
	r_dim.o \
	r_exp.o \
	r_imag.o \
	r_int.o \
	r_lg10.o \
	r_log.o \
	r_mod.o \
	r_nint.o \
	r_sign.o \
	r_sin.o \
	r_sinh.o \
	r_sqrt.o \
	r_tan.o \
	r_tanh.o \
	rand_.o \
	rdfmt.o \
	rename_.o \
	rewind.o \
	rsfe.o \
	rsli.o \
	rsne.o \
	s_cat.o \
	s_cmp.o \
	s_copy.o \
	s_paus.o \
	s_rnge.o \
	s_stop.o \
	secnds_.o \
	second_.o \
	sfe.o \
	sig_die.o \
	signal_.o \
	sleep_.o \
	srand_.o \
	stat_.o \
	sue.o \
	symlnk_.o \
	system_.o \
	system_clock_.o \
	time_.o \
	ttynam_.o \
	typesize.o \
	uio.o \
	umask_.o \
	unlink_.o \
	util.o \
	vxtidate_.o \
	vxttime_.o \
	wref.o \
	wrtfmt.o \
	wsfe.o \
	wsle.o \
	wsne.o \
	xwsne.o \
	z_abs.o \
	z_cos.o \
	z_div.o \
	z_exp.o \
	z_log.o \
	z_sin.o \
	z_sqrt.o 

F2CEXT = abort derf derfc ef1asc ef1cmc erf erfc exit getarg getenv iargc \
	signal system flush ftell fseek access besj0 besj1 besjn besy0 besy1 \
	besyn chdir chmod ctime date dbesj0 dbesj1 dbesjn dbesy0 dbesy1 dbesyn \
	dtime etime fdate fgetc fget flush1 fnum fputc fput fstat gerror \
	getcwd getgid getlog getpid getuid gmtime hostnm idate ierrno irand \
	isatty itime kill link lnblnk lstat ltime mclock perror rand rename \
	secnds second sleep srand stat symlnk sclock time ttynam umask unlink \
	vxtidt vxttim alarm

F2CEXTO = Labort.o \
	Lderf.o \
	Lderfc.o \
	Lef1asc.o \
	Lef1cmc.o \
	Lerf.o \
	Lerfc.o \
	Lexit.o \
	Lgetarg.o \
	Lgetenv.o \
	Liargc.o \
	Lsignal.o \
	Lsystem.o \
	Lflush.o \
	Lftell.o \
	Lfseek.o \
	Laccess.o \
	Lbesj0.o \
	Lbesj1.o \
	Lbesjn.o \
	Lbesy0.o \
	Lbesy1.o \
	Lbesyn.o \
	Lchdir.o \
	Lchmod.o \
	Lctime.o \
	Ldate.o \
	Ldbesj0.o \
	Ldbesj1.o \
	Ldbesjn.o \
	Ldbesy0.o \
	Ldbesy1.o \
	Ldbesyn.o \
	Ldtime.o \
	Letime.o \
	Lfdate.o \
	Lfgetc.o \
	Lfget.o \
	Lflush1.o \
	Lfnum.o \
	Lfputc.o \
	Lfput.o \
	Lfstat.o \
	Lgerror.o \
	Lgetcwd.o \
	Lgetgid.o \
	Lgetlog.o \
	Lgetpid.o \
	Lgetuid.o \
	Lgmtime.o \
	Lhostnm.o \
	Lidate.o \
	Lierrno.o \
	Lirand.o \
	Lisatty.o \
	Litime.o \
	Lkill.o \
	Llink.o \
	Llnblnk.o \
	Llstat.o \
	Lltime.o \
	Lmclock.o \
	Lperror.o \
	Lrand.o \
	Lrename.o \
	Lsecnds.o \
	Lsecond.o \
	Lsleep.o \
	Lsrand.o \
	Lstat.o \
	Lsymlnk.o \
	Lsclock.o \
	Ltime.o \
	Lttynam.o \
	Lumask.o \
	Lunlink.o \
	Lvxtidt.o \
	Lvxttim.o \
	Lalarm.o

all: ../f2c.h $(LIB) 

$(LIB):	st-lib
st-lib: $(OBJ)
	-del stamp-li
	for %n in ($(F2CEXT)) do (gcc -c -I. -I$(srcdir) -I.. $(CPPFLAGS) $(CFLAGS) $(CGFLAGS) -DL%n ../f2cext.c -o L%n$(objext))

	$(AR) $(AR_FLAGS) $(LIB) $(F2CEXTO)
	$(AR) d $(LIB) __.SYMDEF
	$(RANLIB) $(LIB)
	touch st-lib

mostlyclean:
	for i in libI77 libF77 libU77; do cd $$i; $(MAKE) -f Makefile mostlyclean; cd ..;  done

clean:
	-rm -f config.log config.cache
	for i in libI77 libF77 libU77; do cd $$i; $(MAKE) -f Makefile clean; cd ..;  done

distclean: clean
	-rm -f Makefile lib?77/Makefile config.status libU77/config.status ../../include/f2c.h

maintainer-clean: distclean
	-rm -f $(srcdir)/configure $(srcdir)/libU77/configure

uninstall:
	rm 	f2c.h

.PHONY: libf77 libi77 libu77 rebuilt mostlyclean clean distclean maintainer-clean \
  uninstall all
