-
Notifications
You must be signed in to change notification settings - Fork 1
/
common.mk
35 lines (26 loc) · 1.04 KB
/
common.mk
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
PP_MAIN_ABSPATH := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
PP_MAIN_RELPATH := $(dir $(lastword $(MAKEFILE_LIST)))
CPP_SOURCES := $(wildcard *.cpp)
CPP_OBJS := $(CPP_SOURCES:.cpp=.o)
DEPENDENCIES := $(CPP_SOURCES:.cpp=.d)
XSQUEEZEITPATH := $(PP_MAIN_RELPATH)/xSqueezeIt/
HTSLIB_PATH := $(XSQUEEZEITPATH)/htslib
ZSTD_PATH := $(XSQUEEZEITPATH)/zstd/lib
ifeq ($(ADD_EXTRA),y)
EXTRA_FLAGS := -fsanitize=address -fsanitize=undefined -fsanitize=pointer-subtract -fsanitize=pointer-compare -fno-omit-frame-pointer -fstack-protector-all -fcf-protection
endif
ifeq ($(OLEVEL),)
OLEVEL := 3
endif
# Use g++
CXX=g++
CC=g++
INCLUDE_DIRS=-I include -I $(PP_MAIN_RELPATH)/include -I $(HTSLIB_PATH) -I $(HTSLIB_PATH)/htslib -I $(ZSTD_PATH) -I ${XSQUEEZEITPATH}/include
CXXFLAGS=-O$(OLEVEL) -g -Wall -std=c++17 $(INCLUDE_DIRS) $(CXXEXTRAFLAGS) $(EXTRA_FLAGS)
ifeq ($(STATIC_BINS),y)
A_LIBS := $(HTSLIB_PATH)/libhts.a $(ZSTD_PATH)/libzstd.a
LDLIBS+=-llzma -lbz2 -lz -lm -lcurl -pthread
else
LDLIBS+=-lhts -lzstd -pthread
endif
LDFLAGS+=-O$(OLEVEL) $(EXTRA_FLAGS)