| 1 | # SPDX-License-Identifier: MIT |
| 2 | # |
| 3 | # Copyright (C) 2013 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
| 4 | # Copyright (C) 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
| 5 | # |
| 6 | # This Makefile is not using automake so that users may see how to build |
| 7 | # a program with tracepoint provider probes as stand-alone shared objects. |
| 8 | # |
| 9 | # This makefile is purposefully kept simple to support GNU and BSD make. |
| 10 | |
| 11 | LIBS = -ldl -llttng-ust # On Linux |
| 12 | #LIBS = -lc # On BSD |
| 13 | LOCAL_CPPFLAGS += -I. |
| 14 | AM_V_P := : |
| 15 | |
| 16 | all: demo-tracelog demo-vtracelog |
| 17 | |
| 18 | demo-tracelog.o: demo-tracelog.c |
| 19 | @if $(AM_V_P); then set -x; else echo " CC $@"; fi; \ |
| 20 | $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \ |
| 21 | $(CFLAGS) -c -o $@ $< |
| 22 | |
| 23 | demo-tracelog: demo-tracelog.o |
| 24 | @if $(AM_V_P); then set -x; else echo " CCLD $@"; fi; \ |
| 25 | $(CC) $(LDFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) $(CFLAGS) \ |
| 26 | -o $@ $< $(LIBS) |
| 27 | |
| 28 | demo-vtracelog.o: demo-vtracelog.c |
| 29 | @if $(AM_V_P); then set -x; else echo " CC $@"; fi; \ |
| 30 | $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \ |
| 31 | $(CFLAGS) -c -o $@ $< |
| 32 | |
| 33 | demo-vtracelog: demo-vtracelog.o |
| 34 | @if $(AM_V_P); then set -x; else echo " CCLD $@"; fi; \ |
| 35 | $(CC) $(LDFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) $(CFLAGS) \ |
| 36 | -o $@ $< $(LIBS) |
| 37 | |
| 38 | .PHONY: clean |
| 39 | clean: |
| 40 | rm -f *.o *.a demo-tracelog demo-vtracelog |