Move include directive from CFLAGS to LOCAL_CPPFLAGS in examples' Makefiles
[lttng-ust.git] / doc / examples / hello-static-lib / Makefile
CommitLineData
a106a9f8
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
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
15CC = gcc
2d6a253a 16LOCAL_CPPFLAGS += -I.
a106a9f8
JG
17LIBS = -ldl -llttng-ust # On Linux
18#LIBS = -lc -llttng-ust # On BSD
19
20# Only necessary when building from the source tree and lttng-ust is not
21# installed
22ifdef BUILD_EXAMPLES_FROM_TREE
2d6a253a 23LOCAL_CPPFLAGS += -I../../../include/
a106a9f8 24LIBLTTNG_UST_PATH = ../../../liblttng-ust/.libs/
2d6a253a 25override LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)'
a106a9f8
JG
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
36
37all: hello
38
39lttng-ust-provider-hello.o: tp.c ust_tests_hello.h
2d6a253a 40 $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -c -o $@ $<
a106a9f8
JG
41
42lttng-ust-provider-hello.a: lttng-ust-provider-hello.o
8e950684 43 ar -rc $@ $^
a106a9f8
JG
44
45hello.o: hello.c
2d6a253a 46 $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -c -o $@ $<
a106a9f8
JG
47
48hello: hello.o lttng-ust-provider-hello.a
10f0ace2 49 $(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
a106a9f8
JG
50
51.PHONY: clean
52clean:
53 rm -f *.o *.a hello
This page took 0.025081 seconds and 4 git commands to generate.