-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
67 lines (49 loc) · 1.1 KB
/
Makefile
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
CC=gcc
LDLIBS=-lm -lc
LDFLAGS=${LDLIBS}
FLAGS_DEBUG=-g -Wall -DDEBUG -DLOGLEVEL=0 -Wextra -Wno-unused-function
#VERSION=-DVERSION="\"$(shell git log -n1 --pretty=format:%h%d) added cd_acc/do\""
#CFLAGS=-O0 -std=c11 ${VERSION} ${FLAGS_DEBUG}
#CFLAGS=-O2 -ftree-vectorize -msse2 -ftree-vectorizer-verbose=5 -std=c11 ${VERSION} ${FLAGS_DEBUG}
CFLAGS=-O3 -std=c11
srcfiles=$(wildcard src/*.c)
objects=$(srcfiles:%.c=%.o)
# compile (fast) production version
default: cesar
.PHONY: cesar
cesar: CESAR
mv CESAR cesar
CESAR: ${objects}
${CC} ${CFLAGS} -o $@ $^ ${LDLIBS}
# compile debugging version
.PHONY: debug
debug: ${objects}
${CC} ${FLAGS_DEBUG} -o $@ $^ ${LDLIBS}
# dev setup
workspace:
virtualenv venv
# dev doc
.PHONY: doc
doc:
mkdir -p doc/
doxygen doxygen.conf
.PHONY: test
test: ${objects} cesar
tests.sh ./cesar
.PHONY: test/valgrind
test/valgrind: ${objects} cesar
test/run.sh cesar
make -C test valgrind
# cleaners
.PHONY: clean
clean: cleanCode cleanTest
rm -rf doc
mkdir doc
cleanCode:
rm -fv *.o
rm -fv src/*.o
rm -fv src/*.gch
rm -f cesar
rm -f debug
cleanTest:
make -i -C test clean