# GNUmakefile
#
# Created:         Fri Jun 28 18:29:32 2002 by snadiopt.pl
# Current Version: Fri Jun 28 18:29:32 2002

SHELL   := /bin/sh
F77     := f77
FC      := f77
FFLAGS  := -O
LDFLAGS := 

AD_HOME := /people/peg/ad2.0D-Linux86/ADIFOR2.0D
AD_OS   := Linux86
AD_LIB  := /people/peg/ad2.0D-Linux86/ADIFOR2.0D.lib
ADIFOR  := $(AD_HOME)/bin/Adifor
PATH    := $(AD_HOME)/bin:$(PATH)

BLAS               := -lblas

DENSESNADIOPTLIBS  := -L/people/peg/snopt-distrib/bin/../lib -lsnddiopt

SPARSESNADIOPTLIBS := -L/people/peg/snopt-distrib/bin/../lib -lsnsdiopt


# Set environment variables used by the ADIFOR pre-processor
export AD_HOME AD_OS AD_LIB PATH

# ADIFORLIBS - Libraries that must be linked to ADIFOR-generated code
ADIFORLIBS = \
    $(AD_LIB)/lib/ReqADIntrinsics-$(AD_OS).o \
    $(AD_LIB)/lib/libADIntrinsics-$(AD_OS).a

SPARSE_LIB     = $(AD_LIB)/lib/libSparsLinC-$(AD_OS).a

AD_FLAVOR := sparse

# FTNCHEK - The name of a program to use to verify the consistency of 
#    the fortran files. Unsurprisingly, this program is usually named 
#    ftnchek. The ftnchek program is not distributed with snopt,
#    but is readily available (and highly recommended). Try looking at
#    ftp://netlib.org/fortran/ftnchek.tar.gz.
#
#    'make check' will perform the consistency check. 
FTNCHEK = ftnchek

# FTNCHEKFLAGS - Flags used by the ftnchek program. The default flags
#    are valid for ftncheck v2.09, and turn off unavoidable warnings
#    in snopt-adifor generated programs.
FTNCHEKFLAGS = -noextern -pretty=all -pretty=no-embedded-space \
    -quiet -array=0 -usage=331

# Make all the first target
all:

include $(wildcard *_submake)

# make check - checks the consistency of the fortran files used to
#     build each program. Requires that you have ftnchek installed.
check: 

# make clean - removes object files and some common "garbage" files
#   as "core" files.
clean: 

# veryclean - removes more files generated by the build process,
#             including the executable. Removes the output file.
#                  
veryclean: clean adifor-veryclean

# make distclean - cleans up for distribution. 
#     The adifor-generated fortran files are considered part of the 
#     distribution.
distclean: clean adifor-clean snadiopt-clean

# make maintainer-clean - deletes everything that can be rebuilt
maintainer-clean: veryclean adifor-veryclean snadiopt-veryclean
	@echo 'This command is intended for maintainers to use; it'
	@echo 'deletes files that may need special tools to rebuild.'
	-rm GNUmakefile

# make adifor-clean - Removes ADIFOR auxiliarly files
adifor-clean: 
	-rm -rf AD_cache

# make adifor-veryclean - Removes ADIFOR auxiliarly files and 
#     the generated fortran files  (and *.cmp).
adifor-veryclean: adifor-clean

# snadiopt-clean - Removes auxiliary files generated by snadiopt
#   for use with all the programs
snadiopt-clean: 

# snadiopt-veryclean - Removes all files generated by snadiopt.pl
#   for use with all the programs
snadiopt-veryclean: snadiopt-clean

# Cancel the rules for building an executable from a .o or .f file.
# This helps protect against typos.

% : %.o
% : %.f

.PHONY : check 
.PHONY : clean veryclean 
.PHONY : distclean maintainer-clean
.PHONY : adifor-clean adifor-veryclean 
.PHONY : snadiopt-clean snadiopt-veryclean
