#
# Makefile for f2c library
#

include ../Mkinclude

LIBNAME		=libf2c
LIBSRC		=close.o dolio.o ef1asc_.o ef1cmc_.o endfile.o f77vers.o fmt.o getarg_.o\
		i77vers.o i_indx.o i_len.o i_nint.o i_sign.o iargc_.o iio.o inquire.o lread.o\
		open.o pow_dd.o pow_di.o pow_ri.o r_lg10.o r_sign.o rewind.o sfe.o sue.o uio.o\
		wsfe.o wsle.o\
		abort_.o backspac.o dfe.o err.o ilnw.o\
		hl_ge.o hl_gt.o hl_le.o hl_lt.o	l_ge.o l_gt.o l_le.o l_lt.o\
		main.o pow_ii.o r_mod.o rsfe.o rsne.o s_cat.o\
		s_cmp.o s_copy.o s_stop.o selfile.o wsne.o\
		c_div.o f77_aloc.o getenv_.o lwrite.o rdfmt.o rsli.o\
		sig_die.o system_.o util.o wref.o wrtfmt.o xwsne.o z_div.o\
		fmtlib.o exit_.o\
		f77vers.c i77vers.c 

# If you get an error compiling dtime_.c or etime_.c, try adding
# -DUSE_CLOCK to the CFLAGS assignment above; if that does not work,
# omit $(TIME) from the dependency list for libf2c.a below.

# For INTEGER*8 support (which requires system-dependent adjustments to
# f2c.h), add $(QINT) to the libf2c.a dependency list below...

all: f2c.h signal1.h $(LIBNAME).a install

$(LIBNAME).a: $(LIBSRC) 
	ar r $(LIBNAME).a $?
	-ranlib $(LIBNAME).a

# To get an "f2c.h" for use with "f2c -C++", first "make hadd"
hadd: f2c.h0 f2ch.add
	cat f2c.h0 f2ch.add >f2c.h

# For use with "f2c" and "f2c -A":
f2c.h: f2c.h0
	cp f2c.h0 f2c.h

# You may need to adjust signal1.h suitably for your system...
signal1.h: signal1.h0
	cp signal1.h0 signal1.h

main.o: main.c
	$(CC) -c -D$(IF_ONEXIT) -DSkip_f2c_Undefs main.c

install: $(LIBNAME).a
	cp f2c.h $(DCLDIR)/f2clib
	cp $(LIBNAME).a $(DCLDIR)/f2clib
	-ranlib $(DCLDIR)/f2clib/$(LIBNAME).a


pack: 
	@echo "no packed file for f2c library"

clean.all: clean

clean:
	$(RM) $(LIBNAME).a *.o *~ *.ps core *.trace
	$(RM) $(DCLDIR)/f2clib/f2c.h $(DCLDIR)/f2clib/$(LIBNAME).a

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

