#
#  The Fortran and C compilers. We are assuming  support for an INCLUDE extension to F77 
#  (or an F90 compiler)
#
include ../../Make.inc

#
# The object files
#

SPARKERDIR = SPARKER/
PRECDIR = PREC/
COBJS = 

FOBJS= 
OBJS=$(COBJS) $(FOBJS)

LIBOBJS = $(OBJS) $(PREPROCESS)
# $(CSR) $(JAD) $(AUX) $(COO)

#
# Where the library should go, and how it is called. 
# Note that we are regenerating most of libsparker.a on the fly. 
LIBDIR=../../LIB
LIBNAME=libsparker.a	
LIBPREC=libkprec.a
LIBFILE=$(LIBDIR)/$(LIBNAME)
INCLUDEDIR=.

INCDIRS=-I. -I.. -I$(LIBDIR)

#
# No change should be needed below 
#

lib:
	(cd $(SPARKERDIR); make lib LIBNAME=$(LIBNAME) LIBDIR=../$(LIBDIR))
	(cd $(PRECDIR);  make lib  LIBNAME=$(LIBPREC) LIBDIR=../$(LIBDIR))
#	lorder $(LIBOBJS) | tsort | xargs ar -cur $(LIBFILE)


$(FOBJS): sparker.fh
sparker.fh: $(INCLUDEDIR)/sparker.fh
	/bin/cp $(INCLUDEDIR)/sparker.fh sparker.fh

clean: cleanobjs

veryclean: cleanobjs cleanlib

cleanlib:
	/bin/rm -f $(LIBFILE) 
cleanobjs:
	/bin/rm -f $(OBJS) 
	(cd $(SPARKERDIR); make clean)
	(cd $(PRECDIR); make clean)

