#
# Copyright 2004 Peter Mills. All rights reserved.
#
# The make file for building a set of templated libraries of various
# algorithmic constructs. Chief amongst these are: binary search
# routines, heapsort routines, a class for working with dates and times,
# a Runge-Kutta integrator and a linked list class.
#
OPT_VER=-g
CPP = icpc
CFLAGS = $(OPT_VER) -Wno-deprecated -O2
BASE_PATH = /work/patmills
LIB_PATH = $(BASE_PATH)/lib
INCLUDE_PATH = $(BASE_PATH)/include
#GSL_INCLUDE = $(INCLUDE_PATH)
GSL_INCLUDE = /opt/sharcnet/gsl/current/include
all: libpetey$(OPT_VER).a
plus:
make install
make OPT_VER=-g install
make OPT_VER=-pg install
make OPT_VER=-O2 install
make -C sparse BASE_PATH=$(BASE_PATH)
make -C datasets BASE_PATH=$(BASE_PATH)
clean_plus:
make clean
make OPT_VER=-g clean
make OPT_VER=-pg clean
make OPT_VER=-O2 clean
make -C sparse BASE_PATH=$(BASE_PATH) clean
make -C datasets BASE_PATH=$(BASE_PATH) clean
install: libpetey$(OPT_VER).a
cp libpetey$(OPT_VER).a $(LIB_PATH)
cp peteys_tmpl_lib.h $(INCLUDE_PATH)
cp time_class.h $(INCLUDE_PATH)
cp string_petey.h $(INCLUDE_PATH)
cp linked.h $(INCLUDE_PATH)
cp tree_tmp.h $(INCLUDE_PATH)
cp bit_array.h $(INCLUDE_PATH)
cp tree_lg.h $(INCLUDE_PATH)
cp tree_lgi.h $(INCLUDE_PATH)
cp kextreme.h $(INCLUDE_PATH)
cp supernewton.h $(INCLUDE_PATH)
# build the static library:
libpetey$(OPT_VER).a: peteys_tmpl_lib$(OPT_VER).o \
tree_tmp$(OPT_VER).o \
time_class$(OPT_VER).o \
string_petey$(OPT_VER).o \
linked$(OPT_VER).o \
bit_array$(OPT_VER).o \
supernewton$(OPT_VER).o \
kextreme$(OPT_VER).o \
tree_lg$(OPT_VER).o \
tree_lgi$(OPT_VER).o
ar -rs libpetey$(OPT_VER).a \
peteys_tmpl_lib$(OPT_VER).o \
tree_tmp$(OPT_VER).o \
time_class$(OPT_VER).o \
string_petey$(OPT_VER).o \
linked$(OPT_VER).o \
bit_array$(OPT_VER).o \
supernewton$(OPT_VER).o \
kextreme$(OPT_VER).o \
tree_lg$(OPT_VER).o \
tree_lgi$(OPT_VER).o
# remove all the object files:
clean:
rm -f libpetey*.a
rm -f libpetey*.so
rm -f *.o
# object file for the templated routines:
peteys_tmpl_lib$(OPT_VER).o: peteys_tmpl_lib.cc bin_search.cc heapsort_tmpl.cc \
rk_dumb_tmpl.cc treesort.cpp
$(CPP) $(CFLAGS) -c peteys_tmpl_lib.cc -o $@
# compile a templated linked list class:
linked$(OPT_VER).o: linked.cc linked.h time_class.h string_petey.h
$(CPP) $(CFLAGS) -c linked.cc -o $@
# compile the time class:
time_class$(OPT_VER).o: time_class.cc time_class.h
$(CPP) $(CFLAGS) -c time_class.cc -o $@
# compile the string class (not well tested--use with caution...)
string_petey$(OPT_VER).o: string_petey.cc string_petey.h
$(CPP) $(CFLAGS) -c string_petey.cc -o $@
# compile the tree class (not well tested--use with caution...)
tree_tmp$(OPT_VER).o: tree_tmp.cpp tree_tmp.h time_class.h string_petey.h
$(CPP) $(CFLAGS) -c tree_tmp.cpp -o $@
# compile bit array class:
bit_array$(OPT_VER).o: bit_array.cc bit_array.h
$(CPP) $(CFLAGS) -c bit_array.cc -o $@
# compile the supernewton root-finding algorithm:
supernewton$(OPT_VER).o: supernewton.cc
# this one requires the GSL library:
$(CPP) $(CFLAGS) -I$(GSL_INCLUDE) -c supernewton.cc -o supernewton$(OPT_VER).o
# compile the k-extreme search algorithm:
kextreme$(OPT_VER).o: kextreme.cc kextreme.h tree_lg.h tree_lgi.h
$(CPP) $(CFLAGS) -c kextreme.cc -o $@
tree_lgi$(OPT_VER).o: tree_lgi.cc tree_lgi.h
$(CPP) $(CFLAGS) -c tree_lgi.cc -o $@
tree_lg$(OPT_VER).o: tree_lg.cc tree_lg.h
$(CPP) $(CFLAGS) -c tree_lg.cc -o $@