-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (44 loc) · 1.61 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
CC=gcc
CFLAGS=-Wall -Werror -g -std=gnu99 -O3
LIBS=-lpthread
INCLUDE_HEADERS_DIRECTORY=-Iheaders
INCLUDE_CUNIT = -I./CUnit_container/
LINK_CUNIT = -L./CUnit_container/lib/
fec: main.o ./src/block.o ./src/message.o ./src/system.o ./src/tinymt32.o ./src/my_threads.o
$(CC) $(INCLUDE_HEADERS_DIRECTORY) $(CFLAGS) -o $@ $^ $(LIBS)
%.o: %.c
@$(CC) $(INCLUDE_HEADERS_DIRECTORY) $(INCLUDE_CUNIT) $(CFLAGS) -o $@ -c $<
clean:
@rm -f src/*.o
@rm -f tests/*.o
@rm -f fec
@rm -f ./bin/*
@rm -f ./*.o
@rm -f ./testing
@rm -f ./here.txt
@rm -f ./utils/speed.png
@rm -f ./utils/memory.png
@rm -f ./utils/consumption.png
test_tinymn32: ./tests/test_tinymt32.o ./src/tinymt32.o
$(CC) $(INCLUDE_HEADERS_DIRECTORY) $(INCLUDE_CUNIT) $(LINK_CUNIT) -o ./bin/$@ $^ -lcunit
./bin/$@
test_system: ./src/tinymt32.o tests/test_system.o src/system.o
$(CC) $(INCLUDE_HEADERS_DIRECTORY) $(INCLUDE_CUNIT) $(LINK_CUNIT) -o ./bin/$@ $^ -lcunit
./bin/$@
# dont forget to $ export LD_LIBRARY_PATH=$HOME/local/lib:$LD_LIBRARY_PATH
tests: ./tests/testRun.o ./tests/test_tinymt32.o ./src/tinymt32.o tests/test_system.o src/system.o tests/test_block.o src/block.o tests/test_message.o ./src/message.o
@make
@./fec ./binary_example -f here.txt
@$(CC) $(INCLUDE_HEADERS_DIRECTORY) $(INCLUDE_CUNIT) $(LINK_CUNIT) -o ./testing $^ -lcunit
check:
@cppcheck ./src/system.c
@cppcheck ./src/block.c
@cppcheck ./src/message.c
@cppcheck ./src/tinymt32.c
@cppcheck ./main.c
@make tests
@make
@valgrind ./testing
@valgrind ./fec ./binary_example -f here.txt
@make clean
.PHONY: clean tests