forked from abyzovlab/CNVnator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
94 lines (79 loc) · 2.34 KB
/
Makefile
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
VERSION = v0.4.1
override LIBS += -lz -lbz2 -lcurl -llzma -lreadline
ifneq ($(wildcard $(ROOTSYS)/lib/root),)
ROOTLIBS = -L$(ROOTSYS)/lib/root -lCore -lRIO -lHist -lGraf -lGpad -lTree -lMathCore
else
ROOTLIBS = -L$(ROOTSYS)/lib -lCore -lRIO -lHist -lGraf -lGpad -lTree -lMathCore
endif
ifneq ($(wildcard $(ROOTSYS)/include/root),)
INC = -I$(ROOTSYS)/include/root -I$(SAMDIR)
else
INC = -I$(ROOTSYS)/include -I$(SAMDIR)
endif
SAMDIR = samtools
SAMLIB = $(SAMDIR)/libbam.a
HTSDIR = $(wildcard $(SAMDIR)/htslib*)
HTSDIRI = $(HTSDIR)/htslib
ifneq ($(HTSDIR),)
SAMLIB += $(HTSDIR)/libhts.a
INC += -I$(HTSDIR) -I$(HTSDIRI)
endif
ifeq ($(OMP),no)
$(info Compiling with NO parallel support)
else
OMPFLAGS = -fopenmp
$(info Compiling with parallel (OpenMP) support)
endif
ifneq ($(YEPPPLIBDIR),)
override LIBS += -L$(YEPPPLIBDIR) -lyeppp
endif
ifneq ($(YEPPPINCLUDEDIR),)
INC += -I$(YEPPPINCLUDEDIR) -DUSE_YEPPP
endif
CXX = g++ -O3 -std=c++11 -DCNVNATOR_VERSION=\"$(VERSION)\" $(OMPFLAGS)
#CXX = g++ -O3 -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11 -DCNVNATOR_VERSION=\"$(VERSION)\" $(OMPFLAGS)
OBJDIR = obj
OBJS = $(OBJDIR)/cnvnator.o \
$(OBJDIR)/EXOnator.o \
$(OBJDIR)/IO.o \
$(OBJDIR)/Visualizer.o \
$(OBJDIR)/HisMaker.o \
$(OBJDIR)/AliParser.o \
$(OBJDIR)/FastaParser.o \
$(OBJDIR)/VcfParser.o \
$(OBJDIR)/Genotyper.o \
$(OBJDIR)/Interval.o \
$(OBJDIR)/Genome.o
DISTRIBUTION = $(PWD)/CNVnator_$(VERSION).zip
TMPDIR = /tmp
CNVDIR = CNVnator_$(VERSION)
MAINDIR = $(TMPDIR)/$(CNVDIR)
SRCDIR = $(MAINDIR)/src
all: cnvnator
cnvnator: $(OBJS)
$(CXX) -o $@ $(OBJS) $(SAMLIB) $(LIBS) $(ROOTLIBS)
$(OBJDIR)/%.o: %.cpp
@mkdir -p $(OBJDIR)
$(CXX) $(INC) -c $< -o $@
clean:
rm -fr $(OBJDIR) cnvnator
distribution: clean all
@echo Creating directory ...
@rm -rf $(MAINDIR)
@rm -f $(DISTRIBUTION)
@mkdir $(MAINDIR)
@mkdir $(SRCDIR)
@echo Copying files ...
@cp *.hh *.cpp $(SRCDIR)
@cp Makefile $(SRCDIR)
@cp README.md $(MAINDIR)
@cp ReleaseNotes.md $(MAINDIR)
@cp INSTALL $(MAINDIR)
@cp CITATION $(MAINDIR)
@cp license.rtf $(MAINDIR)
@cp -r ExampleData $(MAINDIR)
@cp -r pytools cnvnator2VCF.pl plotbaf.py plotrdbaf.py plotcircular.py $(SRCDIR)
@echo Zipping ...
@ln -s $(MAINDIR)
@zip -qr $(DISTRIBUTION) $(CNVDIR)
@rm $(CNVDIR)