X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=doc%2Fexamples%2Ftrigger-on-event%2FMakefile;fp=doc%2Fexamples%2Ftrigger-on-event%2FMakefile;h=f758a05cfd70950fb518e2b5f3557d632b4f3b85;hp=0000000000000000000000000000000000000000;hb=2463b7879c00298daa79744cdaae82ac061a4ed8;hpb=3a4595c2469472dee1656cde5f8882c2123efd3c diff --git a/doc/examples/trigger-on-event/Makefile b/doc/examples/trigger-on-event/Makefile new file mode 100644 index 000000000..f758a05cf --- /dev/null +++ b/doc/examples/trigger-on-event/Makefile @@ -0,0 +1,56 @@ +# Copyright (C) 2020 Jérémie Galarneau +# +# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED +# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. +# +# Permission is hereby granted to use or copy this program for any +# purpose, provided the above notices are retained on all copies. +# Permission to modify the code and to distribute modified code is +# granted, provided the above notices are retained, and a notice that +# the code was modified is included with the above copyright notice. +# +# This Makefile is not using automake so that users may see how to build +# a program with tracepoint provider probes compiled as static libraries. +# +# This makefile is purposefully kept simple to support GNU and BSD make. + +LOCAL_CPPFLAGS += -I. +LIBS_INSTRUMENTED_APP = -ldl -llttng-ust +LIBS_NOTIFICATION_CLIENT = -ldl -llttng-ctl +AM_V_P := : +AR ?= ar + +all: instrumented-app notification-client + +tracepoint-trigger-example.o: tracepoint-trigger-example.c tracepoint-trigger-example.h + @if $(AM_V_P); then set -x; else echo " CC $@"; fi; \ + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \ + $(CFLAGS) -c -o $@ $< + +tracepoint-trigger-example.a: tracepoint-trigger-example.o + @if $(AM_V_P); then set -x; else echo " AR $@"; fi; \ + $(AR) -rc $@ tracepoint-trigger-example.o + +instrumented-app.o: instrumented-app.c + @if $(AM_V_P); then set -x; else echo " CC $@"; fi; \ + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \ + $(CFLAGS) -c -o $@ $< + +instrumented-app: instrumented-app.o tracepoint-trigger-example.a + @if $(AM_V_P); then set -x; else echo " CCLD $@"; fi; \ + $(CC) -o $@ $(LDFLAGS) $(CPPFLAGS) $(AM_LDFLAGS) $(AM_CFLAGS) \ + $(CFLAGS) instrumented-app.o tracepoint-trigger-example.a $(LIBS_INSTRUMENTED_APP) + +notification-client.o: notification-client.c + @if $(AM_V_P); then set -x; else echo " CC $@"; fi; \ + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \ + $(CFLAGS) -c -o $@ $< + +notification-client: notification-client.o + @if $(AM_V_P); then set -x; else echo " CCLD $@"; fi; \ + $(CC) -o $@ $(LDFLAGS) $(CPPFLAGS) $(AM_LDFLAGS) $(AM_CFLAGS) \ + $(CFLAGS) notification-client.o tracepoint-trigger-example.a $(LIBS_NOTIFICATION_CLIENT) + +.PHONY: clean +clean: + rm -f *.o *.a instrumented-app notification-client