ec185c1ca38ba59bc0dad57d85803e41e991144b
[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 ifdef AM_CC
18 CC = $(AM_CC)
19 endif
20
21 LOCAL_CPPFLAGS += -I.
22 LIBS = -ldl -llttng-ust # On Linux
23 #LIBS = -lc -llttng-ust # On BSD
24
25 all: hello
26
27 lttng-ust-provider-hello.o: tp.c ust_tests_hello.h
28 $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \
29 $(AM_CFLAGS) -c -o $@ $<
30
31 lttng-ust-provider-hello.a: lttng-ust-provider-hello.o
32 ar -rc $@ lttng-ust-provider-hello.o
33
34 hello.o: hello.c
35 $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \
36 $(AM_CFLAGS) -c -o $@ $<
37
38 hello: hello.o lttng-ust-provider-hello.a
39 $(CC) -o $@ $(LDFLAGS) $(CPPFLAGS) $(AM_LDFLAGS) $(AM_CFLAGS) \
40 hello.o lttng-ust-provider-hello.a $(LIBS)
41
42 .PHONY: clean
43 clean:
44 rm -f *.o *.a hello
This page took 0.028383 seconds and 3 git commands to generate.