forked from refresh-bio/GTC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
82 lines (69 loc) · 1.77 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
all: gtc
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
# default install location (binary placed in the /bin folder)
prefix = /usr/local
# optional install location
exec_prefix = $(prefix)
LIBS_DIR=lib
INCLUDES_DIR=include
CFLAGS=-Wall -O3 -m64 -std=c++11 -pthread -I $(INCLUDES_DIR) -mpopcnt
CLINK=-O3 -lm -std=c++11 -lpthread -mpopcnt -lz
ifeq ($(uname_S),Linux)
CC=g++
# check if CPU supports SSE4.2
HAVE_SSE4=$(filter-out 0,$(shell grep sse4.2 /proc/cpuinfo | wc -l))
endif
ifeq ($(uname_S),Darwin)
CC=clang++
# check if CPU supports SSE4.2
HAVE_SSE4=$(filter-out 0,$(shell sysctl machdep.cpu.features| grep SSE4.2 - | wc -l))
endif
CFLAGS+=$(if $(HAVE_SSE4),-msse4.2)
ifeq ($(HAVE_SSE4),)
CFLAGS+=-msse2
endif
.cpp.o:
$(CC) $(CFLAGS) -c $< -o $@
gtc: src/bit_memory.o \
src/block_init_compressor.o \
src/buffered_bm.o \
src/compressed_pack.o \
src/compression_settings.o \
src/decompressor.o \
src/end_compressor.o \
src/huffman.o \
src/main.o \
src/my_vcf.o \
src/samples.o \
src/VCFManager.o \
include/cpp-mmf/memory_mapped_file.o
$(CC) -o gtc \
src/bit_memory.o \
src/block_init_compressor.o \
src/buffered_bm.o \
src/compressed_pack.o \
src/compression_settings.o \
src/decompressor.o \
src/end_compressor.o \
src/huffman.o \
src/main.o \
src/my_vcf.o \
src/samples.o \
src/VCFManager.o \
include/cpp-mmf/memory_mapped_file.o \
$(LIBS_DIR)/libhts.a \
$(LIBS_DIR)/libsdsl.a \
$(CLINK)
clean:
-rm include/cpp-mmf/*.o
-rm src/*.o
-rm gtc
install:
mkdir -p -m 755 $(exec_prefix)/bin
cp gtc $(exec_prefix)/bin/
uninstall:
rm $(exec_prefix)/bin/gtc