#
# This is the makefile for installing ParPre.
# Largely a copy of the Petsc install makefile.
#

#PETSC_DIR = .

CFLAGS	 =
SOURCEC	 =
SOURCEF	 =
DOCS	 = Changes Machines Readme maint/addlinks \
	   maint/builddist FAQ Installation BugReporting\
	   maint/buildlinks maint/wwwman maint/xclude maint/crontab\
	   bmake/common bmake/*/base* maint/autoftp docs/www/sec/* \
           include/finclude/generateincludes bin/petscviewinfo.text \
           bin/petscoptsinfo.text
OBJSC	 =
OBJSF	 =
LIBBASE	 = libpetscvec
DIRS	 = src include docs 

include $(PARPRE_DIR)/bmake/parpre_base
#include $(PETSC_DIR)/bmake/$(PETSC_ARCH)/base


# VE
# removed:	-$(RM) -f $(PDIR)/*
# replaced with only parpre remove.
# removed:	-@cd $(PETSC_DIR)/src/sys/src ; \
# removed: 	$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) rs6000_time
# Builds ParPre libraries for a given BOPT and architecture
all: chkpetsc_dir
	-@echo "Beginning to compile libraries in all directories"
	-@echo "Using compiler: $(CC) $(COPTFLAGS)"
	-@echo "-----------------------------------------"
	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
	-@echo "-----------------------------------------"
	-@echo "Using configuration flags: $(CONF)"
	-@echo "-----------------------------------------"
	-@echo "Using include paths: $(PARPRE_INCLUDE)"
	-@echo "-----------------------------------------"
	-@echo "Using PETSc directory: $(PETSC_DIR)"
	-@echo "Using PETSc arch: $(PETSC_ARCH)"
	-@echo "========================================="
	-$(RM) -f $(PDIR)/libparpre.a
	-export PARPRE_INCLUDE ; \
	    PARPRE_INCLUDE="$(PARPRE_INCLUDE)" ; \
		$(OMAKE) BOPT="$(BOPT)" PETSC_ARCH=$(PETSC_ARCH) \
			ACTION=libfast  tree 
	$(RANLIB) $(PDIR)/*.a
	-@#chmod g+w  $(PDIR)/*.a
	-@echo "Completed building libraries"
	-@echo "========================================="

ranlib:
	$(RANLIB) $(PDIR)/*.a


