20024c65496296734699abc6e9a7954414120bb5
[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: arch-api 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 arch-api: api.h arch.h
19 # Run either make pthreads-x86 or make pthreads-ppc prior to build
20 # the RCU library. Architecture auto-detectection not implemented
21 # in the build system yet.
22
23 pthreads-x86: clean
24 cp api_x86.h api.h
25 cp arch_x86.h arch.h
26
27 pthreads-ppc: clean
28 cp api_ppc.h api.h
29 cp arch_ppc.h arch.h
30
31 test_urcu: urcu.o test_urcu.c urcu.h
32 $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
33
34 test_urcu_dynamic_link: urcu.o test_urcu.c urcu.h
35 $(CC) ${CFLAGS} -DDYNAMIC_LINK_TEST $(LDFLAGS) -o $@ $(SRC_DEP)
36
37 test_urcu_yield: urcu-yield.o test_urcu.c urcu.h
38 $(CC) -DDEBUG_YIELD ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
39
40 test_urcu_timing: urcu.o test_urcu_timing.c urcu.h
41 $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
42
43 test_rwlock_timing: urcu.o test_rwlock_timing.c urcu.h
44 $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
45
46 urcu.o: urcu.c urcu.h
47 $(CC) -fPIC ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP)
48
49 liburcu.so: urcu.o
50 $(CC) -fPIC -shared -o $@ $<
51
52 urcu-yield.o: urcu.c urcu.h
53 $(CC) -DDEBUG_YIELD ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP)
54
55 urcu-asm.S: urcu-asm.c urcu.h
56 $(CC) ${CFLAGS} -S -o $@ $(SRC_DEP)
57
58 urcu-asm.o: urcu-asm.c urcu.h
59 $(CC) ${CFLAGS} -c -o $@ $(SRC_DEP)
60
61 urcutorture: urcutorture.c urcu.o urcu.h rcutorture.h
62 $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
63
64 urcutorture-yield: urcutorture.c urcu-yield.o urcu.h rcutorture.h
65 $(CC) -DDEBUG_YIELD ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
66
67 .PHONY: clean install arch-api
68
69 install: liburcu.so
70 cp -f liburcu.so /usr/lib/
71 cp -f arch.h compiler.h urcu.h urcu-static.h /usr/include/
72
73 clean:
74 rm -f *.o test_urcu test_urcu_timing test_rwlock_timing urcu-asm.S \
75 test_urcu_yield urcutorture urcutorture-yield liburcu.so \
76 test_urcu_dynamic_link api.h arch.h
This page took 0.040543 seconds and 3 git commands to generate.