-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
36 lines (24 loc) · 766 Bytes
/
makefile
File metadata and controls
36 lines (24 loc) · 766 Bytes
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
# before executing test, you have to specify
# CXXTEST_PATH environment variable
# example: export CXXTEST_PATH=/home/magos/work/unittest/cxxtest
CC=g++
SRC=Singleton.cpp
OBJ=$(SRC:.cpp=.o)
TST_FILE=gentests.cpp
CXXTEST_GEN=$(CXXTEST_PATH)/bin/cxxtestgen
CCFLAGS = -g -Wall
INCLUDES = -I. -I$(CXXTEST_PATH)
LIBS=-L. -lSingleton
obj: $(SRC)
$(CC) -fpic -c $(SRC)
all: obj
$(CC) -shared -o libSingleton.so $(OBJ)
buildtest: all
$(CXXTEST_GEN) --error-printer -o gentests.cpp singletonTest.hpp
$(CC) $(TST_FILE) $(INCLUDES) $(CXXFLAGS) -o singletonTest $(LIBS)
test: buildtest
export LD_LIBRARY_PATH=. && ./singletonTest
check: buildtest
export LD_LIBRARY_PATH=. && valgrind --verbose ./singletonTest
clean:
rm -rf *.o *.so singletonTest $(TST_FILE)