-
Notifications
You must be signed in to change notification settings - Fork 2
/
makefile
87 lines (71 loc) · 2.26 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
all: vcfshark
VCFShark_ROOT_DIR=.
VCFShark_MAIN_DIR=src
LIBS_DIR=/usr/local/lib
INCLUDE_DIR=libbsc
HTS_INCLUDE_DIR=htslib/include
HTS_LIB_DIR=htslib/lib
ifdef MSVC # Avoid the MingW/Cygwin sections
uname_S := Windows
else # If uname not available => 'not'
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
endif
ifeq ($(uname_S),Linux)
BSC_LIB_DIR=libbsc/linux
ALLOC=jemalloc/linux/libjemalloc.a
ALLOC_CLINK=-Wl,--no-as-needed -ldl
endif
ifeq ($(uname_S),Darwin)
BSC_LIB_DIR=libbsc/macos
ALLOC_CLINK=
endif
CC = g++
CFLAGS = -Wall -O3 -m64 -std=c++14 -pthread -mavx -I $(HTS_INCLUDE_DIR) -I $(INCLUDE_DIR) -fpermissive
CLINK = -lm -O3 -std=c++14 -pthread -mavx -lz -lbz2 -lcurl -llzma -ldeflate -L $(LIBS_DIR) $(ALLOC_CLINK)
#To build without libdeflate uncomment the line below (and comment the above line).
#CLINK = -lm -O3 -std=c++14 -pthread -mavx -lz -lbz2 -lcurl -llzma -L $(LIBS_DIR) $(ALLOC_CLINK)
# default install location (binary placed in the /bin folder)
prefix = /usr/local
# optional install location
exec_prefix = $(prefix)
%.o: %.cpp
$(CC) $(CFLAGS) -c $< -o $@
vcfshark: $(VCFShark_MAIN_DIR)/application.o \
$(VCFShark_MAIN_DIR)/archive.o \
$(VCFShark_MAIN_DIR)/bsc.o \
$(VCFShark_MAIN_DIR)/buffer.o \
$(VCFShark_MAIN_DIR)/cfile.o \
$(VCFShark_MAIN_DIR)/cfile_impl.o \
$(VCFShark_MAIN_DIR)/format.o \
$(VCFShark_MAIN_DIR)/graph_opt.o \
$(VCFShark_MAIN_DIR)/main.o \
$(VCFShark_MAIN_DIR)/pbwt.o \
$(VCFShark_MAIN_DIR)/text_pp.o \
$(VCFShark_MAIN_DIR)/utils.o \
$(VCFShark_MAIN_DIR)/vcf.o
$(CC) -o $(VCFShark_ROOT_DIR)/$@ \
$(VCFShark_MAIN_DIR)/application.o \
$(VCFShark_MAIN_DIR)/archive.o \
$(VCFShark_MAIN_DIR)/bsc.o \
$(VCFShark_MAIN_DIR)/buffer.o \
$(VCFShark_MAIN_DIR)/cfile.o \
$(VCFShark_MAIN_DIR)/cfile_impl.o \
$(VCFShark_MAIN_DIR)/format.o \
$(VCFShark_MAIN_DIR)/graph_opt.o \
$(VCFShark_MAIN_DIR)/main.o \
$(VCFShark_MAIN_DIR)/pbwt.o \
$(VCFShark_MAIN_DIR)/text_pp.o \
$(VCFShark_MAIN_DIR)/utils.o \
$(VCFShark_MAIN_DIR)/vcf.o \
$(ALLOC) \
$(BSC_LIB_DIR)/libbsc.a \
$(HTS_LIB_DIR)/libhts.a \
$(CLINK)
clean:
-rm $(VCFShark_MAIN_DIR)/*.o
-rm vcfshark
install:
mkdir -p -m 755 $(exec_prefix)/bin
cp vcfshark $(exec_prefix)/bin/
uninstall:
rm $(exec_prefix)/bin/vcfshark