| 1 | # Copyright (C) 2013 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
| 2 | # |
| 3 | # THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED |
| 4 | # OR IMPLIED. ANY USE IS AT YOUR OWN RISK. |
| 5 | # |
| 6 | # Permission is hereby granted to use or copy this program for any |
| 7 | # purpose, provided the above notices are retained on all copies. |
| 8 | # Permission to modify the code and to distribute modified code is |
| 9 | # granted, provided the above notices are retained, and a notice that |
| 10 | # the code was modified is included with the above copyright notice. |
| 11 | |
| 12 | CC = gcc |
| 13 | LIBS = -lurcu-qsbr |
| 14 | CFLAGS = -g -O2 -Wall |
| 15 | |
| 16 | # Only necessary when building from the source tree and userspace RCU is |
| 17 | # not installed |
| 18 | ifdef BUILD_EXAMPLES_FROM_TREE |
| 19 | LOCAL_CPPFLAGS += -I../../../urcu/ -I../../../ |
| 20 | LIBURCU_QSBR_PATH = ../../../.libs/ |
| 21 | override LDFLAGS += -L$(LIBURCU_QSBR_PATH) -Wl,-rpath='$$ORIGIN/$(LIBURCU_QSBR_PATH)' |
| 22 | |
| 23 | # Third-party Makefiles have to define these targets to integrate with an |
| 24 | # automake project |
| 25 | EMPTY_AUTOMAKE_TARGETS = distdir install install-data install-exec uninstall \ |
| 26 | install-dvi install-html install-info install-ps install-pdf \ |
| 27 | installdirs check installcheck mostlyclean distclean maintainer-clean \ |
| 28 | dvi pdf ps info tags ctags |
| 29 | .PHONY: $(EMPTY_AUTOMAKE_TARGETS) |
| 30 | $(EMPTY_AUTOMAKE_TARGETS): |
| 31 | endif |
| 32 | |
| 33 | all: qsbr-minimal |
| 34 | |
| 35 | qsbr-minimal: qsbr-minimal.o |
| 36 | $(CC) -o $@ $^ $(LDFLAGS) $(LIBS) |
| 37 | |
| 38 | qsbr-minimal.o: qsbr-minimal.c |
| 39 | $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -c -o $@ $< |
| 40 | |
| 41 | .PHONY: clean |
| 42 | clean: |
| 43 | rm -f *.o qsbr-minimal |