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