Commit | Line | Data |
---|---|---|
c0c0989a | 1 | # SPDX-License-Identifier: MIT |
a106a9f8 | 2 | # |
c0c0989a | 3 | # Copyright (C) 2013 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
16c96fc0 | 4 | # |
a106a9f8 JG |
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. | |
16c96fc0 MD |
7 | # |
8 | # This makefile is purposefully kept simple to support GNU and BSD make. | |
a106a9f8 | 9 | |
2e390600 | 10 | LOCAL_CPPFLAGS += -I. |
a106a9f8 JG |
11 | LIBS = -ldl -llttng-ust # On Linux |
12 | #LIBS = -lc -llttng-ust # On BSD | |
dc5af9e3 | 13 | AM_V_P := : |
43f42e0a | 14 | AR ?= ar |
a106a9f8 | 15 | |
a106a9f8 JG |
16 | all: hello |
17 | ||
18 | lttng-ust-provider-hello.o: tp.c ust_tests_hello.h | |
dc5af9e3 MJ |
19 | @if $(AM_V_P); then set -x; else echo " CC $@"; fi; \ |
20 | $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \ | |
e1c62734 | 21 | $(CFLAGS) -c -o $@ $< |
a106a9f8 JG |
22 | |
23 | lttng-ust-provider-hello.a: lttng-ust-provider-hello.o | |
dc5af9e3 | 24 | @if $(AM_V_P); then set -x; else echo " AR $@"; fi; \ |
43f42e0a | 25 | $(AR) -rc $@ lttng-ust-provider-hello.o |
a106a9f8 JG |
26 | |
27 | hello.o: hello.c | |
dc5af9e3 MJ |
28 | @if $(AM_V_P); then set -x; else echo " CC $@"; fi; \ |
29 | $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \ | |
e1c62734 | 30 | $(CFLAGS) -c -o $@ $< |
a106a9f8 JG |
31 | |
32 | hello: hello.o lttng-ust-provider-hello.a | |
dc5af9e3 MJ |
33 | @if $(AM_V_P); then set -x; else echo " CCLD $@"; fi; \ |
34 | $(CC) -o $@ $(LDFLAGS) $(CPPFLAGS) $(AM_LDFLAGS) $(AM_CFLAGS) \ | |
e1c62734 | 35 | $(CFLAGS) hello.o lttng-ust-provider-hello.a $(LIBS) |
a106a9f8 JG |
36 | |
37 | .PHONY: clean | |
38 | clean: | |
39 | rm -f *.o *.a hello |