-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
51 lines (37 loc) · 1.18 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
CC=g++
AR=ar
MAKE_PID := $(shell echo $$PPID)
JOBS := $(shell ps T | sed -n 's%.*$(MAKE_PID).*$(MAKE).* \(-j\|--jobs=\) *\([0-9][0-9]*\).*%\2%p')
#CPPFLAGS= -Wall -g -Lhtslib -lhts -Lcrelib -lcre optutils/opthelper.a --std=c++17
CPPFLAGS= --std=c++17 -O3 -fopenmp
LDFLAGS= -fopenmp
# CPPFLAGS= --std=c++17 -g -fopenmp -pg
# LDFLAGS= -fopenmp -lboost_iostreams -lboost_serialization -pg
HTSLIBDIR=htslib
HTSLIB=$(HTSLIBDIR)/libhts.a
SUBMODULES=optutils $(HTSLIB)
PROJECT_OBJS=lrsim.o
PROJECT_HEADERS=
EXAMPLE_OBJS=
LAUNCHER=./launcher
ifeq ($(PREFIX),)
PREFIX := /usr/local
endif
.PHONY: all clean $(SUBMODULES)
all: build
build: $(SUBMODULES) lrsim
$(HTSLIB): $(HTSLIBDIR)/config.status
make -C $(HTSLIBDIR) -j $(JOBS)
optutils:
make -C $@
$(HTSLIBDIR)/config.status:
cd $(HTSLIBDIR) && autoreconf -i && ./configure
$(PROJECT_OBJS): $(PROJECT_HEADERS)
HTSLIB_LIBS = -lz -lm -lbz2 -llzma -lcurl -lpthread -lcrypto -ldeflate
lrsim: $(PROJECT_OBJS) $(SUBMODULES) optutils/opthelper.a
$(CC) $(PROJECT_OBJS) -o $@ $(LDFLAGS) $(HTSLIBDIR)/libhts.a $(HTSLIB_LIBS) optutils/opthelper.a --std=c++17
clean:
rm *.o lrsim
install: lrsim
install -d $(PREFIX)/bin/
install -m 755 lrsim $(PREFIX)/bin/