SHELL=/bin/sh
ARCH=arch
BLKCMARCH=$(ARCH)

OBJS =  *.o
SOURCE =  *.c
# This version relies on the special mpi scripts for compiling and linking,
# rather than using the general Makefile.in mechanism.
# Generated automatically from Makefile.site.in by configure.
DIRS     = defn compile exec mesh copy
LIBNAME  = ../lib/libblkcm${BLKCMARCH}.a

all:
	/bin/rm -f lib/libblkcm$(BLKCMARCH).a
	for dir in exec compile copy mesh defn examples ; do \
	    (cd $$dir ; make BLKCMARCH=$(BLKCMARCH) clean ; \
		make BLKCMARCH=$(BLKCMARCH) ) ; \
	done
	ranlib lib/libblkcm$(BLKCMARCH).a
	(cd examples; make BLKCMARCH=$(BLKCMARCH) example4 )
	(cd examplesf; make BLKCMARCH=$(BLKCMARCH) clean; \
			make BLKCMARCH=$(BLKCMARCH) )

#
# This makefile template defines a library name that is used when collecting
# object files into a library.  
.PRECIOUS: $(LIBNAME)

lib: $(OBJS) 
	$(AR) $(LIBNAME) $?

lint:
	lint -cvhu -DLINT $(SOURCE)

.c.o: 
	$(CC) -c $(CFLAGS) $(COPTFLAGS) $*.c
.f.o: 
	$(FC) -c $(FFLAGS) $(FOPTFLAGS) $*.f
clean:
	-/bin/rm -f *.o *~ core TAGS
	-/bin/rm -f lib/*.a lib/*.o
	-/bin/rm -f examplesf/*.arch examplesf/mpif.h
	-/bin/rm -f examples/*.arch
	-/bin/rm -f */*.o
