-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
96 lines (76 loc) · 2.36 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
95
96
# programs
TARGET := gencore
SRCS := $(wildcard *.cpp)
OBJS := $(SRCS:.cpp=.o)
# directories
CURRENT_DIR := $(shell pwd)
BIN_DIR := $(CURRENT_DIR)/bin
# compiler
GXX := g++
CXXFLAGS = -Wall -Wextra -O2 -std=c++11
TIME := /usr/bin/time -v
# object files that need lcptools
LCPTOOLS_CXXFLAGS := -I$(CURRENT_DIR)/lcptools/include
LCPTOOLS_LDFLAGS := -L$(CURRENT_DIR)/lcptools/lib -llcptools -Wl,-rpath,$(CURRENT_DIR)/lcptools/lib -lz
HTSLIB_CXXFLAGS := -I$(CURRENT_DIR)/htslib/include
HTSLIB_LDFLAGS := -L$(CURRENT_DIR)/htslib/lib -lhts -Wl,-rpath,$(CURRENT_DIR)/htslib/lib -pthread
$(TARGET): $(OBJS)
$(GXX) $(CXXFLAGS) -o $@ $^ $(LCPTOOLS_LDFLAGS) $(HTSLIB_LDFLAGS)
rm *.o
chtslib.o: chtslib.cpp
$(GXX) $(CXXFLAGS) $(HTSLIB_CXXFLAGS) -c $< -o $@
rbam.o: rbam.cpp
$(GXX) $(CXXFLAGS) $(HTSLIB_CXXFLAGS) $(LCPTOOLS_CXXFLAGS) -c $< -o $@
gencore.o: gencore.cpp
$(GXX) $(CXXFLAGS) $(HTSLIB_CXXFLAGS) $(LCPTOOLS_CXXFLAGS) -c $< -o $@
fileio.o: fileio.cpp
$(GXX) $(CXXFLAGS) $(LCPTOOLS_CXXFLAGS) -c $< -o $@
helper.o: helper.cpp
$(GXX) $(CXXFLAGS) $(LCPTOOLS_CXXFLAGS) -c $< -o $@
rfasta.o: rfasta.cpp
$(GXX) $(CXXFLAGS) $(LCPTOOLS_CXXFLAGS) -c $< -o $@
rfastq.o: rfastq.cpp
$(GXX) $(CXXFLAGS) $(LCPTOOLS_CXXFLAGS) -c $< -o $@
%.o: %.cpp
$(GXX) $(CXXFLAGS) -c $< -o $@
# dependencies
chtslib.o:
fileio.o: helper.o similarity_metrics.o
gencore.o: init.o rbam.o rfasta.o rfastq.o similarity_metrics.o
helper.o:
init.o: logging.o
logging.o:
rbam.o: similarity_metrics.o chtslib.o
rfasta.o: similarity_metrics.o helper.o fileio.o
rfastq.o: helper.o similarity_metrics.o
similarity_metrics.o: logging.o
clean:
@echo "Cleaning"
rm -f $(OBJS)
rm -f $(TARGET)
install: clean install-htslib install-lcptools $(TARGET)
install-htslib:
@echo "Installing htslib"
cd htslib && \
autoreconf -i && \
./configure && \
make && \
make prefix=$(CURRENT_DIR)/htslib install
reinstall-htslib:
@echo "Re-installing htslib"
git submodule deinit -f -- htslib
rm -rf htslib
git submodule update --init --recursive
install-lcptools:
@echo "Installing lcptool"
cd lcptools && \
make install PREFIX=$(CURRENT_DIR)/lcptools
reinstall-lcptools:
@echo "Re-installing lcptools"
git submodule deinit -f -- lcptools
rm -rf lcptools
git submodule update --init --recursive
recompile-lcptools:
cd lcptools && \
make uninstall PREFIX=$(CURRENT_DIR)/lcptools && \
make install PREFIX=$(CURRENT_DIR)/lcptools