-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathMakefile
42 lines (29 loc) · 1.07 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
CFLAGS = -O2 -g -std=gnu99 -Wall
LDFLAGS = -lpthread
programs = test-spinlock-cmpxchg test-spinlock-xchg test-spinlock-k42 \
test-spinlock-mcs test-spinlock-ticket test-spinlock-pthread \
test-spinlock-xchg-backoff test-rtm test-spinlock-xchg-hle
all: $(programs)
test-spinlock-cmpxchg: test-spinlock.c
$(CC) $(CFLAGS) -DCMPXCHG $^ -o $@ $(LDFLAGS)
test-spinlock-xchg: test-spinlock.c
$(CC) $(CFLAGS) -DXCHG $^ -o $@ $(LDFLAGS)
test-spinlock-k42: test-spinlock.c
$(CC) $(CFLAGS) -DK42 $^ -o $@ $(LDFLAGS)
test-spinlock-mcs: test-spinlock.c
$(CC) $(CFLAGS) -DMCS $^ -o $@ $(LDFLAGS)
test-spinlock-ticket: test-spinlock.c
$(CC) $(CFLAGS) -DTICKET $^ -o $@ $(LDFLAGS)
test-spinlock-pthread: test-spinlock.c
$(CC) $(CFLAGS) -DPTHREAD $^ -o $@ $(LDFLAGS)
test-spinlock-xchg-backoff: test-spinlock.c
$(CC) $(CFLAGS) -DXCHGBACKOFF $^ -o $@ $(LDFLAGS)
test-spinlock-xchg-hle: test-spinlock.c
$(CC) $(CFLAGS) -DHLE $^ -o $@ $(LDFLAGS)
test-rtm: test-spinlock.c
$(CC) $(CFLAGS) -DRTM $^ -o $@ $(LDFLAGS)
%:%.c
$(CC) $(CFLAGS) $< -o $@
clean:
-rm -f *.o
-rm -f $(programs)