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

VPATH = @srcdir@
srcdir = @srcdir@

# Common prefix for machine-independent installed files.
prefix = /gnu
# Common prefix for machine-dependent installed files.
exec_prefix = $(prefix)

# Directory to install executables in.
bindir = $(exec_prefix)/bin
# Directory to install libraries in.
libdir = $(exec_prefix)/lib
# Directory to install the Info files in.
infodir = $(prefix)/info
# Directory to install the man page in.
mandir = $(prefix)/man/man$(manext)
# Number to put on the man page filename.
manext = 1

# Program to install executables.
INSTALL_PROGRAM = @INSTALL_PROGRAM@
# Program to install data like man pages.
INSTALL_DATA = @INSTALL_DATA@
# Generic install program.
INSTALL = @INSTALL@

CC = @CC@
DEFS = @DEFS@ -I$(srcdir)/.. -DSkip_f2c_Undefs -DNON_UNIX_STDIO
CFLAGS = @CFLAGS@

LDFLAGS = @LDFLAGS@
LIBS = @LIBS@

YACC = @YACC@
RANLIB = @RANLIB@

AR = ar
SHELL = /bin/sh

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

# "-I." is needed to find generated files in the build directory.
.c.o:
		$(CC) -c -I. -I$(srcdir) $(DEFS) $(CFLAGS) $< $(OUTPUT_OPTION)


OBJ =		Version.o backspace.o close.o dfe.o dolio.o due.o endfile.o \
		err.o fmt.o fmtlib.o iio.o ilnw.o inquire.o lread.o lwrite.o \
		open.o rdfmt.o rewind.o rsfe.o rsli.o rsne.o sfe.o sue.o \
		typesize.o uio.o util.o wref.o wrtfmt.o wsfe.o wsle.o wsne.o \
		xwsne.o

libI77.a:	$(OBJ)
		$(AR) r libI77.a $?
		$(RANLIB) libI77.a

install:	libI77.a
		$(INSTALL_DATA) libI77.a $(libdir)/libI77.a
		$(RANLIB) $(libdir)/libI77.a

Version.o:	Version.c
		$(CC) -c $(DEFS) $(CFLAGS) $(srcdir)/Version.c

$(OBJ):		f2c.h

# To compile with C++, first "make f2c.h"

f2c.h:		f2ch.add
		cat $(srcdir)/../f2c.h $(srcdir)/f2ch.add >f2c.h

clean:
		rm -f $(OBJ) libI77.a

clobber:	clean
		rm -f libI77.a

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
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

check:
	xsum Notice README Version.c backspace.c close.c dfe.c dolio.c \
	due.c endfile.c err.c f2ch.add fio.h fmt.c fmt.h fmtlib.c fp.h \
	iio.c ilnw.c inquire.c lio.h lread.c lwrite.c makefile open.c \
	rawio.h rdfmt.c rewind.c rsfe.c rsli.c rsne.c sfe.c sue.c \
	typesize.c uio.c util.c wref.c wrtfmt.c wsfe.c wsle.c wsne.c \
	xwsne.c >zap
	cmp zap libI77.xsum && rm zap || diff libI77.xsum zap
