8f094e0e70e5fff33ff29458136bd6dc0aaea794
[lttng-ust.git] / doc / examples / hello-static-lib / Makefile
1 # Copyright (C) 2013 Jérémie Galarneau <jeremie.galarneau@efficios.com>
2 #
3 # THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
4 # OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
5 #
6 # Permission is hereby granted to use or copy this program for any
7 # purpose, provided the above notices are retained on all copies.
8 # Permission to modify the code and to distribute modified code is
9 # granted, provided the above notices are retained, and a notice that
10 # the code was modified is included with the above copyright notice.
11 #
12 # This Makefile is not using automake so that users may see how to build
13 # a program with tracepoint provider probes compiled as static libraries.
14 #
15 # This makefile is purposefully kept simple to support GNU and BSD make.
16
17 LOCAL_CPPFLAGS += -I.
18 LIBS = -ldl -llttng-ust # On Linux
19 #LIBS = -lc -llttng-ust # On BSD
20 AM_V_P := :
21 AR ?= ar
22
23 all: hello
24
25 lttng-ust-provider-hello.o: tp.c ust_tests_hello.h
26 @if $(AM_V_P); then set -x; else echo " CC $@"; fi; \
27 $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
28 $(CFLAGS) -c -o $@ $<
29
30 lttng-ust-provider-hello.a: lttng-ust-provider-hello.o
31 @if $(AM_V_P); then set -x; else echo " AR $@"; fi; \
32 $(AR) -rc $@ lttng-ust-provider-hello.o
33
34 hello.o: hello.c
35 @if $(AM_V_P); then set -x; else echo " CC $@"; fi; \
36 $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
37 $(CFLAGS) -c -o $@ $<
38
39 hello: hello.o lttng-ust-provider-hello.a
40 @if $(AM_V_P); then set -x; else echo " CCLD $@"; fi; \
41 $(CC) -o $@ $(LDFLAGS) $(CPPFLAGS) $(AM_LDFLAGS) $(AM_CFLAGS) \
42 $(CFLAGS) hello.o lttng-ust-provider-hello.a $(LIBS)
43
44 .PHONY: clean
45 clean:
46 rm -f *.o *.a hello
This page took 0.029144 seconds and 3 git commands to generate.