File: Makefile

package info (click to toggle)
murasaki 1.68.6-6
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,928 kB
  • ctags: 3,100
  • sloc: cpp: 16,010; perl: 8,365; makefile: 186
file content (249 lines) | stat: -rw-r--r-- 7,241 bytes parent folder | download | duplicates (4)
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
## Murasaki project Makefile
# by Kris Popendorf 

###########################
# End-user configurable parts:
# There are a few options here that the end user might want to adjust
# if the defaults cause problems.
##

## if you have MPI but don't want to use it, uncomment this line:
#USE_MPI=NO
## if have the Crypto++ library but you don't want to use it (or if the autodetect is failing) comment out this line. Or make it YES if you want to force its use despite autodetect failing.
#WITH_LIBCRYPTOPP = NO

#If your libraries (boost/cryptopp) are in another directory, add them here:
INCLUDE	 += -I/usr/include/pstreams
LDLIBS    = -lboost_regex -lboost_filesystem -lboost_iostreams -lboost_system $(LDFLAGS)
##some systems might use this boost naming scheme, but they're a minority at this point
#LDLIBS    = -lboost_regex -lboost_filesystem -lboost_iostreams 
CPPFLAGS += $(OPTIM) $(INCLUDE) -Wall $(MARCH)
LDFLAGS  += $(LIBPATH)

## if you're really strapped for memory, commenting this out may save you a little memory at the cost of losing the ability to handle >2Gbp sequences
LARGESEQ_SUPPORT ?= YES

#######
# End users can/should stop modifying here
#####

## if you're desperately trying to compile for windows, you'll want to uncomment this line and adjust the section below
#WITH_MINGW ?= YES
MINGW_HOME ?= /usr/i586-mingw32msvc
ifeq "$(WITH_MINGW)" "YES"
CPPFLAGS += -D_WIN32_WINNT=0x500 -DWINVER=0x500 # Windows2000 and later

INCLUDE   += -I$(MINGW_HOME)/include
LIBPATH   += -L$(MINGW_HOME)/lib -L$(MINGW_HOME)/GTK/lib # GTK/lib for zlib
LDLIBS += -lboost_system -lz -lbz2 -lm
endif


#autodetect MPI/cryptopp availability
USE_MPI ?= $(shell perl makeconf.pl HASMPI)
WITH_LIBCRYPTOPP ?= $(shell perl makeconf.pl HASCRYPTOPP $(CXX) $(CPPFLAGS) $(LDFLAGS))

## debug related options. end users shouldn't change
#GPROF ?= YES
#WITH_SHM_MMAP ?= YES
WITH_SHM_SYSV ?= YES

OPTIM += -O3
OPTIM += -DNDEBUG
OPTIM += -g

#sane defaults. when using MPI, the make default doesn't cut it.
ifeq "$(USE_MPI)" "YES"
DEFAULT_CXX = mpicxx
else
DEFAULT_CXX := $(CXX)
endif

ifeq "${origin CXX}" "default"
CXX = $(DEFAULT_CXX)
else
CXX ?= $(DEFAULT_CXX)
endif

#openhash specific options:
#CPPFLAGS += -DHASHPROFILE

MACOS_ARCH ?= ppc # ppc64

BINDIR = ..
DEPEND= gccmakedep
TMP = /tmp

#------------- Architecture stuff ---------

UNAME ?= ${shell uname -m}

ifeq "$(UNAME)" "i686"
#MARCH ?= -march=k8
endif
ifeq "$(UNAME)" "x86_64"
#MARCH ?= -march=opteron
endif
ifeq "$(UNAME)" "Darwin"
MARCH ?= -arch $(MACOS_ARCH)
endif
ifeq "$(UNAME)" "Power Macintosh"
MARCH ?= -arch $(MACOS_ARCH)
endif

#------------- Options --------------------

