File: makefile

package info (click to toggle)
pbseqlib 0~20161219-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,924 kB
  • ctags: 5,123
  • sloc: cpp: 82,727; makefile: 305; python: 239; sh: 8
file content (119 lines) | stat: -rw-r--r-- 3,451 bytes parent folder | download | duplicates (2)
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
SHELL=bash
THISDIR:=$(dir $(realpath $(lastword $(MAKEFILE_LIST))))
SRCDIR:=${THISDIR}
-include ${CURDIR}/defines.mk
include ${THISDIR}/../rules.mk

MKDIR := mkdir

null :=
space := $(null) $(null)

broken_test_sources := \
	${SRCDIR}/alignment/format/SAMHeaderPrinter_gtest.cpp \
	$(null)


gtest_sources  := $(GTEST_SRCDIR)/gtest/gtest-all.cc \
                  $(GTEST_SRCDIR)/gtest/gtest_main.cc \
		  $(null)

test_sources   := $(wildcard ${SRCDIR}/pbdata/*.cpp) \
                  $(wildcard ${SRCDIR}/pbdata/utils/*.cpp) \
                  $(wildcard ${SRCDIR}/pbdata/metagenome/*.cpp) \
                  $(wildcard ${SRCDIR}/pbdata/saf/*.cpp) \
                  $(wildcard ${SRCDIR}/pbdata/reads/*.cpp) \
                  $(wildcard ${SRCDIR}/pbdata/qvs/*.cpp)  \
                  \
                  $(wildcard ${SRCDIR}/hdf/*.cpp) \
                  \
                  $(wildcard ${SRCDIR}/alignment/*.cpp) \
                  $(wildcard ${SRCDIR}/alignment/utils/*.cpp) \
                  $(wildcard ${SRCDIR}/alignment/query/*.cpp) \
                  $(wildcard ${SRCDIR}/alignment/datastructures/alignment/*.cpp) \
                  $(wildcard ${SRCDIR}/alignment/files/*.cpp) \
                  $(wildcard ${SRCDIR}/alignment/format/*.cpp) \
                  $(null)

# Remove broken tests from the test_sources list
test_sources   := $(filter-out $(broken_test_sources),$(test_sources))

paths := alignment alignment/files alignment/datastructures/alignment alignment/utils alignment/format \
	pbdata pbdata/utils pbdata/metagenome pbdata/saf pbdata/reads pbdata/qvs \
	hdf alignment/query
paths := $(patsubst %,${SRCDIR}%,${paths}) ${GTEST_SRCDIR}/gtest
sources   := $(gtest_sources) $(test_sources)
sources   := $(notdir ${sources})
objects   := $(patsubst %.cc,%.o,$(filter %.cc,$(sources))) \
             $(patsubst %.cpp,%.o,$(filter %.cpp,$(sources))) \
             $(null)
dependencies:=$(objects:%.o=%.d)


INCLUDES+= \
    ${SRCDIR} \
    ${SRCDIR}/../alignment \
    $(GTEST_INC) \
    $(LIBBLASR_INC) \
    $(LIBPBIHDF_INC) \
    $(LIBPBDATA_INC) \
    $(PBBAM_INC) \
    $(HTSLIB_INC) \
    $(HDF5_INC) \
    $(BOOST_INC) \
    $(null)

LIBS+= \
    $(LIBBLASR_LIB) \
    $(LIBPBIHDF_LIB) \
    $(LIBPBDATA_LIB) \
    $(PBBAM_LIB) \
    $(HTSLIB_LIB) \
    $(HDF5_LIB) \
    $(HDF5_CPP_LIB) \
    $(ZLIB_LIB) \
    $(GCC_LIB) \
    $(null)

ldlibs     := -lblasr -lpbihdf -lpbdata -lpbbam -lhts -lhdf5_cpp -lhdf5 -lz
sys_ldlibs := -lpthread -ldl -lrt

cxxopts  := -std=c++11 -Wno-div-by-zero 
cxxflags := -O3
#cppflags := $(patsubst %,-I%,${includes})
ldflags  := $(patsubst %,-L%,${LIBS}) $(sys_ldflags)



override CPPFLAGS := $(cppflags) $(CPPFLAGS)
override CXXFLAGS := $(cxxflags) $(cxxopts) $(CXXFLAGS)
override LDLIBS   := $(ldlibs) $(sys_ldlibs) $(LDLIBS)
override LDFLAGS  := $(ldflags) $(LDFLAGS)

COMPILE.cpp   = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
COMPILE.cc    = $(COMPILE.cpp)
LINK.o        = $(CXX) $(LDFLAGS) $(TARGET_ARCH)

vpath %.cpp ${paths}
vpath %.cc ${paths}

all: libblasr-test-runner

libblasr-test-runner: $(objects)
	$(LINK.o) $^ $(LDLIBS) -o $@

gtest: libblasr-test-runner
	LD_LIBRARY_PATH=$(subst $(space),:,$(strip $(LIBS))) ./$< --gtest_output=xml:./xml/all.xml

# Build objects
%.o: %.cpp
	$(COMPILE.cpp) -o $@ $<

%.o: %.cc
	$(COMPILE.cc) -o $@ $<

clean:
	$(RM) -r $(OUTDIR) *.o libblasr-test-runner

-include ${dependencies}
depend: $(dependencies:.d=.depend)