forked from avsm/ipc-bench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
72 lines (50 loc) · 1.78 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
all_target := posix
uname := $(shell uname -s)
ifeq ($(uname),Linux)
all_target := linux
endif
ifeq ($(uname),OpenBSD)
all_target := openbsd
endif
ifeq ($(uname),Darwin)
all_target := darwin
endif
CFLAGS = -g -Wall -O3 -D_GNU_SOURCE -DNDEBUG -std=gnu99
.PHONY: all clean run
CFLAGS_Linux = -DUSE_INLINE_ASM -DLinux
CFLAGS_OpenBSD = -DUSE_INLINE_ASM
CFLAGS += -g -Wall -O3 -D_GNU_SOURCE -DNDEBUG -std=gnu99 $(CFLAGS_$(uname))
LDFLAGS_Linux := -lrt -lnuma
LDFLAGS += -lm $(LDFLAGS_$(uname))
TARGETS_POSIX := pipe_thr tcp_thr tcp_nodelay_thr unix_thr mempipe_spin_thr
TARGETS_Linux += mempipe_thr vmsplice_pipe_thr vmsplice_hugepages_pipe_thr vmsplice_hugepages_coop_pipe_thr vmsplice_coop_pipe_thr
TARGETS_POSIX += pipe_lat unix_lat tcp_lat tcp_nodelay_lat mempipe_lat
TARGETS_Linux += shmem_pipe_thr futex_lat
TARGETS_POSIX += summarise_tsc_counters
TARGETS_OpenBSD :=
TARGETS_Darwin :=
TARGETS := $(TARGETS_POSIX) $(TARGETS_$(uname))
x-%:
echo $($*)
all: $(TARGETS)
@ :
%_lat: atomicio.o test.o xutil.o %_lat.o stats.o
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
%_thr: atomicio.o test.o xutil.o %_thr.o stats.o
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
tcp_nodelay_thr.o: tcp_thr.c
$(CC) $(CFLAGS) $^ -c -DUSE_NODELAY -o $@
tcp_nodelay_lat.o: tcp_lat.c
$(CC) $(CFLAGS) $^ -c -DUSE_NODELAY -o $@
mempipe_spin_thr.o: mempipe_thr.c
$(CC) $(CFLAGS) $^ -c -DNO_FUTEX -o $@
vmsplice_hugepages_pipe_thr.o: vmsplice_pipe_thr.c
$(CC) $(CFLAGS) $^ -c -DUSE_HUGE_PAGES -o $@
vmsplice_hugepages_coop_pipe_thr.o: vmsplice_pipe_thr.c
$(CC) $(CFLAGS) $^ -c -DUSE_HUGE_PAGES -DVMSPLICE_COOP -o $@
vmsplice_coop_pipe_thr.o: vmsplice_pipe_thr.c
$(CC) $(CFLAGS) $^ -c -DVMSPLICE_COOP -o $@
summarise_tsc_counters: summarise_tsc_counters.o stats.o
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
clean:
rm -f *~ core *.o $(TARGETS)