| 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. |
| 12 | |
| 13 | # This makefile is not using automake so that people can see how to make |
| 14 | # simply. It builds a program with a statically embedded tracepoint |
| 15 | # provider probe. |
| 16 | # the "html" target helps for documentation (req. code2html) |
| 17 | |
| 18 | CC = gcc |
| 19 | LIBS = -ldl -llttng-ust |
| 20 | CFLAGS = -I. |
| 21 | |
| 22 | all: sample |
| 23 | |
| 24 | sample: sample.o tp.o |
| 25 | $(CC) $(LIBS) -o $@ $^ |
| 26 | |
| 27 | sample.o: sample.c sample_component_provider.h |
| 28 | $(CC) $(CFLAGS) -c -o $@ $< |
| 29 | |
| 30 | tp.o: tp.c sample_component_provider.h |
| 31 | $(CC) $(CFLAGS) -c -o $@ $< |
| 32 | |
| 33 | html: sample_component_provider.html sample.html tp.html |
| 34 | |
| 35 | %.html: %.c |
| 36 | code2html -lc $< $@ |
| 37 | |
| 38 | %.html : %.h |
| 39 | code2html -lc $< $@ |
| 40 | |
| 41 | .PHONY: clean |
| 42 | clean: |
| 43 | rm -f *.html |
| 44 | rm -f *.o sample |