forked from iLeafy11/facebooc-q0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 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
43
44
45
46
47
48
CC = gcc
CFLAGS = -O1 -g -Wall -Werror -I.
#GIT_HOOKS := .git/hooks/applied
#all: $(GIT_HOOKS) test
all: test
# Enable sanitizer(s) or not
ifeq ("$(SANITIZER)","1")
# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
CFLAGS += -fsanitize=address -fno-omit-frame-pointer -fno-common
LDFLAGS += -fsanitize=address
endif
$(GIT_HOOKS):
@scripts/install-git-hooks
@echo
OBJS := test.o queue.o
deps := $(OBJS:%.o=.%.o.d)
test: $(OBJS)
%.o: %.c
$(CC) $(CFLAGS) -c -MMD -MF [email protected] $<
valgrind_existence:
@which valgrind 2>&1 > /dev/null || (echo "FATAL: valgrind not found"; exit 1)
valgrind: valgrind_existence
# Explicitly disable sanitizer(s)
$(MAKE) clean SANITIZER=0 test
valgrind --leak-check=full ./test
@echo
clean:
rm -f $(OBJS) $(deps) *~ test /tmp/test.*
rm -rf *.dSYM
rm -rf cachegrind.out.*
(cd traces; rm -f *~)
astyle:
-include $(deps)