File: Makefile

package info (click to toggle)
libvcflib 1.0.0~rc1%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 46,836 kB
  • ctags: 1,488
  • sloc: cpp: 27,298; makefile: 177; ansic: 139; python: 46; perl: 26; sh: 19
file content (212 lines) | stat: -rw-r--r-- 6,067 bytes parent folder | download | duplicates (2)
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
#OBJ_DIR = ./
HEADERS = src/Variant.h \
		  src/split.h \
		  src/pdflib.hpp \
		  src/var.hpp \
                  src/cdflib.hpp \
		  src/rnglib.hpp \
		  src/join.h
SOURCES = src/Variant.cpp \
		  src/rnglib.cpp \
		  src/var.cpp \
		  src/pdflib.cpp \
		  src/cdflib.cpp \
		  src/split.cpp
OBJECTS= $(SOURCES:.cpp=.o)

VCF_LIB_LOCAL:=$(shell pwd)
BIN_DIR:=binaries
LIB_DIR:=lib
SRC_DIR=src
INC_DIR:=include
OBJ_DIR:=obj

# TODO
#vcfstats.cpp

BIN_SOURCES = src/vcfecho.cpp \
			  src/dumpContigsFromHeader.cpp \
			  src/bFst.cpp \
			  src/hapLrt.cpp \
			  src/popStats.cpp \
			  src/wcFst.cpp \
			  src/iHS.cpp \
			  src/segmentFst.cpp \
			  src/segmentIhs.cpp \
			  src/genotypeSummary.cpp \
			  src/sequenceDiversity.cpp \
			  src/pFst.cpp \
			  src/smoother.cpp \
			  src/LD.cpp \
			  src/plotHaps.cpp \
			  src/abba-baba.cpp \
			  src/permuteGPAT++.cpp \
			  src/permuteSmooth.cpp \
			  src/normalize-iHS.cpp \
			  src/meltEHH.cpp \
			  src/vcfaltcount.cpp \
			  src/vcfhetcount.cpp \
			  src/vcfhethomratio.cpp \
			  src/vcffilter.cpp \
			  src/vcf2tsv.cpp \
			  src/vcfgenotypes.cpp \
			  src/vcfannotategenotypes.cpp \
			  src/vcfcommonsamples.cpp \
			  src/vcfremovesamples.cpp \
			  src/vcfkeepsamples.cpp \
			  src/vcfsamplenames.cpp \
			  src/vcfgenotypecompare.cpp \
			  src/vcffixup.cpp \
			  src/vcfclassify.cpp \
			  src/vcfsamplediff.cpp \
			  src/vcfremoveaberrantgenotypes.cpp \
			  src/vcfrandom.cpp \
			  src/vcfparsealts.cpp \
			  src/vcfstats.cpp \
			  src/vcfflatten.cpp \
			  src/vcfprimers.cpp \
			  src/vcfnumalt.cpp \
			  src/vcfcleancomplex.cpp \
			  src/vcfintersect.cpp \
			  src/vcfannotate.cpp \
			  src/vcfallelicprimitives.cpp \
			  src/vcfoverlay.cpp \
			  src/vcfaddinfo.cpp \
			  src/vcfkeepinfo.cpp \
			  src/vcfkeepgeno.cpp \
			  src/vcfafpath.cpp \
			  src/vcfcountalleles.cpp \
			  src/vcflength.cpp \
			  src/vcfdistance.cpp \
			  src/vcfrandomsample.cpp \
			  src/vcfentropy.cpp \
			  src/vcfglxgt.cpp \
			  src/vcfroc.cpp \
			  src/vcfcheck.cpp \
			  src/vcfstreamsort.cpp \
			  src/vcfuniq.cpp \
			  src/vcfuniqalleles.cpp \
			  src/vcfremap.cpp \
			  src/vcf2fasta.cpp \
			  src/vcfsitesummarize.cpp \
			  src/vcfbreakmulti.cpp \
			  src/vcfcreatemulti.cpp \
			  src/vcfevenregions.cpp \
			  src/vcfcat.cpp \
			  src/vcfgenosummarize.cpp \
			  src/vcfgenosamplenames.cpp \
			  src/vcfgeno2haplo.cpp \
			  src/vcfleftalign.cpp \
			  src/vcfcombine.cpp \
			  src/vcfgeno2alleles.cpp \
			  src/vcfindex.cpp \
			  src/vcf2dag.cpp \
			  src/vcfsample2info.cpp \
			  src/vcfqual2info.cpp \
			  src/vcfinfo2qual.cpp \
			  src/vcfglbound.cpp \
			  src/vcfinfosummarize.cpp

# when we can figure out how to build on mac
# src/vcfsom.cpp

#BINS = $(BIN_SOURCES:.cpp=)
BINS = $(addprefix $(BIN_DIR)/,$(notdir $(BIN_SOURCES:.cpp=)))
SHORTBINS = $(notdir $(BIN_SOURCES:.cpp=))

