-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
39 lines (28 loc) · 782 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
TARGETS = spsc_ub_test_fib spsc_ub_test_default mpmc_test mpmc_test_fib spsc_test_fib
CFLAGS = -Wall -std=c11
ifeq ($(shell uname), Linux)
LIBS = -pthread
endif
DEBUG ?= 1
ifdef DEBUG
CFLAGS += -g -O0
else
CFLAGS += -O3
endif
.PHONY: all clean
all: $(TARGETS)
spsc_ub_test_fib: spsc_ub_test_fib.o spsc_ub_queue.o memory.o
$(CC) $^ -Wall $(LIBS) -o $@
spsc_ub_test_default: spsc_ub_test_default.o spsc_ub_queue.o memory.o
$(CC) $^ -Wall $(LIBS) -o $@
mpmc_test: mpmc_test.o mpmc_queue.o memory.o
$(CC) $^ -Wall $(LIBS) -o $@
mpmc_test_fib: mpmc_test_fib.o mpmc_queue.o memory.o
$(CC) $^ -Wall $(LIBS) -o $@
spsc_test_fib: spsc_test_fib.o spsc_queue.o memory.o
$(CC) $^ -Wall $(LIBS) -o $@
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -f *.o
rm -f $(TARGETS)