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.
15 LIBS
= -ldl
-llttng-ust
#On Linux
16 #LIBS = -lc -llttng-ust #On BSD
21 sample
: sample.o sample_tracepoint.o
22 @if
$(AM_V_P
); then set
-x
; else echo
" CCLD $@"; fi
; \
23 $(CC
) $(LDFLAGS
) $(AM_CFLAGS
) $(AM_LDFLAGS
) $(CFLAGS
) \
24 -o
$@ sample.o sample_tracepoint.o
$(LIBS
)
26 sample.o
: sample.c sample_tracepoint.h
27 @if
$(AM_V_P
); then set
-x
; else echo
" CC $@"; fi
; \
28 $(CC
) $(CPPFLAGS
) $(AM_CFLAGS
) $(AM_CPPFLAGS
) $(CFLAGS
) \
31 # Use this command to compile the .c manually
32 #sample_tracepoint.o: sample_tracepoint.c sample_tracepoint.h
33 # $(CC) $(CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) $(CFLAGS) \
36 # This rule generate .o only and depends on rules for generating
39 @if
$(AM_V_P
); then set
-x
; else echo
" CC $@"; fi
; \
40 CPPFLAGS
="$(AM_CPPFLAGS) $(CPPFLAGS)" \
41 CFLAGS
="$(AM_CFLAGS) $(CFLAGS)" \
43 $(PYTHON
) $(LTTNG_GEN_TP_PATH
)lttng-gen-tp
-o
$@
$<
45 # The following rule can be used to generate all files instead of having one
46 # for each file type. Note that the sample.o has a dependency on the
47 # .h, so you need to change that if you remove the %.h rule.
52 @if
$(AM_V_P
); then set
-x
; else echo
" GEN $@"; fi
; \
53 $(PYTHON
) $(LTTNG_GEN_TP_PATH
)lttng-gen-tp
-o
$@
$<
56 @if
$(AM_V_P
); then set
-x
; else echo
" GEN $@"; fi
; \
57 $(PYTHON
) $(LTTNG_GEN_TP_PATH
)lttng-gen-tp
-o
$@
$<
62 rm -f sample_tracepoint.h sample_tracepoint.c