# TABIX = tabixpp/tabix.o
# SMITHWATERMAN = smithwaterman/SmithWatermanGotoh.o
# REPEATS = smithwaterman/Repeats.o
# INDELALLELE = smithwaterman/IndelAllele.o
# DISORDER = smithwaterman/disorder.o
# LEFTALIGN = smithwaterman/LeftAlign.o
FSOM = fsom/fsom.o
FILEVERCMP = filevercmp/filevercmp.o

INCLUDES = `pkg-config --cflags libsmithwaterman` `pkg-config --cflags libfastahack` -I$(INC_DIR)
LDFLAGS += -L$(LIB_DIR) -lvcflib -lhts -lpthread -lz -lm -fopenmp -ltabixpp `pkg-config --libs libsmithwaterman` `pkg-config --libs libfastahack` -ldisorder

all: $(OBJECTS) $(BINS)


GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always)

CXX = g++
CXXFLAGS = -O3 -D_FILE_OFFSET_BITS=64 -std=c++0x -DVERSION=\"$(GIT_VERSION)\"
#CXXFLAGS = -O2
#CXXFLAGS = -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-qual

SSW = 

openmp:
	$(MAKE) CXXFLAGS="$(CXXFLAGS) -fopenmp -D HAS_OPENMP"

profiling:
	$(MAKE) CXXFLAGS="$(CXXFLAGS) -g" all

gprof:
	$(MAKE) CXXFLAGS="$(CXXFLAGS) -pg" all

$(OBJECTS): $(SOURCES) $(HEADERS) multichoose pre $(SMITHWATERMAN) $(FILEVERCMP)
	$(CXX) -c $(CFLAGS) -fPIC -o $@ src/$(*F).cpp $(INCLUDES) $(LDFLAGS) $(CXXFLAGS) && cp src/*.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/

multichoose: pre
	echo "Source does not contain dir multichoose"
	# cd multichoose && $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/

intervaltree: pre
	echo "Source does not contain dir intervaltree"
	# cd intervaltree && $(MAKE) && cp *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
	mkdir -p $(VCF_LIB_LOCAL)/$(INC_DIR)/ && cp -a debian/include/* $(VCF_LIB_LOCAL)/$(INC_DIR)/

#$(FSOM):
#	cd fsom && $(CXX) $(CXXFLAGS) -c fsom.c -lm

$(FILEVERCMP): pre
	#mkdir -p filevercmp
	#cp /usr/share/gnulib/lib/filevercmp.* filevercmp
	#echo 'Proper use of filevercmp would be: `gnulib-tool --import filevercmp` - but it needs ./configure.ac'
	#We here go with quilt patches from upstream files
	cd filevercmp && $(CXX) $(CXXFLAGS) -fPIC -c filevercmp.c
	ln -sf ../filevercmp/filevercmp.h $(VCF_LIB_LOCAL)/$(INC_DIR)/filevercmp.h

$(SHORTBINS): pre
	$(MAKE) $(BIN_DIR)/$@

$(BINS): $(BIN_SOURCES) libvcflib.so $(OBJECTS) $(SMITHWATERMAN) $(DISORDER) $(LEFTALIGN) $(INDELALLELE) $(SSW) $(FILEVERCMP) pre intervaltree
	$(CXX) src/$(notdir $@).cpp -o $@ $(INCLUDES) $(LDFLAGS) $(CXXFLAGS)

libvcflib.so: $(OBJECTS) $(SMITHWATERMAN) $(REPEATS) $(DISORDER) $(LEFTALIGN) $(INDELALLELE) $(SSW) $(FILEVERCMP) pre
	# ar rs libvcflib.a $(OBJECTS) $(SSW) $(FILEVERCMP)
	gcc -shared  -Wl,-soname -Wl,libvcflib.so.1 -o libvcflib.so.1 $(OBJECTS) $(SSW) $(FILEVERCMP)
	ln -s libvcflib.so.1 libvcflib.so
	cp -a libvcflib.so* $(LIB_DIR)

test: $(BINS)
	@prove -Itests/lib -w tests/*.t

pre:
	if [ ! -d $(BIN_DIR) ]; then mkdir -p $(BIN_DIR); fi
	if [ ! -d $(LIB_DIR) ]; then mkdir -p $(LIB_DIR); fi
	if [ ! -d $(INC_DIR) ]; then mkdir -p $(INC_DIR); fi
	if [ ! -d $(OBJ_DIR) ]; then mkdir -p $(OBJ_DIR); fi


pull:
	git pull

update: pull all

clean:
	rm -f $(BINS) $(OBJECTS)
	rm -f ssw_cpp.o ssw.o
	rm -f libvcflib.so
	rm -rf $(BIN_DIR)
	rm -rf $(LIB_DIR)
	rm -rf $(INC_DIR)
	rm -rf $(OBJ_DIR)
	# cd tabixpp && make clean
	# cd smithwaterman && make clean
	# cd fastahack && make clean

.PHONY: clean all test pre