Move to kernel style SPDX license identifiers
[lttng-ust.git] / doc / examples / hello-static-lib / Makefile
... / ...
CommitLineData
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
10LOCAL_CPPFLAGS += -I.
11LIBS = -ldl -llttng-ust # On Linux
12#LIBS = -lc -llttng-ust # On BSD
13AM_V_P := :
14AR ?= ar
15
16all: hello
17
18lttng-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
23lttng-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
27hello.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
32hello: 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
38clean:
39 rm -f *.o *.a hello
This page took 0.023005 seconds and 4 git commands to generate.