Permit both 32 and 64-bit builds
[urcu.git] / Makefile.inc
1
2 include Makefile.build.inc
3
4 DIRS=tests
5
6 all: checkarch liburcu.so urcu.o \
7 liburcu-qsbr.so urcu-qsbr.o \
8 liburcu-mb.so urcu-mb.o \
9 urcu-yield.o \
10 subdirs
11
12 checkarch:
13 ifeq (${ARCHTYPE},)
14 @echo "Architecture ${HOSTTYPE} is currently unsupported by liburcu"
15 @exit 1
16 endif
17
18 arch.h: arch_${ARCHTYPE}.h
19 cp -f arch_${ARCHTYPE}.h arch.h
20
21 arch_atomic.h: arch_atomic_${ARCHTYPE}.h
22 cp -f arch_atomic_${ARCHTYPE}.h arch_atomic.h
23
24 urcu.h: arch.h arch_atomic.h
25
26 urcu-qsbr.h: arch.h arch_atomic.h
27
28 urcu.o: urcu.c urcu.h
29 $(CC) -fPIC ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP)
30
31 urcu-mb.o: urcu.c urcu.h
32 $(CC) -fPIC -DURCU_MB ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP)
33
34 urcu-qsbr.o: urcu-qsbr.c urcu-qsbr.h
35 $(CC) -fPIC ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP)
36
37 liburcu.so: urcu.o
38 $(CC) ${LDFLAGS} -fPIC -shared -o $@ $<
39
40 liburcu-qsbr.so: urcu-qsbr.o
41 $(CC) ${LDFLAGS} -fPIC -shared -o $@ $<
42
43 liburcu-mb.so: urcu-mb.o
44 $(CC) ${LDFLAGS} -fPIC -shared -o $@ $<
45
46 urcu-yield.o: urcu.c urcu.h
47 $(CC) -DDEBUG_YIELD ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP)
48
49 .PHONY: clean install checkarch tests
50
51 subdirs:
52 -for d in ${DIRS}; do cd $${d}; ${MAKE} ${MFLAGS} ${EXTRAMFLAGS}; done
53
54 install: liburcu.so
55 cp -f liburcu.so liburcu-mb.so liburcu-qsbr.so /usr/lib/
56 cp -f arch.h arch_atomic.h compiler.h \
57 urcu.h urcu-static.h \
58 urcu-qsbr.h urcu-qsbr-static.h \
59 /usr/include/
60
61 clean:
62 rm -f *.o *.so arch.h arch_atomic.h
63 -for d in ${DIRS}; do cd $${d}; ${MAKE} clean; done
This page took 0.040391 seconds and 4 git commands to generate.