Move "hello-static-lib" to doc/examples and add non-automake Makefiles
[lttng-ust.git] / doc / examples / demo / Makefile
CommitLineData
60302adc
JG
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
a106a9f8
JG
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.
60302adc
JG
14
15CC = gcc
16LIBS = -ldl # On Linux
17#LIBS = -lc # On BSD
a106a9f8
JG
18CFLAGS += -I.
19
20# Only necessary when building from the source tree and lttng-ust is not
21# installed
22ifdef BUILD_EXAMPLES_FROM_TREE
23CFLAGS += -I../../../include/
24LIBLTTNG_UST_PATH = ../../../liblttng-ust/.libs/
25LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)'
26
27# Third-party Makefiles have to define these targets to integrate with an
28# automake project
29EMPTY_AUTOMAKE_TARGETS = distdir install install-data install-exec uninstall \
30 install-dvi install-html install-info install-ps install-pdf \
31 installdirs check installcheck mostlyclean distclean maintainer-clean \
32 dvi html pdf ps info tags ctags
33.PHONY: $(EMPTY_AUTOMAKE_TARGETS)
34$(EMPTY_AUTOMAKE_TARGETS):
35endif
60302adc
JG
36
37all: demo lttng-ust-provider-ust-tests-demo.so lttng-ust-provider-ust-tests-demo3.so
38
39lttng-ust-provider-ust-tests-demo.o: tp.c tp2.c ust_tests_demo.h ust_tests_demo2.h
40 $(CC) $(CFLAGS) -fpic -c -o $@ $<
41
42lttng-ust-provider-ust-tests-demo.so: lttng-ust-provider-ust-tests-demo.o
a106a9f8 43 $(CC) -shared -o $@ $(LDFLAGS) -llttng-ust $<
60302adc
JG
44
45lttng-ust-provider-ust-tests-demo3.o: tp3.c ust_tests_demo3.h
46 $(CC) $(CFLAGS) -fpic -c -o $@ $<
47
48lttng-ust-provider-ust-tests-demo3.so: lttng-ust-provider-ust-tests-demo3.o
a106a9f8 49 $(CC) -shared -o $@ $(LDFLAGS) -llttng-ust $<
60302adc
JG
50
51demo.o: demo.c
52 $(CC) $(CFLAGS) -c -o $@ $<
53
54demo: demo.o
55 $(CC) demo.o -o $@ $(LIBS)
56
57.PHONY: clean
58clean:
59 rm -f *.o *.so demo
This page took 0.025766 seconds and 4 git commands to generate.