-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (33 loc) · 945 Bytes
/
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
-include Makefile.rules
CC=gcc
CFILES=src/base_json_parser.c \
src/base_json_storage.c \
src/base_json_write.c \
src/ro_json_parser.c \
src/ro_json_storage.c \
src/ro_json_write.c \
src/rw_json_parser.c \
src/rw_json_storage.c \
src/rw_json_write.c
TARGET=json-parser
all: clean $(TARGET)
./$(TARGET) t.json
rw: clean
$(CC) $(CFLAGS) $(CFILES) rw_main.c -o $(TARGET) -lm
./$(TARGET) t.json
.PHONY:
$(TARGET):
$(CC) $(CFLAGS) $(CFILES) ro_main.c -o $(TARGET) \
-lm # math library for pow function
clean:
if [ -f "$(TARGET)" ]; then rm $(TARGET); fi
valgrind-compile: clean
$(CC) $(CFLAGS) -lm \
-DVALGRING_DISABLE_PRINT \
$(CFILES) ro_main.c -o $(TARGET)
valgrind: valgrind-compile
valgrind --tool=callgrind --dump-instr=yes --simulate-cache=yes \
--collect-jumps=yes ./$(TARGET) big.json
leaks: valgrind-compile
valgrind --leak-check=full --show-leak-kinds=all \
--track-origins=yes ./$(TARGET) t.json