urcu: add quick start guide to README
[userspace-rcu.git] / Makefile
CommitLineData
27b012e2 1
121a5d44 2CFLAGS=-Wall -O2 -g -I.
bb488185
MD
3LDFLAGS=-lpthread
4
60fe0c90
MD
5HOSTTYPE=$(shell uname -m)
6
7ifeq ("${HOSTTYPE}","x86_64")
8ARCHTYPE=x86
9endif
49a26f58
MD
10ifeq ("${HOSTTYPE}","i586")
11ARCHTYPE=x86
12endif
13ifeq ("${HOSTTYPE}","i686")
60fe0c90
MD
14ARCHTYPE=x86
15endif
16ifeq ("${HOSTTYPE}","powerpc")
17ARCHTYPE=ppc
18endif
b89816ac
PM
19ifeq ("${HOSTTYPE}","ppc64")
20ARCHTYPE=ppc
21endif
60fe0c90 22
20bf310a
MD
23#debug
24#CFLAGS=-Wall -g
bb488185 25#CFLAGS+=-DDEBUG_FULL_MB
20bf310a 26
121a5d44
MD
27#Changing the signal number used by the library. SIGUSR1 by default.
28#CFLAGS+=-DSIGURCU=SIGUSR2
29
102d1d23 30SRC_DEP=`echo $^ | sed 's/[^ ]*\.h//g'`
20bf310a 31
60fe0c90 32all: checkarch test_urcu test_urcu_dynamic_link test_urcu_timing \
10c48e14 33 test_rwlock_timing test_rwlock test_perthreadlock_timing \
e90a6e9c 34 test_perthreadlock test_urcu_yield test_urcu_mb \
061159a0 35 urcu-asm.S test_qsbr_timing test_qsbr urcu-asm.o urcutorture \
2a67ec32
MD
36 urcutorture-yield liburcu.so test_mutex test_looplen test_urcu_gc \
37 test_urcu_gc_mb test_qsbr_gc
20bf310a 38
60fe0c90
MD
39checkarch:
40ifeq (${ARCHTYPE},)
41 @echo "Architecture ${HOSTTYPE} is currently unsupported by liburcu"
42 @exit 1
43endif
44
45arch.h: arch_${ARCHTYPE}.h
46 cp -f arch_${ARCHTYPE}.h arch.h
47
48api.h: api_${ARCHTYPE}.h
49 cp -f api_${ARCHTYPE}.h api.h
d2d23035 50
60fe0c90
MD
51arch_atomic.h: arch_atomic_${ARCHTYPE}.h
52 cp -f arch_atomic_${ARCHTYPE}.h arch_atomic.h
2d6debff 53
60fe0c90
MD
54urcu.h: arch.h api.h arch_atomic.h
55
56urcu-qsbr.h: arch.h api.h arch_atomic.h
2d6debff 57
1430ee0b 58test_urcu: urcu.o test_urcu.c urcu.h
20bf310a
MD
59 $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
60
fd6a23f2
MD
61test_looplen: test_looplen.c urcu.h
62 $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
63
e90a6e9c
MD
64test_urcu_mb: urcu-mb.o test_urcu.c urcu.h
65 $(CC) -DDEBUG_FULL_MB ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
66
d1bf941c 67test_urcu_gc: urcu.o test_urcu_gc.c urcu.h
2a67ec32
MD
68 $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
69
70test_urcu_gc_mb: urcu-mb.o test_urcu_gc.c urcu.h
71 $(CC) -DDEBUG_FULL_MB ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
72
061159a0
MD
73test_qsbr: urcu-qsbr.o test_qsbr.c urcu-qsbr.h
74 $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
75
2a67ec32
MD
76test_qsbr_gc: urcu-qsbr.o test_qsbr_gc.c urcu-qsbr.h
77 $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
78
10c48e14
MD
79test_rwlock: urcu.o test_rwlock.c urcu.h
80 $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
81
0ee8bb0a
MD
82test_perthreadlock: urcu.o test_perthreadlock.c urcu.h
83 $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
84
51299083
MD
85test_mutex: urcu.o test_mutex.c urcu.h
86 $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
87
121a5d44
MD
88test_urcu_dynamic_link: urcu.o test_urcu.c urcu.h
89 $(CC) ${CFLAGS} -DDYNAMIC_LINK_TEST $(LDFLAGS) -o $@ $(SRC_DEP)
90
1430ee0b 91test_urcu_yield: urcu-yield.o test_urcu.c urcu.h
cf380c2f
MD
92 $(CC) -DDEBUG_YIELD ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
93
1430ee0b 94test_urcu_timing: urcu.o test_urcu_timing.c urcu.h
20bf310a
MD
95 $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
96
420e5b92
MD
97test_qsbr_timing: urcu-qsbr.o test_qsbr_timing.c urcu-qsbr.h
98 $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
99
1430ee0b 100test_rwlock_timing: urcu.o test_rwlock_timing.c urcu.h
20bf310a 101 $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
27b012e2 102
102d1d23
MD
103test_perthreadlock_timing: urcu.o test_perthreadlock_timing.c urcu.h
104 $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
105
27b012e2 106urcu.o: urcu.c urcu.h
121a5d44
MD
107 $(CC) -fPIC ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP)
108
e90a6e9c
MD
109urcu-mb.o: urcu.c urcu.h
110 $(CC) -fPIC -DDEBUG_FULL_MB ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP)
111
420e5b92
MD
112urcu-qsbr.o: urcu-qsbr.c urcu-qsbr.h
113 $(CC) -fPIC ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP)
114
121a5d44
MD
115liburcu.so: urcu.o
116 $(CC) -fPIC -shared -o $@ $<
c777f0b1 117
cf380c2f
MD
118urcu-yield.o: urcu.c urcu.h
119 $(CC) -DDEBUG_YIELD ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP)
120
1430ee0b
MD
121urcu-asm.S: urcu-asm.c urcu.h
122 $(CC) ${CFLAGS} -S -o $@ $(SRC_DEP)
123
124urcu-asm.o: urcu-asm.c urcu.h
125 $(CC) ${CFLAGS} -c -o $@ $(SRC_DEP)
126
e7b43771 127urcutorture: urcutorture.c urcu.o urcu.h rcutorture.h
e462817e
MD
128 $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
129
9b171f46
MD
130urcutorture-yield: urcutorture.c urcu-yield.o urcu.h rcutorture.h
131 $(CC) -DDEBUG_YIELD ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
132
60fe0c90 133.PHONY: clean install checkarch
121a5d44
MD
134
135install: liburcu.so
136 cp -f liburcu.so /usr/lib/
0114ba7f 137 cp -f arch.h arch_atomic.h compiler.h urcu.h urcu-static.h /usr/include/
c777f0b1
MD
138
139clean:
b82229e4
MD
140 rm -f *.o test_urcu test_urcu_dynamic_link test_urcu_timing \
141 test_rwlock_timing test_rwlock test_perthreadlock_timing \
142 test_perthreadlock test_urcu_yield test_urcu_mb \
143 urcu-asm.S test_qsbr_timing test_qsbr urcutorture \
51299083 144 urcutorture-yield liburcu.so api.h arch.h arch_atomic.h \
2a67ec32 145 test_mutex test_urcu_gc test_urcu_gc_mb
b82229e4 146
This page took 0.029239 seconds and 4 git commands to generate.