Move to kernel style SPDX license identifiers
[lttng-ust.git] / doc / examples / hello-static-lib / Makefile
1 # SPDX-License-Identifier: MIT
2 #
3 # Copyright (C) 2013 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 #
5 # This Makefile is not using automake so that users may see how to build
6 # a program with tracepoint provider probes compiled as static libraries.
7 #
8 # This makefile is purposefully kept simple to support GNU and BSD make.
9
10 LOCAL_CPPFLAGS += -I.
11 LIBS = -ldl -llttng-ust # On Linux
12 #LIBS = -lc -llttng-ust # On BSD
13 AM_V_P := :
14 AR ?= ar
15
16 all: hello
17
18 lttng-ust-provider-hello.o: tp.c ust_tests_hello.h
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 lttng-ust-provider-hello.a: lttng-ust-provider-hello.o
24 @if $(AM_V_P); then set -x; else echo " AR $@"; fi; \
25 $(AR) -rc $@ lttng-ust-provider-hello.o
26
27 hello.o: hello.c
28 @if $(AM_V_P); then set -x; else echo " CC $@"; fi; \
29 $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
30 $(CFLAGS) -c -o $@ $<
31
32 hello: hello.o lttng-ust-provider-hello.a
33 @if $(AM_V_P); then set -x; else echo " CCLD $@"; fi; \
34 $(CC) -o $@ $(LDFLAGS) $(CPPFLAGS) $(AM_LDFLAGS) $(AM_CFLAGS) \
35 $(CFLAGS) hello.o lttng-ust-provider-hello.a $(LIBS)
36
37 .PHONY: clean
38 clean:
39 rm -f *.o *.a hello
This page took 0.028365 seconds and 4 git commands to generate.