1 # SPDX-License-Identifier: MIT
3 # Copyright (C) 2011-2012 Matthew Khouzam <matthew.khouzam@ericsson.com>
4 # Copyright (C) 2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 # Copyright (C) 2012 Yannick Brosseau <yannick.brosseau@gmail.com>
7 # This makefile is not using automake so that people can see how to make
8 # simply. It builds a program with a statically embedded tracepoint
11 # This makefile is purposefully kept simple to support GNU and BSD make.
13 LIBS
= -ldl
-llttng-ust
#On Linux
14 #LIBS = -lc -llttng-ust #On BSD
19 sample
: sample.o sample_tracepoint.o
20 @if
$(AM_V_P
); then set
-x
; else echo
" CCLD $@"; fi
; \
21 $(CC
) $(LDFLAGS
) $(AM_CFLAGS
) $(AM_LDFLAGS
) $(CFLAGS
) \
22 -o
$@ sample.o sample_tracepoint.o
$(LIBS
)
24 sample.o
: sample.c sample_tracepoint.h
25 @if
$(AM_V_P
); then set
-x
; else echo
" CC $@"; fi
; \
26 $(CC
) $(CPPFLAGS
) $(AM_CFLAGS
) $(AM_CPPFLAGS
) $(CFLAGS
) \
29 # Use this command to compile the .c manually
30 #sample_tracepoint.o: sample_tracepoint.c sample_tracepoint.h
31 # $(CC) $(CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) $(CFLAGS) \
34 # This rule generate .o only and depends on rules for generating
37 @if
$(AM_V_P
); then set
-x
; else echo
" CC $@"; fi
; \
38 CPPFLAGS
="$(AM_CPPFLAGS) $(CPPFLAGS)" \
39 CFLAGS
="$(AM_CFLAGS) $(CFLAGS)" \
40 LDFLAGS
="$(AM_LDFLAGS) $(LDFLAGS)" \
42 $(LTTNG_GEN_TP_PATH
)lttng-gen-tp
-o
$@
$<
44 # The following rule can be used to generate all files instead of having one
45 # for each file type. Note that the sample.o has a dependency on the
46 # .h, so you need to change that if you remove the %.h rule.
51 @if
$(AM_V_P
); then set
-x
; else echo
" GEN $@"; fi
; \
52 $(LTTNG_GEN_TP_PATH
)lttng-gen-tp
-o
$@
$<
55 @if
$(AM_V_P
); then set
-x
; else echo
" GEN $@"; fi
; \
56 $(LTTNG_GEN_TP_PATH
)lttng-gen-tp
-o
$@
$<
61 rm -f sample_tracepoint.h sample_tracepoint.c