-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
82 lines (62 loc) · 1.7 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
##
## MARBLE
##
## Project by:
## Alexis "Norech" CHERON
##
CC = gcc
AR = ar rc
CFLAGS = -W -Wall -Werror -pedantic -I./include -I./exercices
CFLAGS_TEST = ${CFLAGS} --coverage
LFLAGS =
LFLAGS_TEST = ${LFLAGS} -lcriterion
TESTDIR = tests
SRC = src/json/lexer/token_array_close.c \
src/json/lexer/token_array_open.c \
src/json/lexer/token_object_close.c \
src/json/lexer/token_object_open.c \
src/json/lexer/token_comma.c \
src/json/lexer/token_float.c \
src/json/lexer/token_bool.c \
src/json/lexer/token_integer.c \
src/json/lexer/token_null.c \
src/json/lexer/token_pair_separator.c \
src/json/lexer/token_string.c \
src/json/lexer/token_whitespace.c \
src/json/lexer/is_char.c \
src/json/lexer/is_word.c \
src/json/parser/parse_json_array.c \
src/json/parser/parse_json_object.c \
src/json/parser/parse_json_value.c \
src/json/parser.c \
src/util/lexer_helpers.c \
src/util/add_char_to_string.c \
src/util/expand_string.c \
src/util/free_values.c
TEST_FILES = ${TESTDIR}/test_parser.c \
${TESTDIR}/test_token_string.c \
${TESTDIR}/test_token_null.c \
${TESTDIR}/test_token_float.c \
${TESTDIR}/test_token_integer.c \
${TESTDIR}/test_token_bool.c \
${TESTDIR}/test_parse_json_value.c \
${TESTDIR}/test_json_free_object.c \
${TESTDIR}/test_json_free_array.c
OBJ = ${SRC:.c=.o}
TARGET = libjsonparser.a
TARGET_TEST = unit_tests
all: build_all clean
build_all: ${OBJ}
${AR} ${TARGET} ${OBJ}
tests_run: clean_tests
${CC} ${CFLAGS} ${CFLAGS_TEST} -o ${TARGET_TEST} ${SRC} ${TEST_FILES} ${LFLAGS} ${LFLAGS_TEST}
./${TARGET_TEST} --verbose
clean_tests:
rm -rf ${TARGET_TEST}
coverage: test
gcovr
clean:
rm -f ${OBJ} *.gc* unit_test
fclean: clean
rm -f ${TARGET}
re: fclean all