Pass the CC variable to the example Makefiles
[lttng-ust.git] / doc / examples / easy-ust / Makefile
CommitLineData
4807c6de
MD
1# Copyright (C) 2011-2012 Matthew Khouzam <matthew.khouzam@ericsson.com>
2# Copyright (C) 2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
3#
4# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
5# OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
6#
7# Permission is hereby granted to use or copy this program for any
8# purpose, provided the above notices are retained on all copies.
9# Permission to modify the code and to distribute modified code is
10# granted, provided the above notices are retained, and a notice that
11# the code was modified is included with the above copyright notice.
2cd19027 12#
a106a9f8
JG
13# This makefile is not using automake so that users can see how to build
14# a program with a statically embedded tracepoint provider probe.
4807c6de 15# the "html" target helps for documentation (req. code2html)
2cd19027
MD
16#
17# This makefile is purposefully kept simple to support GNU and BSD make.
4807c6de 18
0728d307
JG
19ifdef AM_CC
20 CC = $(AM_CC)
21endif
22
c6c454ab
MD
23LIBS = -ldl -llttng-ust # On Linux
24#LIBS = -lc -llttng-ust # On BSD
2d6a253a 25LOCAL_CPPFLAGS += -I.
a106a9f8 26
4807c6de
MD
27all: sample
28
29sample: sample.o tp.o
2cd19027 30 $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(AM_CFLAGS) \
6689c64e 31 sample.o tp.o $(LIBS)
4807c6de
MD
32
33sample.o: sample.c sample_component_provider.h
2cd19027
MD
34 $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \
35 $(AM_CFLAGS) -c -o $@ $<
4807c6de
MD
36
37tp.o: tp.c sample_component_provider.h
2cd19027
MD
38 $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \
39 $(AM_CFLAGS) -c -o $@ $<
4807c6de
MD
40
41html: sample_component_provider.html sample.html tp.html
42
a106a9f8 43%.html: %.c
4807c6de
MD
44 code2html -lc $< $@
45
46%.html : %.h
47 code2html -lc $< $@
48
49.PHONY: clean
50clean:
a106a9f8 51 rm -f *.html
4807c6de 52 rm -f *.o sample
This page took 0.026698 seconds and 4 git commands to generate.