Commit | Line | Data |
---|---|---|
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. | |
16c96fc0 | 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) |
16c96fc0 MD |
16 | # |
17 | # This makefile is purposefully kept simple to support GNU and BSD make. | |
4807c6de MD |
18 | |
19 | CC = gcc | |
c6c454ab MD |
20 | LIBS = -ldl -llttng-ust # On Linux |
21 | #LIBS = -lc -llttng-ust # On BSD | |
2e390600 | 22 | LOCAL_CPPFLAGS += -I. |
a106a9f8 | 23 | |
4807c6de MD |
24 | all: sample |
25 | ||
26 | sample: sample.o tp.o | |
16c96fc0 MD |
27 | $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(AM_CFLAGS) \ |
28 | $(LIBS) sample.o tp.o | |
4807c6de MD |
29 | |
30 | sample.o: sample.c sample_component_provider.h | |
16c96fc0 MD |
31 | $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \ |
32 | $(AM_CFLAGS) -c -o $@ $< | |
4807c6de MD |
33 | |
34 | tp.o: tp.c sample_component_provider.h | |
16c96fc0 MD |
35 | $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \ |
36 | $(AM_CFLAGS) -c -o $@ $< | |
4807c6de MD |
37 | |
38 | html: sample_component_provider.html sample.html tp.html | |
39 | ||
a106a9f8 | 40 | %.html: %.c |
4807c6de MD |
41 | code2html -lc $< $@ |
42 | ||
43 | %.html : %.h | |
44 | code2html -lc $< $@ | |
45 | ||
46 | .PHONY: clean | |
47 | clean: | |
a106a9f8 | 48 | rm -f *.html |
4807c6de | 49 | rm -f *.o sample |