forked from dbittman/waitfree-mpsc-queue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (27 loc) · 831 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
# 2015 Daniel Bittman <[email protected]>: http://dbittman.github.io/
CFLAGS=-Wall -Wextra -Werror -std=gnu11 -O3
LDFLAGS=
LDLIBS=-lpthread
CC=gcc
ifeq ($(strip $(DEBUG)),tsan)
CC=clang
CFLAGS+=-fsanitize=thread
LDFLAGS+=-fsanitize=thread
else ifeq ($(strip $(DEBUG)),asan)
CC=clang
CFLAGS+=-fsanitize=address
LDFLAGS+=-fsanitize=address
endif
all: libmpscq.so libmpscq.a mpsc_test
mpsc_test: mpsc.o mpsc_test.o
mpsc_test.o: mpsc_test.c
mpsc.o: mpsc.c mpscq.h
libmpscq.a: mpsc.o
ar -cvq libmpscq.a mpsc.o
libmpscq.so: mpsc.c mpscq.h Makefile
$(CC) $(CFLAGS) -shared -o libmpscq.so -fPIC mpsc.c
clean:
-rm libmpscq.* *.o mpsc_test
prof: mpsc_test
for i in $$(seq 1 100); do sudo nice -n -20 ./mpsc_test; mv -f gmon.out gmon.out.$$i; done
gprof -s ./mpsc_test gmon.out.*; gprof ./mpsc_test gmon.sum -bQ