093bf6619c852bfd920652bfac4929487dd28e0d
[urcu.git] / Makefile
1
2 CFLAGS=-Wall -O2 -g -I.
3 LDFLAGS=-lpthread
4
5 #debug
6 #CFLAGS=-Wall -g
7 #CFLAGS+=-DDEBUG_FULL_MB
8
9 #Changing the signal number used by the library. SIGUSR1 by default.
10 #CFLAGS+=-DSIGURCU=SIGUSR2
11
12 SRC_DEP=`echo $^ | sed 's/[^ ]*.h//g'`
13
14 all: test_urcu test_urcu_dynamic_link test_urcu_timing \
15 test_rwlock_timing test_urcu_yield urcu-asm.S \
16 urcu-asm.o urcutorture urcutorture-yield liburcu.so
17
18 pthreads-x86: clean
19 cp api_x86.h api.h
20 cp arch_x86.h arch.h
21
22 pthreads-ppc: clean
23 cp api_ppc.h api.h
24 cp arch_ppc.h arch.h
25
26 test_urcu: urcu.o test_urcu.c urcu.h
27 $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
28
29 test_urcu_dynamic_link: urcu.o test_urcu.c urcu.h
30 $(CC) ${CFLAGS} -DDYNAMIC_LINK_TEST $(LDFLAGS) -o $@ $(SRC_DEP)
31
32 test_urcu_yield: urcu-yield.o test_urcu.c urcu.h
33 $(CC) -DDEBUG_YIELD ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
34
35 test_urcu_timing: urcu.o test_urcu_timing.c urcu.h
36 $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
37
38 test_rwlock_timing: urcu.o test_rwlock_timing.c urcu.h
39 $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
40
41 urcu.o: urcu.c urcu.h
42 $(CC) -fPIC ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP)
43
44 liburcu.so: urcu.o
45 $(CC) -fPIC -shared -o $@ $<
46
47 urcu-yield.o: urcu.c urcu.h
48 $(CC) -DDEBUG_YIELD ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP)
49
50 urcu-asm.S: urcu-asm.c urcu.h
51 $(CC) ${CFLAGS} -S -o $@ $(SRC_DEP)
52
53 urcu-asm.o: urcu-asm.c urcu.h
54 $(CC) ${CFLAGS} -c -o $@ $(SRC_DEP)
55
56 urcutorture: urcutorture.c urcu.o urcu.h rcutorture.h
57 $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
58
59 urcutorture-yield: urcutorture.c urcu-yield.o urcu.h rcutorture.h
60 $(CC) -DDEBUG_YIELD ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
61
62 .PHONY: clean install
63
64 install: liburcu.so
65 cp -f liburcu.so /usr/lib/
66 cp -f arch.h compiler.h urcu.h urcu-static.h /usr/include/
67
68 clean:
69 rm -f *.o test_urcu test_urcu_timing test_rwlock_timing urcu-asm.S \
70 test_urcu_yield urcutorture urcutorture-yield liburcu.so \
71 test_urcu_dynamic_link
This page took 0.03876 seconds and 4 git commands to generate.