ifeq "$(GPROF)" "YES"
LDFLAGS	 += -pg
CPPFLAGS	 += -pg
CPPFLAGS += -pg
endif

ifeq "$(USE_MPI)" "YES"
CPPFLAGS   += -DMURASAKI_MPI
#CPPFLAGS   += -I/usr/lib/mpich/include -I/usr/local/mpich/include
#OPT_LIBS += -L/usr/lib/mpich/lib     -L/usr/local/mpich/lib -lmpich

#note: MPI requierd to use MMAP/SYSV (thus contained in MPI if)
ifeq "$(WITH_SHM_MMAP)" "YES"
CPPFLAGS += -DUSE_SHM_MMAP
endif

ifeq "$(WITH_SHM_SYSV)" "YES"
CPPFLAGS += -DUSE_SHM_SYSV
endif

endif

ifeq "$(LARGESEQ_SUPPORT)" "YES"
CPPFLAGS += -DLARGESEQ_SUPPORT
endif

ifeq "$(WITH_LIBCRYPTOPP)" "YES"
LDLIBS += -lcryptopp -pthread
#the way we use libcrypto actually breaks strict-aliasing rules (we convert bytes to words directly), so, just turn that off
CPPFLAGS += -DUSE_LIBCRYPTOPP -fno-strict-aliasing
endif

#------------- SVN Version info -----------

SVNREVISION=$(shell perl svninfo.pl)
ifneq "$(SVNREVISION)" ""
CPPFLAGS += -DSVNREVISION='$(SVNREVISION)'
endif

#------------- HG Version info -----------

HGREVISION=$(shell perl hginfo.pl)
ifneq "$(HGREVISION)" ""
CPPFLAGS += -DHGREVISION='$(HGREVISION)'
endif

#------------- Project files --------------

PROGRAM = $(BINDIR)/murasaki

SRCS = align-and.cc align-best.cc align-compare.cc align-coverage.cc align-mask.cc alignments.cc align-or.cc align-tc.cc arrayhash.cc cgr.cc cgr-compare.cc cgr-image.cc cgr-random.cc cgr-sample.cc dinkymath.cc ecohash.cc ecolist.cc geneparse.cc genopts.cc getsegments.cc msethash.cc murasaki.cc murasaki_mpi.cc openhash.cc options.cc scoring.cc seqread.cc sequence.cc timing.cc binseq.cc

OBJ = murasaki.o timing.o dinkymath.o sequence.o msethash.o options.o ecohash.o ecolist.o murasaki_mpi.o arrayhash.o seqread.o scoring.o openhash.o genopts.o binseq.o

ifeq "$(WITH_MINGW)" "YES"
SRCS += mingw32compat.cc
OBJ += mingw32compat.o
endif

PROG2 = $(BINDIR)/cgr-image
PROG3 = $(BINDIR)/cgr-compare
PROG4 = $(BINDIR)/cgr-random
PROG5 = $(BINDIR)/cgr-sample
PROG6 = $(BINDIR)/testeco
PROG7 = $(BINDIR)/align-compare
PROG8 = $(BINDIR)/align-or
PROG9 = $(BINDIR)/geneparse
PROG10 = $(BINDIR)/align-and
PROG11 = $(BINDIR)/align-best
PROG12 = $(BINDIR)/align-coverage
PROG13 = $(BINDIR)/getsegments
PROG16 = $(BINDIR)/mbfa


OBJ2 = cgr-image.o cgr.o dinkymath.o timing.o seqread.o  genopts.o
OBJ3 = cgr-compare.o cgr.o dinkymath.o timing.o
OBJ4 = cgr-random.o cgr.o dinkymath.o timing.o
OBJ5 = cgr.o cgr-sample.o seqread.o genopts.o
OBJ6 = testeco.o ecolist.o dinkymath.o timing.o
OBJ7 = align-compare.o dinkymath.o alignments.o timing.o
OBJ8 = align-or.o alignments.o dinkymath.o timing.o
OBJ9 = geneparse.o seqread.o genopts.o
OBJ10 = align-and.o alignments.o dinkymath.o timing.o
OBJ11 = align-best.o alignments.o dinkymath.o timing.o
OBJ12 = align-coverage.o alignments.o dinkymath.o timing.o seqread.o genopts.o
OBJ13 = getsegments.o seqread.o genopts.o
OBJ16 = mbfa.o dinkymath.o timing.o seqread.o binseq.o genopts.o

