[go: up one dir, main page]

Menu

[r69]: / libpetey / makefile  Maximize  Restore  History

Download this file

166 lines (138 with data), 5.4 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#
# 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=-g
CPP = g++
CFLAGS = $(OPT) -Wno-deprecated
BASE_PATH = /home/Petey
#BASE_PATH = /home/home/pmills
#BASE_PATH = /home/pmills
LIB_PATH = $(BASE_PATH)/lib
INCLUDE_PATH = $(BASE_PATH)/include
BIN_PATH = $(BASE_PATH)/bin
GSL_INCLUDE = $(INCLUDE_PATH)
#GSL_INCLUDE = /opt/sharcnet/gsl/current/include
VPATH = datasets/ sparse/
all: libpetey$(OPT).a libdataset$(OPT).a libsparse$(OPT).a
libdataset$(OPT).a: install_petey
make -C datasets LIB_DIR=$(LIB_PATH) INCLUDE_DIR=$(INCLUDE_PATH) OPT_VER=$(OPT)
libsparse$(OPT).a: install_petey
make -C sparse LIB_PATH=$(LIB_PATH) INCLUDE_PATH=$(INCLUDE_PATH) \
BIN_PATH=$(BIN_PATH) OPT_VER=$(OPT)
allopt:
make OPT=-g all
make OPT=-pg all
make OPT=-O2 all
clean:
rm -f libpetey*.a
rm -f libpetey*.so
rm -f *.o
make -C sparse OPT=$(OPT) clean_all
make -C datasets OPT_VER=$(OPT) clean
make -C datasets clean
make -C datasets OPT_VER=-g clean
make -C datasets OPT_VER=-pg clean
make -C datasets OPT_VER=-O2 clean
install_petey: libpetey$(OPT).a
cp libpetey$(OPT).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)
cp parse_command_opts.h $(INCLUDE_PATH)
cp error_codes.h $(INCLUDE_PATH)
install: install_petey
make install -C datasets LIB_DIR=$(LIB_PATH) INCLUDE_DIR=$(INCLUDE_PATH) OPT_VER=$(OPT)
make install -C sparse LIB_PATH=$(LIB_PATH) INCLUDE_PATH=$(INCLUDE_PATH) \
BIN_PATH=$(BIN_PATH) OPT_VER=$(OPT)
install_allopt: libpetey-g.a libpetey-O2.a libpetey-pg.a
cp libpetey-g.a $(LIB_PATH)
cp libpetey-O2.a $(LIB_PATH)
cp libpetey-pg.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)
cp parse_command_opts.h $(INCLUDE_PATH)
make install -C datasets LIB_DIR=$(LIB_PATH) INCLUDE_DIR=$(INCLUDE_PATH) OPT_VER=-g
make install -C sparse LIB_PATH=$(LIB_PATH) INCLUDE_PATH=$(INCLUDE_PATH) \
BIN_PATH=$(BIN_PATH) OPT_VER=-g
make install -C datasets LIB_DIR=$(LIB_PATH) INCLUDE_DIR=$(INCLUDE_PATH) OPT_VER=-O2
make install -C sparse LIB_PATH=$(LIB_PATH) INCLUDE_PATH=$(INCLUDE_PATH) \
BIN_PATH=$(BIN_PATH) OPT_VER=-O2
make install -C datasets LIB_DIR=$(LIB_PATH) INCLUDE_DIR=$(INCLUDE_PATH) OPT_VER=-pg
make install -C sparse LIB_PATH=$(LIB_PATH) INCLUDE_PATH=$(INCLUDE_PATH) \
BIN_PATH=$(BIN_PATH) OPT_VER=-pg
# build the static library:
libpetey$(OPT).a: peteys_tmpl_lib$(OPT).o \
tree_tmp$(OPT).o \
time_class$(OPT).o \
string_petey$(OPT).o \
linked$(OPT).o \
bit_array$(OPT).o \
supernewton$(OPT).o \
kextreme$(OPT).o \
tree_lg$(OPT).o \
tree_lgi$(OPT).o \
parse_command_opts$(OPT).o
ar -rs libpetey$(OPT).a \
peteys_tmpl_lib$(OPT).o \
tree_tmp$(OPT).o \
time_class$(OPT).o \
string_petey$(OPT).o \
linked$(OPT).o \
bit_array$(OPT).o \
supernewton$(OPT).o \
kextreme$(OPT).o \
tree_lg$(OPT).o \
tree_lgi$(OPT).o \
parse_command_opts$(OPT).o
# object file for the templated routines:
peteys_tmpl_lib$(OPT).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).o: linked.cc linked.h time_class.h string_petey.h
$(CPP) $(CFLAGS) -c linked.cc -o $@
# compile the time class:
time_class$(OPT).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).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).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).o: bit_array.cc bit_array.h
$(CPP) $(CFLAGS) -c bit_array.cc -o $@
# compile the supernewton root-finding algorithm:
supernewton$(OPT).o: supernewton.cc
# this one requires the GSL library:
$(CPP) $(CFLAGS) -I$(GSL_INCLUDE) -c supernewton.cc -o supernewton$(OPT).o
# compile the k-extreme search algorithm:
kextreme$(OPT).o: kextreme.cc kextreme.h tree_lg.h tree_lgi.h
$(CPP) $(CFLAGS) -c kextreme.cc -o $@
tree_lgi$(OPT).o: tree_lgi.cc tree_lgi.h string_operators.h
$(CPP) $(CFLAGS) -c tree_lgi.cc -o $@
tree_lg$(OPT).o: tree_lg.cc tree_lg.h string_operators.h
$(CPP) $(CFLAGS) -c tree_lg.cc -o $@
parse_command_opts$(OPT).o: parse_command_opts.cc parse_command_opts.h
$(CPP) $(CFLAGS) -c parse_command_opts.cc -o $@