b309ef6ed35889cd24809d639e78b9ce36727f59
[lttng-ust.git] / doc / examples / demo / 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 as stand-alone shared objects.
14 #
15 # This makefile is purposefully kept simple to support GNU and BSD make.
16
17 LIBS = -ldl # On Linux
18 #LIBS = -lc # On BSD
19 LOCAL_CPPFLAGS += -I.
20 AM_V_P := :
21
22 all: demo lttng-ust-provider-ust-tests-demo.so lttng-ust-provider-ust-tests-demo3.so
23
24 tp.o: tp.c ust_tests_demo.h
25 @if $(AM_V_P); then set -x; else echo " CC $@"; fi; \
26 $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
27 $(CFLAGS) -fpic -c -o $@ $<
28
29 tp2.o: tp2.c ust_tests_demo2.h
30 @if $(AM_V_P); then set -x; else echo " CC $@"; fi; \
31 $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
32 $(CFLAGS) -fpic -c -o $@ $<
33
34 lttng-ust-provider-ust-tests-demo.so: tp.o tp2.o
35 @if $(AM_V_P); then set -x; else echo " CCLD $@"; fi; \
36 $(CC) -Wl,--no-as-needed -o $@ $(LDFLAGS) $(AM_CFLAGS) \
37 $(AM_LDFLAGS) $(CFLAGS) -shared -fpic tp.o tp2.o $(LIBS) -llttng-ust
38
39 tp3.o: tp3.c ust_tests_demo3.h
40 @if $(AM_V_P); then set -x; else echo " CC $@"; fi; \
41 $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
42 $(CFLAGS) -fpic -c -o $@ $<
43
44 lttng-ust-provider-ust-tests-demo3.so: tp3.o
45 @if $(AM_V_P); then set -x; else echo " CCLD $@"; fi; \
46 $(CC) -Wl,--no-as-needed -o $@ $(LDFLAGS) $(AM_CFLAGS) \
47 $(AM_LDFLAGS) $(CFLAGS) -shared -fpic tp3.o $(LIBS) -llttng-ust
48
49 demo.o: demo.c
50 @if $(AM_V_P); then set -x; else echo " CC $@"; fi; \
51 $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
52 $(CFLAGS) -c -o $@ $<
53
54 demo: demo.o
55 @if $(AM_V_P); then set -x; else echo " CCLD $@"; fi; \
56 $(CC) $(LDFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) $(CFLAGS) \
57 -o $@ demo.o $(LIBS)
58
59 .PHONY: clean
60 clean:
61 rm -f *.o *.so demo
This page took 0.028792 seconds and 3 git commands to generate.