1#
2# Hoel library
3#
4# Makefile used to build the tests
5#
6# Copyright 2017 Nicolas Mora <mail@babelouest.org>
7#
8# This program is free software; you can redistribute it and/or
9# modify it under the terms of the GNU GENERAL PUBLIC LICENSE
10# License as published by the Free Software Foundation;
11# version 3 of the License.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16# GNU GENERAL PUBLIC LICENSE for more details.
17#
18# You should have received a copy of the GNU General Public
19# License along with this program.  If not, see <http://www.gnu.org/licenses/>.
20#
21
22HOEL_INCLUDE=../include
23CC=gcc
24CFLAGS=-Wall -I$(HOEL_INCLUDE) -D_REENTRANT -DDEBUG -g -O0
25HOEL_LOCATION=../src
26LIBS=-lc -lyder -lhoel -ljansson -lcheck -lpthread -lm -lrt -lsubunit -L$(HOEL_LOCATION)
27
28all: test
29
30clean:
31	rm -f *.o core multi valgrind.txt
32
33libhoel.so:
34	cd $(HOEL_LOCATION) && $(MAKE) debug
35
36core: core.c
37	$(CC) $(CFLAGS) core.c -o core $(LIBS)
38
39test_core: libhoel.so core
40	-LD_LIBRARY_PATH=$(HOEL_LOCATION):${LD_LIBRARY_PATH} ./core
41
42multi: multi.c
43	$(CC) $(CFLAGS) multi.c -o multi $(LIBS)
44
45test_multi: libhoel.so multi
46	-LD_LIBRARY_PATH=$(HOEL_LOCATION):${LD_LIBRARY_PATH} ./multi
47
48test: test_core
49