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 996 Bytes
Newer Older
Mikaël Salson's avatar
Mikaël Salson committed
1
CC=g++
2
CXXFLAGS=-W -Wall -g -O0 $(COVERAGE)
Mikaël Salson's avatar
Mikaël Salson committed
3
INCLUDE=-I ..
4
LDFLAGS=-lz
Mikaël Salson's avatar
Mikaël Salson committed
5 6
SRC= tests.cpp
EXEC=$(SRC:.cpp=)
Mathieu Giraud's avatar
Mathieu Giraud committed
7
OTHER_SRC=$(wildcard *.cpp)
8
LIB=../core/vidjil.a ../lib/lib.a
Mikaël Salson's avatar
Mikaël Salson committed
9 10
SHOULD=$(wildcard *.should_get)
SHOULD_LOG=$(SHOULD:.should_get=.log)
Mikaël Salson's avatar
Mikaël Salson committed
11

Mikaël Salson's avatar
Mikaël Salson committed
12
.PHONY: all force clean forcedep
Mikaël Salson's avatar
Mikaël Salson committed
13 14 15 16 17 18 19 20 21 22 23

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

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

24
should: vidjil $(SHOULD_LOG)
Mikaël Salson's avatar
Mikaël Salson committed
25 26 27 28

%.log: %.should_get force
	./should-to-tap.sh $<

Mathieu Giraud's avatar
Mathieu Giraud committed
29
$(EXEC): % : %.o $(LIB) 
30
	$(CC) -o $@ $< $(LIB) $(LDFLAGS) $(CXXFLAGS)
Mikaël Salson's avatar
Mikaël Salson committed
31 32 33 34


../core.a: core

35
vidjil:
36
	make CXXFLAGS="$(CXXFLAGS)" -C ../
37

Mikaël Salson's avatar
Mikaël Salson committed
38
core:
39
	make CXXFLAGS="$(CXXFLAGS)" -C ../core
Mikaël Salson's avatar
Mikaël Salson committed
40

Mathieu Giraud's avatar
Mathieu Giraud committed
41
%.o: %.cpp $(OTHER_SRC)
42
	$(CC) -o $@ $(INCLUDE) -c $< $(CXXFLAGS)
Mikaël Salson's avatar
Mikaël Salson committed
43 44

clean:
45
	rm -f *.o $(EXEC) *.tap *.log *.gcda *.gcno *.gcov
46
	rm -rf out/
Mikaël Salson's avatar
Mikaël Salson committed
47 48 49 50

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

Mikaël Salson's avatar
Mikaël Salson committed
51 52
force:

Mikaël Salson's avatar
Mikaël Salson committed
53 54 55 56 57 58 59
DEP=$(wildcard dep.mk)

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