Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Makefile 1.77 KB
Newer Older
Mikaël Salson's avatar
Mikaël Salson committed
1 2
CC=g++
INCLUDE=-I ..
3 4 5
OPTIM=-g -O0 $(COVERAGE)
override CXXFLAGS += -W -Wall $(OPTIM)
LDLIBS=-lz
Mikaël Salson's avatar
Mikaël Salson committed
6 7
SRC= tests.cpp
EXEC=$(SRC:.cpp=)
Mathieu Giraud's avatar
Mathieu Giraud committed
8
OTHER_SRC=$(wildcard *.cpp)
9
LIB=../core/vidjil.a ../lib/lib.a
Mikaël Salson's avatar
Mikaël Salson committed
10
SHOULD=$(wildcard *.should_get)
11
SHOULD_LOG=$(SHOULD:.should_get=.tap)
12
SHOULD_VDJ=$(wildcard should-vdj-tests/*.should-vdj.fa)
13
SHOULD_LOCUS=$(wildcard should-vdj-tests/*.should-locus.fa)
14
REPORTS_PATH := $(patsubst %/Makefile,%,$(abspath $(lastword $(MAKEFILE_LIST))))/../../reports
15
VALGRIND=valgrind -v --tool=memcheck --leak-check=full --show-reachable=yes --undef-value-errors=yes --track-origins=yes --xml=yes --xml-file="$$(mktemp "$(REPORTS_PATH)/valgrind.xml.XXXXXX")"
Mikaël Salson's avatar
Mikaël Salson committed
16

Mikaël Salson's avatar
Mikaël Salson committed
17
.PHONY: all force clean forcedep
Mikaël Salson's avatar
Mikaël Salson committed
18 19 20 21 22 23 24 25 26 27 28

test: all
	@echo
	@echo "*** Launching unit tests..."
	./tests
	cat tests.cpp.tap
	@echo "*** All unit tests passed"

all: core $(EXEC)
	@echo "All tests compiled."

29
should: vidjil $(SHOULD_LOG)
Mikaël Salson's avatar
Mikaël Salson committed
30

31 32
shouldvdj: vidjil
	python should-vdj-to-tap.py -2q $(SHOULD_VDJ) $(SHOULD_LOCUS)
33 34
	python should-vdj-to-tap.py $(SHOULD_VDJ)

35
%.tap: %.should_get force
Mikaël Salson's avatar
Mikaël Salson committed
36
	./should-to-tap.sh $<
37 38 39 40 41

valgrind_should:
	make -C $(REPORTS_PATH) clean_valgrind
	LAUNCHER="$(VALGRIND)" make should

42 43 44
valgrind_%:
	LAUNCHER="$(VALGRIND)" make $(patsubst valgrind_%,%,$@)

45 46
valgrind_tests: vidjil tests
	$(VALGRIND) ./tests
Mikaël Salson's avatar
Mikaël Salson committed
47

Mathieu Giraud's avatar
Mathieu Giraud committed
48
$(EXEC): % : %.o $(LIB) 
49
	$(CC) -o $@ $< $(LIB) $(LDLIBS) $(LDFLAGS) $(CXXFLAGS)
Mikaël Salson's avatar
Mikaël Salson committed
50 51 52 53


../core.a: core

54
vidjil:
55 56
	make -C ../ clean
	make -C ../ OPTIM="$(OPTIM)"
57

Mikaël Salson's avatar
Mikaël Salson committed
58
core:
59
	make -C ../core
Mikaël Salson's avatar
Mikaël Salson committed
60

Mathieu Giraud's avatar
Mathieu Giraud committed
61
%.o: %.cpp $(OTHER_SRC)
62
	$(CC) -o $@ $(INCLUDE) -c $< $(CXXFLAGS)
Mikaël Salson's avatar
Mikaël Salson committed
63 64

clean:
65
	rm -f *.o $(EXEC) *.tap *.log *.gcda *.gcno *.gcov should-vdj-tests/*.tap should-vdj-tests/*.log
66
	rm -rf out/
Mikaël Salson's avatar
Mikaël Salson committed
67 68 69 70

forcedep:
	g++ $(INCLUDE) -M $(SRC) > dep.mk

Mikaël Salson's avatar
Mikaël Salson committed
71 72
force:

Mikaël Salson's avatar
Mikaël Salson committed
73 74 75 76 77 78 79
DEP=$(wildcard dep.mk)

ifeq (${DEP},)
$(shell	g++ $(INCLUDE) -M $(SRC) > dep.mk)
endif
include dep.mk