Makefile 3.29 KB
Newer Older
1
2
GCC_VERSION=-4.9
CXX=g++$(GCC_VERSION)
Damien Leroux's avatar
Damien Leroux committed
3
CXXARGS=--std=gnu++0x -Wall -Wno-unused-local-typedefs -DEIGEN_NO_DEPRECATED_WARNING
4
5
6
7
8
9
10
11
COV=gcov$(GCC_VERSION)
INC=-I../include -I../include/input -I/usr/local/include/eigen3
LD=$(CXX)
LIBS=-lexpat
VERSION_DEFINES=$(shell git tag | sed 's/\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)/-DVERSION_MAJOR=\\\"\1\\\" -DVERSION_MINOR=\\\"\2\\\" -DVERSION_PATCH=\\\"\3\\\"/')

C=$(CXX) $(CXXARGS) $(INC) -DTEST_POLY $(VERSION_DEFINES)

12
SRC=main.cc fast_polynom.cc markov_population.cc ../src/input/read_map.cc ../src/outbred.cc ../src/probapop_dtd.cc ../src/input/invoke_probapop.cc ../src/static_data.cc
13
14
15

OBJ=$(subst .cc,.o,$(SRC))

Damien Leroux's avatar
Damien Leroux committed
16
DEBUG_OPTS=-ggdb
17
18
OPT_OPTS=-O3 -DEIGEN_NO_DEBUG -DNDEBUG

Damien Leroux's avatar
Damien Leroux committed
19
#COV_OPTS=-g -fprofile-arcs -ftest-coverage
20
21
22
23
24
25
26
27
COV_OPTS=$(DEBUG_OPTS) --coverage

PROF_OPTS=-pg -O

INFO_FILE=test-coverage.info

#C=$(CXX) $(CXXARGS) $(INC) $(DEBUG_OPTS)
C=$(CXX) $(CXXARGS) $(INC) $(DEBUG_OPTS) $(PROF_OPTS) $(VERSION_DEFINES) $(COV_OPTS)
Damien Leroux's avatar
Damien Leroux committed
28
C=$(CXX) $(CXXARGS) $(INC) $(OPT_OPTS) $(VERSION_DEFINES)
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

all: test_suite

include .depend

pch: $(PCH)

$(PCH):%.h.gch: %.h Makefile
	$C $<

test_suite: $(OBJ)
	$C $(OBJ) -o $@ $(LIBS)

test: test_suite
	./$<

zerocounters:
	lcov --zerocounters --directory .


test-coverage: zerocounters test
	lcov --gcov-tool $(COV) --no-checksum --directory . --capture --output-file $(INFO_FILE)
	lcov --remove $(INFO_FILE) "/usr*" -o $(INFO_FILE)
	lcov --remove $(INFO_FILE) "catch.hpp" -o $(INFO_FILE)
	genhtml --highlight --legend --output-directory TestCodeCoverage $(INFO_FILE)


.depend: $(SRC) Makefile
	$C --depend $(SRC) > $@

$(OBJ):%.o: %.cc
	$C -c $< -o $@

clean:
	rm -f $(OBJ) *.gcno *.gcda

opt-tests: $(SRC)
	$(CXX) $(CXXARGS) $(INC) $(OPT_OPTS) $(VERSION_DEFINES) $(SRC) $(LIBS) -o $@

#g++-4.9 --std=gnu++0x -Wall -Wno-unused-local-typedefs -I../include -I../include/input -I/usr/local/include/eigen3  -gdwarf-2 -gstrict-dwarf -Winvalid-pch  -DVERSION_MAJOR=\"0\" -DVERSION_MINOR=\"0\" -DVERSION_PATCH=\"0\" main.o fast_polynom.o markov_population.o -o test_suite -lexpat
#markov_population.o: In function `from_argv_outbred(int, char const* const*, double&)':
#/media/Stock/devel/MCQTL/v6/tests/markov_population.cc:110: undefined reference to `read_data::read_map(std::istream&)'
#/media/Stock/devel/MCQTL/v6/tests/markov_population.cc:112: undefined reference to `read_data::read_outbred(std::istream&)'
#markov_population.o: In function `test_segment(int, char const* const*)':
#/media/Stock/devel/MCQTL/v6/tests/markov_population.cc:255: undefined reference to `test_probapop(chromosome const&, marker_data const&, double)'
#markov_population.o: In function `test_segment_outbred(int, char const* const*)':
#/media/Stock/devel/MCQTL/v6/tests/markov_population.cc:328: undefined reference to `test_probapop(chromosome const&, marker_data const&, double)'
#markov_population.o: In function `algebraic_genotype::operator*(algebraic_genotype) const':
#/media/Stock/devel/MCQTL/v6/tests/../include/algebraic_genotype.h:561: undefined reference to `algebraic_genotype::null'
#/media/Stock/devel/MCQTL/v6/tests/../include/algebraic_genotype.h:613: undefined reference to `algebraic_genotype::null'
#/media/Stock/devel/MCQTL/v6/tests/../include/algebraic_genotype.h:657: undefined reference to `algebraic_genotype::null'
#collect2: error: ld returned 1 exit status
#make: *** [test_suite] Error 1