1 # Copyright (C) 2020 Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 # THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
4 # OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
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.
12 # This Makefile is not using automake so that users may see how to build
13 # a program with tracepoint provider probes compiled as static libraries.
15 # This makefile is purposefully kept simple to support GNU and BSD make.
18 LIBS_INSTRUMENTED_APP
= -ldl
-llttng-ust
19 LIBS_NOTIFICATION_CLIENT
= -ldl
-llttng-ctl
20 LIBS_PERFORMANCE_CLIENT
= -ldl
-llttng-ust
-llttng-ctl
24 all: producer consumer
26 performance.o
: performance.c performance.h
27 @if
$(AM_V_P
); then set
-x
; else echo
" CC $@"; fi
; \
28 $(CC
) $(CPPFLAGS
) $(LOCAL_CPPFLAGS
) $(AM_CFLAGS
) $(AM_CPPFLAGS
) \
31 performance.a
: performance.o
32 @if
$(AM_V_P
); then set
-x
; else echo
" AR $@"; fi
; \
33 $(AR
) -rc
$@ performance.o
35 producer.o
: producer.c
36 @if
$(AM_V_P
); then set
-x
; else echo
" CC $@"; fi
; \
37 $(CC
) $(CPPFLAGS
) $(LOCAL_CPPFLAGS
) $(AM_CFLAGS
) $(AM_CPPFLAGS
) \
40 consumer.o
: consumer.c
41 @if
$(AM_V_P
); then set
-x
; else echo
" CC $@"; fi
; \
42 $(CC
) $(CPPFLAGS
) $(LOCAL_CPPFLAGS
) $(AM_CFLAGS
) $(AM_CPPFLAGS
) \
45 producer
: producer.o performance.a
46 @if
$(AM_V_P
); then set
-x
; else echo
" CCLD $@"; fi
; \
47 $(CC
) -o
$@
$(LDFLAGS
) $(CPPFLAGS
) $(AM_LDFLAGS
) $(AM_CFLAGS
) \
48 $(CFLAGS
) producer.o performance.a
$(LIBS_PERFORMANCE_CLIENT
)
50 consumer
: consumer.o performance.a
51 @if
$(AM_V_P
); then set
-x
; else echo
" CCLD $@"; fi
; \
52 $(CC
) -o
$@
$(LDFLAGS
) $(CPPFLAGS
) $(AM_LDFLAGS
) $(AM_CFLAGS
) \
53 $(CFLAGS
) consumer.o performance.a
$(LIBS_PERFORMANCE_CLIENT
)
57 rm -f
*.o
*.a producer consumer