ALLPROGS = $(PROGRAM) $(PROG2) $(PROG3) $(PROG4) $(PROG5) $(PROG6) $(PROG7) $(PROG8) $(PROG9) $(PROG10) $(PROG11) $(PROG12) $(PROG13) $(PROG16)

#------------- Make rules -----------------

.cc.o:
	$(CXX) $(CPPFLAGS) -c $<

.cpp.o:
	$(CXX) $(CPPFLAGS) -c $<

#------------- Commands -------------------

all: $(ALLPROGS) Makefile

clean:
	-rm -rf *.o *~ .*~ core $(ALLPROGS)

depend: $(SRCS) Makefile
	$(DEPEND)  -- $(CPPFLAGS) -- $(SRCS) 2> $(TMP)/depend-errors

$(PROGRAM): $(OBJ)
	$(CXX) $(CPPFLAGS) -o $(PROGRAM) $(OBJ) $(OPT_LIBS) $(LIBPATH) $(LDLIBS)

$(PROG2): $(OBJ2)
	$(CXX) $(CPPFLAGS) -o $(PROG2) $(OBJ2) $(LIBPATH) $(LIBCGR) $(LDLIBS)

$(PROG3): $(OBJ3)
	$(CXX) $(CPPFLAGS) -o $(PROG3) $(OBJ3) $(LIBPATH) $(LIBCGR) $(LDLIBS)

$(PROG4): $(OBJ4)
	$(CXX) $(CPPFLAGS) -o $(PROG4) $(OBJ4) $(LIBPATH) $(LIBCGR) $(LDLIBS)

$(PROG5): $(OBJ5)
	$(CXX) $(CPPFLAGS) -o $(PROG5) $(OBJ5) $(LIBPATH) $(LIBCGR) $(LDLIBS)

$(PROG6): $(OBJ6)
	$(CXX) $(CPPFLAGS) -o $(PROG6) $(OBJ6) $(LIBPATH) $(LDLIBS)

$(PROG7): $(OBJ7)
	$(CXX) $(CPPFLAGS) -o $(PROG7) $(OBJ7) $(LIBPATH) $(LDLIBS)

$(PROG8): $(OBJ8)
	$(CXX) $(CPPFLAGS) -o $(PROG8) $(OBJ8) $(LIBPATH) $(LDLIBS)

$(PROG9): $(OBJ9)
	$(CXX) $(CPPFLAGS) -o $(PROG9) $(OBJ9) $(LIBPATH) $(LDLIBS)

$(PROG10): $(OBJ10)
	$(CXX) $(CPPFLAGS) -o $(PROG10) $(OBJ10) $(LIBPATH) $(LDLIBS)

$(PROG11): $(OBJ11)
	$(CXX) $(CPPFLAGS) -o $(PROG11) $(OBJ11) $(LIBPATH) $(LDLIBS)

$(PROG12): $(OBJ12)
	$(CXX) $(CPPFLAGS) -o $(PROG12) $(OBJ12) $(LIBPATH) $(LDLIBS)

$(PROG13): $(OBJ13)
	$(CXX) $(CPPFLAGS) -o $(PROG13) $(OBJ13) $(LIBPATH) $(LDLIBS)

$(PROG16): $(OBJ16)
	$(CXX) $(CPPFLAGS) -o $(PROG16) $(OBJ16) $(LIBPATH) $(LDLIBS)

codesize:
	wc $(SRCS)

##magical makedepend dependencies