| 1 | |
| 2 | include Makefile.build.inc |
| 3 | |
| 4 | DIRS=tests |
| 5 | |
| 6 | all: checkarch liburcu.so urcu.o urcu-yield.o urcu-qsbr.o urcu-mb.o subdirs |
| 7 | |
| 8 | checkarch: |
| 9 | ifeq (${ARCHTYPE},) |
| 10 | @echo "Architecture ${HOSTTYPE} is currently unsupported by liburcu" |
| 11 | @exit 1 |
| 12 | endif |
| 13 | |
| 14 | arch.h: arch_${ARCHTYPE}.h |
| 15 | cp -f arch_${ARCHTYPE}.h arch.h |
| 16 | |
| 17 | arch_atomic.h: arch_atomic_${ARCHTYPE}.h |
| 18 | cp -f arch_atomic_${ARCHTYPE}.h arch_atomic.h |
| 19 | |
| 20 | urcu.h: arch.h arch_atomic.h |
| 21 | |
| 22 | urcu-qsbr.h: arch.h arch_atomic.h |
| 23 | |
| 24 | urcu.o: urcu.c urcu.h |
| 25 | $(CC) -fPIC ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP) |
| 26 | |
| 27 | urcu-mb.o: urcu.c urcu.h |
| 28 | $(CC) -fPIC -DCONFIG_URCU_AVOID_SIGNALS ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP) |
| 29 | |
| 30 | urcu-qsbr.o: urcu-qsbr.c urcu-qsbr.h |
| 31 | $(CC) -fPIC ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP) |
| 32 | |
| 33 | liburcu.so: urcu.o |
| 34 | $(CC) -fPIC -shared -o $@ $< |
| 35 | |
| 36 | urcu-yield.o: urcu.c urcu.h |
| 37 | $(CC) -DDEBUG_YIELD ${CFLAGS} $(LDFLAGS) -c -o $@ $(SRC_DEP) |
| 38 | |
| 39 | .PHONY: clean install checkarch tests |
| 40 | |
| 41 | subdirs: |
| 42 | -for d in ${DIRS}; do cd $${d}; ${MAKE} ${MFLAGS}; done |
| 43 | |
| 44 | install: liburcu.so |
| 45 | cp -f liburcu.so /usr/lib/ |
| 46 | cp -f arch.h arch_atomic.h compiler.h urcu.h urcu-static.h /usr/include/ |
| 47 | |
| 48 | clean: |
| 49 | rm -f *.o *.so arch.h arch_atomic.h |
| 50 | -for d in ${DIRS}; do cd $${d}; ${MAKE} clean; done |