Add .gitignore entries to reduce 'git status' chatter
[userspace-rcu.git] / Makefile
... / ...
CommitLineData
1
2CFLAGS=-Wall -O2 -g -I.
3LDFLAGS=-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
12SRC_DEP=`echo $^ | sed 's/[^ ]*.h//g'`
13
14all: 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
18arch-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
23pthreads-x86: clean
24 cp api_x86.h api.h
25 cp arch_x86.h arch.h
26 cp arch_atomic_x86.h arch_atomic.h
27
28pthreads-ppc: clean
29 cp api_ppc.h api.h
30 cp arch_ppc.h arch.h
31 cp arch_atomic_ppc.h arch_atomic.h
32
33test_urcu: urcu.o test_urcu.c urcu.h
34 $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
35
36test_urcu_dynamic_link: urcu.o test_urcu.c urcu.h
37 $(CC) ${CFLAGS} -DDYNAMIC_LINK_TEST $(LDFLAGS) -o $@ $(SRC_DEP)
38
39test_urcu_yield: urcu-yield.o test_urcu.c urcu.h
40 $(CC) -DDEBUG_YIELD ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
41
42test_urcu_timing: urcu.o test_urcu_timing.c urcu.h
43 $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
44
45test_rwlock_timing: urcu.o test_rwlock_timing.c urcu.h
46 $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
47
48urcu.o: urcu.c urcu.h
49 $(CC) -fPIC ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP)
50
51liburcu.so: urcu.o
52 $(CC) -fPIC -shared -o $@ $<
53
54urcu-yield.o: urcu.c urcu.h
55 $(CC) -DDEBUG_YIELD ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP)
56
57urcu-asm.S: urcu-asm.c urcu.h
58 $(CC) ${CFLAGS} -S -o $@ $(SRC_DEP)
59
60urcu-asm.o: urcu-asm.c urcu.h
61 $(CC) ${CFLAGS} -c -o $@ $(SRC_DEP)
62
63urcutorture: urcutorture.c urcu.o urcu.h rcutorture.h
64 $(CC) ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
65
66urcutorture-yield: urcutorture.c urcu-yield.o urcu.h rcutorture.h
67 $(CC) -DDEBUG_YIELD ${CFLAGS} $(LDFLAGS) -o $@ $(SRC_DEP)
68
69.PHONY: clean install arch-api
70
71install: liburcu.so
72 cp -f liburcu.so /usr/lib/
73 cp -f arch.h arch_atomic.h compiler.h urcu.h urcu-static.h /usr/include/
74
75clean:
76 rm -f *.o test_urcu test_urcu_timing test_rwlock_timing urcu-asm.S \
77 test_urcu_yield urcutorture urcutorture-yield liburcu.so \
78 test_urcu_dynamic_link api.h arch.h arch_atomic.h
This page took 0.02175 seconds and 4 git commands to generate.