-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
95 lines (74 loc) · 2.03 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
PROG_VERSION := 0.0.10
VERBOSITY := 0
all: OPTIMIZE_FLAGS build
log1: LOG1_FLAG OPTIMIZE_FLAGS build
log2: LOG2_FLAG OPTIMIZE_FLAGS build
log3: LOG3_FLAG OPTIMIZE_FLAGS build
debug: DEBUG_FLAGS build
profile: PROFILE_FLAGS build
build: clean-exe clasplib bwalib lordfast clean
CC ?= gcc
CXX ?= g++
SRCDIR := src
LIBDIR := lib
CLASPDIR := $(LIBDIR)/clasp
BWADIR := $(LIBDIR)/bwa
EDLIBDIR := $(LIBDIR)/edlib
INCS := -I$(CLASPDIR) -I$(BWADIR) -I$(EDLIBDIR)
LIBS := -lz -lpthread
CFLAGS := -w
CXXFLAGS := -w -DPROG_VERSION=\"$(PROG_VERSION)\" $(INCS)
LORDFASTOBJ = $(SRCDIR)/baseFAST.o \
$(SRCDIR)/Common.o \
$(SRCDIR)/CommandLineParser.o \
$(SRCDIR)/Reads.o \
$(SRCDIR)/BWT.o \
$(SRCDIR)/LordFAST.o \
$(SRCDIR)/Chain.o \
$(EDLIBDIR)/edlib.o \
HELP.o \
CLASPOBJ = $(CLASPDIR)/*.o
BWAOBJ = $(BWADIR)/*.o
lordfast: $(LORDFASTOBJ)
ifeq ($(shell uname -s),Linux)
$(CXX) -w $(LORDFASTOBJ) $(BWAOBJ) $(CLASPOBJ) -o $@ ${LDFLAGS} ${LIBS}
else
$(CXX) -Wl,-no_pie -w $(LORDFASTOBJ) $(BWAOBJ) $(CLASPOBJ) -o $@ ${LDFLAGS} ${LIBS}
endif
clasplib:
@$(MAKE) -C $(CLASPDIR)
bwalib:
@$(MAKE) -C $(BWADIR)
clean:
@rm -f $(LORDFASTOBJ)
@rm -f HELPstub.c
@rm -f HELPstub.o
clean-exe:
@rm -f lordfast
@rm -f HELP
clean-all: clean-exe clean
@$(MAKE) -C $(CLASPDIR) clean
@$(MAKE) -C $(BWADIR) clean
HELP.o:
@groff -Tascii -man HELP.man > HELP
ifeq ($(shell uname -s),Linux)
@ld -r -b binary -o HELP.o HELP
else
@touch HELPstub.c
gcc -o HELPstub.o -c HELPstub.c
ld -r -o HELP.o -sectcreate binary HELP HELP HELPstub.o
endif
DEBUG_FLAGS:
$(eval CXXFLAGS = $(CXXFLAGS) -ggdb)
$(eval LIBS = $(LIBS) -ggdb)
OPTIMIZE_FLAGS:
$(eval CXXFLAGS = $(CXXFLAGS) -O2 -DVERBOSITY=$(VERBOSITY))
LOG1_FLAG:
$(eval VERBOSITY = 1)
LOG2_FLAG:
$(eval VERBOSITY = 2)
LOG3_FLAG:
$(eval VERBOSITY = 3)
PROFILE_FLAGS:
$(eval CXXFLAGS = $(CXXFLAGS) -pg -g)
$(eval LIBS = $(LIBS) -pg -g)