hypre/FEI_matrix_vector/fei-isis/Makefile
1999-07-14 20:14:43 +00:00

346 lines
9.7 KiB
Makefile

######################################################################
#
# Top-level makefile for the ISIS++ solver framework.
#
# NOTE! You must ./configure at least once per installation before
# building the lib. If you want to run the drivers, you should
# choose to write a setup file from the configure.
#
# Subsequently, if you want to run the ISIS++ drivers you will
# need to source (csh or tcsh) the setup file. The setup script
# sets environment variables needed to build the lib and to
# read from file (developers).
#
#######################################################################
SHELL = /bin/sh
PACKAGE=fei-isis
#######################################################################
# configure generates make.options, and the user
# should never have to edit this main make file.
# If some old bsd 4.3 derived version of make does not
# support the include directive, then the text of
# make.options should be pasted here directly by
# the user.
#######################################################################
include make.options
#
# defines and other flags composed from info in make.options.
#
# other flags of convenience
IT_DEFINES = -D$(ISIS_TARGET)
C++DEFINES = $(ISIS_BOOL) $(IT_DEFINES)
C++INCLUDES_MPI = -I$(MPI_INCLUDE) $(C++INCLUDES)
# our primary targets defined
SLIB = $(FEI_ROOT)/lib/$(ISIS_ARCH)/libfei_isis.a
PLIB = $(FEI_ROOT)/lib/$(ISIS_ARCH)/libfei_isis.a
#######################################################################
#
# object lists:
#
#######################################################################
#############################
# the FEI targets
#############################
FEI_OBJS = \
src/BCRecord.o \
src/BlockRecord.o \
src/CommBufferDouble.o \
src/CommBufferInt.o \
src/ExternNodeRecord.o \
src/FieldRecord.o \
src/MultConstRecord.o \
src/NodeRecord.o \
src/PenConstRecord.o \
src/SLE_utils.o \
src/SharedNodeBuffer.o \
src/SharedNodeRecord.o \
src/BASE_SLE.mp.o \
src/ISIS_SLE.mp.o \
src/FEI_ISIS.mp.o \
src/fei_proc.mp.o \
src/SimpleList.o
FEI_SRCS = $(FEI_OBJS:.o=.cc)
#############################
# the 'other' target
#############################
OTHER_OBJ = \
other/mpi.o
OTHER_SRC = $(OTHER_OBJ:.o=.c)
#############################
# object lists for wrappers of externally defined pc classes
# are small and infrequently changed, therefore we
# keep them with the build targets for the wrappers
# for ease of maintenance.
#############################
# combined lists:
MPI_DEPENDENT_SRCS=
# install directories that will be created
# these must be given in order when there is a dependency
PACKAGE_DIR=$(INSTALL_ROOT)/fei-isis
ISIS_SUBDIRS= \
lib \
lib/$(ISIS_ARCH) \
src \
other
#######################################################################
#
# top level flow of control and messages
#
#######################################################################
default: subdirs libs archive
libs: src
archive: $(PLIB)
$(RANLIB) $(PLIB)
#
# libs plus FEI
all:
make libs;
make driver;
make fe;
src fe: $(FEI_OBJS)
ar rs $(PLIB) $(FEI_OBJS)
other: $(OTHER_OBJ)
ar rs $(PLIB) $(OTHER_OBJ)
drivers driver fei-drivers:
cd drivers; make FEI_ROOT="$(FEI_ROOT)";
subdirs:
# Create sub-directories if needed.
@if [ -d lib/$(ISIS_ARCH) ] ; then \
echo "lib/$(ISIS_ARCH) exists"; \
else \
$(MKDIR) lib/$(ISIS_ARCH); \
fi
util utils:
make libs;
cd util; make $@ FEI_ROOT="$(FEI_ROOT)"
#######################################################################
#
# generic build rules
#
#######################################################################
.SUFFIXES:
.SUFFIXES: .c .cc .mp.o .o
# standard C (.o)
.c.o:
$(C) $(CFLAGS) -c -o $@ $<
# standard C++ (.o)
.cc.o:
$(CPP) $(CXXFLAGS) $(C++DEFINES) \
$(C++INCLUDES) \
-o $@ $<
# mpi dependent c++ (.mp.o)
.cc.mp.o:
$(CPP) $(CXXFLAGS) $(C++DEFINES) \
$(C++INCLUDES_MPI) \
-o $@ $<
###################
# special definitions and rules for external library preconditioners.
###################
#######################################################################
#
# distribution rules. not current.
#
#######################################################################
release:
cd $(FEI_ROOT); make clean
cd $(FEI_ROOT)/..; tar -cf fei-isis-release.tar fei-isis
#######################################################################
#
# install rules, in sort of generic form until we get fei outa here.
#
#######################################################################
uninstall: $(PACKAGE_DIR)
/bin/rm -rf $(PACKAGE_DIR)
install: install.$(PACKAGE)
install.$(PACKAGE): install-dirs.$(PACKAGE) \
install-header.$(PACKAGE) \
install-lib.$(PACKAGE) \
install-readme.$(PACKAGE)
install-dirs.$(PACKAGE): $(INSTALL_ROOT) have-permission
@if ! [ -d $(PACKAGE_DIR) ] ; then \
$(MKDIR) $(PACKAGE_DIR); \
make install-subdirs.$(PACKAGE); \
else \
echo "* * Will not install on top of existing $(PACKAGE)!"; \
echo "* * Move existing $(PACKAGE_DIR), or"; \
echo "* * 'make uninstall' to delete $(PACKAGE_DIR)"; \
fi
install-subdirs.$(PACKAGE): have-permission
@if [ -d $(PACKAGE_DIR) ] ; then \
for newdir in $(ISIS_SUBDIRS) ; do \
if ! [ -d $(PACKAGE_DIR)/$$newdir ] ; then \
$(MKDIR) $(PACKAGE_DIR)/$$newdir; \
fi; \
done \
fi
install-header.$(PACKAGE): have-permission
@$(CP) fei-isis.h $(PACKAGE_DIR)
@$(CHMOD) 644 $(PACKAGE_DIR)/fei-*.h
@for hdir in src other ; do \
if [ -d $(PACKAGE_DIR)/$$hdir ] ; then \
$(CP) $$hdir/*.h $(PACKAGE_DIR)/$$hdir; \
$(CHMOD) 644 $(PACKAGE_DIR)/$$hdir/*.h; \
else \
echo "Failed to install $(PACKAGE_DIR)/$$hdir"; \
fi; \
done
install-lib.$(PACKAGE): $(PLIB) have-permission
@$(CP) $(PLIB) $(PACKAGE_DIR)/lib/$(ISIS_ARCH)
@$(RANLIB) $(PACKAGE_DIR)/lib/$(ISIS_ARCH)/libfei_isis.a
@$(CHMOD) 644 $(PACKAGE_DIR)/lib/$(ISIS_ARCH)/libfei_isis.a
install-readme.$(PACKAGE): have-permission
-@$(RM) $(PACKAGE_DIR)/README.$(PACKAGE).txt
@echo "$(CPP) -I$(PACKAGE_DIR) -L$(PACKAGE_DIR)/lib/$(ISIS_ARCH) -lfei_isis" \
> $(PACKAGE_DIR)/README.$(PACKAGE).txt
@echo "#include <fei-isis.h> in C++." \
>> $(PACKAGE_DIR)/README.$(PACKAGE).txt
@echo "$(CPP) -I$(PACKAGE_DIR) to compile with $(PACKAGE)"
@echo "$(CPP) -L$(PACKAGE_DIR)/lib/$(ISIS_ARCH) -lfei_isis to link $(PACKAGE)."
have-permission:
@touch $(INSTALL_ROOT)/.fei.writable.install
#######################################################################
#
# clean rules
#
#######################################################################
clean cleandir:
@touch erase.this
-$(RM) -f PI* erase.* *.out #* *~ emake.log
@cd other; make clean FEI_ROOT="$(FEI_ROOT)"
cd lib; make clean FEI_ROOT="$(FEI_ROOT)" ISIS_ARCH="$(ISIS_ARCH)"
cd fei-drivers; make clean FEI_ROOT="$(FEI_ROOT)"
cd util; make clean FEI_ROOT="$(FEI_ROOT)"
cd src; make clean FEI_ROOT="$(FEI_ROOT)"
neat:
touch erase.this
rm -f PI* erase.* *.out #* *~
cd other; make $@ FEI_ROOT="$(FEI_ROOT)"
cd fei-drivers; make clean FEI_ROOT="$(FEI_ROOT)"
cd util; make clean FEI_ROOT="$(FEI_ROOT)"
clean.$(ISIS_DIR):
@cd $(ISIS_DIR); touch erase.ii
@cd $(ISIS_DIR); $(RM) -fr *~ *.o *.mp.o \
./ptrepository erase.* *.ii core ii_files/*.ii emake.log
@echo "=============> Make $(ISIS_DIR) clean complete"
distclean: clean
$(RM) -rf */ii_files make.options
#######################################################################
#
# help rules
#
#######################################################################
targets help:
@echo '### FEI-ISIS top level build targets ###'
@echo 'default: builds libfei files'
@echo 'install: installs FEI, usually in /usr/local/fei-isis'
@echo 'uninstall: removes installed FEI-ISIS (usually /usr/local/fei-isis) entirely
@echo 'clean: removes .o and other intermediate files'
@echo 'distclean: removes configure generated files, template dirs, libs'
@echo 'test: runs some simple tests'
@echo 'depend-portable: (linux only) (broken) generate Makefile.depend'
@echo '### FEI subdirectory build targets ###'
@echo 'default: builds local directory and updates libisis files'
@echo 'clean: removes .o and other intermediate files'
@echo '### FEI drivers subdirectory build targets ###'
@echo 'See subdirectory makefiles for more details'
#######################################################################
#
# debugging and testing rules
#
#######################################################################
test:
cd fei-drivers; make; make test
# if tags targets are to exist, they should be here. etags ctags
#######################################################################
#
# generate dependencies on isis sources for isis and wrapper classes.
# move to separate makefile.developers
#
#######################################################################
DEPEND_FLAGS = $(C++INCLUDES_MPI) $(C++DEFINES) -DSLOPPY_DEPENDS
DEPEND_SRCS= \
$(OTHER_SRCS) \
$(FEI__SRCS)
nodepend:
\$(DEPEND_NONE) \$(DEPEND_FLAGS) \$?
Makefile.depends:
\$(DEPEND_NONE) \$(DEPEND_FLAGS) \$?
#does require g++ or a CC which emits dependencies when properly flagged.
depend-nosys depend-no-sys: $(DEPEND_SRCS)
if [ $(ISIS_ARCH) = LINUX ]; then \
$(DEPEND_NOSYS) $(DEPEND_FLAGS) $(DEPEND_INCLUDES) $? ; \
else \
echo 'depend-nosys requires the g++ compiler' ; \
fi
depend: $(FEI_SRCS)
@if [ $(ISIS_ARCH) = LINUX ]; then \
$(DEPEND_ALL) $(DEPEND_FLAGS) $(DEPEND_INCLUDES) $? ; \
else \
echo 'depend requires the g++ compiler' ; \
fi
depend-portable: depend-nosys
cat Makefile.depends | \
sed -e 's;$(FEI_ROOT)/;;g' -e 's;^ *;;g' | \
sed -e 's;^ ;@;g' -e 's;^ ;@;g' -e 's;^ ;@;g' >Makefile.nd
$(CP) -f Makefile.nd Makefile.depends
$(RM) -f Makefile.nd
# don't put anything after this line.
# don't move the next line up in the file, either.
include Makefile.depends