# Makefile for GNU F77 compiler runtime.
# Copyright 1990 - 1994 by AT&T Bell Laboratories and Bellcore (see the
# file `Notice').
#   Portions of this file Copyright (C) 1995, 1996 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.

#SHELL = /bin/sh

srcdir = .

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

# The _FOR_TARGET things are appropriate for a cross-make, passed by the
# superior makefile
GCC_FOR_TARGET = gcc
CC = $(GCC_FOR_TARGET)
CFLAGS = -O2 $(GCC_FLAGS)
CPPFLAGS = 
DEFS = -DSTDC_HEADERS=1  -D_POSIX_SOURCE=1  -DRETSIGTYPE=void  -DMISSING_FILE_ELEMS=1  -DNO_EOF_CHAR_CHECK=1  -DSkip_f2c_Undefs=1  -DNON_UNIX_STDIO=1
CGFLAGS = -g0
# f2c.h should already be installed in xgcc's include directory but add that
# to -I anyhow in case not using xgcc.
ALL_CFLAGS = -I. -I$(srcdir) -I.. $(CPPFLAGS) $(DEFS) $(CFLAGS)
AR = ar
AR_FLAGS = rc
RANLIB = ar s
RANLIB_TEST = true
CROSS = 

.SUFFIXES:
.SUFFIXES: .c .o

OBJS =	$(OBJDIR)/VersionI.o \
	$(OBJDIR)/backspace.o \
	$(OBJDIR)/close.o \
	$(OBJDIR)/dfe.o \
	$(OBJDIR)/dolio.o \
	$(OBJDIR)/due.o \
	$(OBJDIR)/endfile.o \
	$(OBJDIR)/err.o \
	$(OBJDIR)/fmt.o \
	$(OBJDIR)/fmtlib.o \
	$(OBJDIR)/iio.o \
	$(OBJDIR)/ilnw.o \
	$(OBJDIR)/inquire.o \
	$(OBJDIR)/lread.o \
	$(OBJDIR)/lwrite.o \
	$(OBJDIR)/open.o \
	$(OBJDIR)/rdfmt.o \
	$(OBJDIR)/rewind.o \
	$(OBJDIR)/rsfe.o \
	$(OBJDIR)/rsli.o \
	$(OBJDIR)/rsne.o \
	$(OBJDIR)/sfe.o \
	$(OBJDIR)/sue.o \
	$(OBJDIR)/typesize.o \
	$(OBJDIR)/uio.o \
	$(OBJDIR)/util.o \
	$(OBJDIR)/wref.o \
	$(OBJDIR)/wrtfmt.o \
	$(OBJDIR)/wsfe.o \
	$(OBJDIR)/wsle.o \
	$(OBJDIR)/wsne.o\
	$(OBJDIR)/xwsne.o \
	$(OBJDIR)/ftell_.o

	F2C_H = ../f2c.h

all: $(OBJS) $(LIB)

$(OBJDIR)/VersionI.o: Version.c
	$(CC) -c $(CGFLAGS) -o $@ Version.c

$(OBJDIR)/%.o : %.c 
	$(CC) -c -DSkip_f2c_Undefs $(ALL_CFLAGS) $(CGFLAGS) -o $@ $<


$(LIB): $(OBJS)
	$(AR) $(AR_FLAGS) $(LIB) $(OBJS)
	$(AR) d $(LIB) __.SYMDEF
	$(RANLIB) $(LIB)

mostlyclean clean:
	-rm -f $(OBJ)

distclean maintainer-clean: mostlyclean
	-rm -f stage? include Makefile

backspace.o:	fio.h
close.o:	fio.h
dfe.o:		fio.h
dfe.o:		fmt.h
due.o:		fio.h
endfile.o:	fio.h rawio.h
err.o:		fio.h rawio.h
fmt.o:		fio.h
fmt.o:		fmt.h
ftell_.o:	fio.h
iio.o:		fio.h
iio.o:		fmt.h
ilnw.o:		fio.h
ilnw.o:		lio.h
inquire.o:	fio.h
lread.o:	fio.h
lread.o:	fmt.h
lread.o:	lio.h
lread.o:	fp.h
lwrite.o:	fio.h
lwrite.o:	fmt.h
lwrite.o:	lio.h
open.o:		fio.h rawio.h
rdfmt.o:	fio.h
rdfmt.o:	fmt.h
rdfmt.o:	fp.h
rewind.o:	fio.h
rsfe.o:		fio.h
rsfe.o:		fmt.h
rsli.o:		fio.h
rsli.o:		lio.h
rsne.o:		fio.h
rsne.o:		lio.h
sfe.o:		fio.h
sue.o:		fio.h
uio.o:		fio.h
util.o:		fio.h
wref.o:		fio.h
wref.o:		fmt.h
wref.o:		fp.h
wrtfmt.o:	fio.h
wrtfmt.o:	fmt.h
wsfe.o:		fio.h
wsfe.o:		fmt.h
wsle.o:		fio.h
wsle.o:		fmt.h
wsle.o:		lio.h
wsne.o:		fio.h
wsne.o:		lio.h
xwsne.o:	fio.h
xwsne.o:	lio.h
xwsne.o:	fmt.h

# May be pessimistic:
$(OBJ): $(F2C_H)

.PHONY: mostlyclean clean distclean maintainer-clean all
