Fix examples: add missing CPPFLAGS
[lttng-ust.git] / doc / examples / gen-tp / Makefile
CommitLineData
b25c5b37
YB
1# Copyright (C) 2011-2012 Matthew Khouzam <matthew.khouzam@ericsson.com>
2# Copyright (C) 2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
3# Copyright (C) 2012 Yannick Brosseau <yannick.brosseau@gmail.com>
4#
5# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
6# OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
7#
8# Permission is hereby granted to use or copy this program for any
9# purpose, provided the above notices are retained on all copies.
10# Permission to modify the code and to distribute modified code is
11# granted, provided the above notices are retained, and a notice that
12# the code was modified is included with the above copyright notice.
13
14# This makefile is not using automake so that people can see how to make
15# simply. It builds a program with a statically embedded tracepoint
16# provider probe.
17
18CC = gcc
c6c454ab
MD
19
20LIBS = -ldl -llttng-ust #On Linux
21#LIBS = -lc -llttng-ust #On BSD
b25c5b37
YB
22
23all: sample
24
db06a0a2 25sample: sample.o sample_tracepoint.o
fe09e879 26 $(CC) -o $@ $^ $(LIBS)
b25c5b37
YB
27
28sample.o: sample.c sample_tracepoint.h
8b21f716 29 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
b25c5b37 30
db06a0a2
YB
31# Use this command to compile the .c manually
32#sample_tracepoint.o: sample_tracepoint.c sample_tracepoint.h
33# $(CC) $(CFLAGS) -I. -c -o $@ $<
34
35# This rule generate .o only and depends on rules for generating
36# the .h and .c
37%.o: %.tp %.c %.h
1df0c755 38 lttng-gen-tp -o $@ $<
db06a0a2
YB
39
40# The following rule can be used to generate all files instead of having one
41# for each file type. Note that the sample.o has a dependency on the
42# .h, so you need to change that if you remove the %.h rule.
43#%.o: %.tp
44# lttng-gen-tp $<
b25c5b37
YB
45
46%.h: %.tp
47 lttng-gen-tp -o $@ $<
db06a0a2 48
b25c5b37
YB
49%.c: %.tp
50 lttng-gen-tp -o $@ $<
51
52.PHONY: clean
53clean:
54 rm -f *.o sample
55 rm -f sample_tracepoint.h sample_tracepoint.c
This page took 0.025918 seconds and 4 git commands to generate.