|
Packit |
c04fcb |
# Copyright (C) 2011-2012 Matthew Khouzam <matthew.khouzam@ericsson.com>
|
|
Packit |
c04fcb |
# Copyright (C) 2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
|
Packit |
c04fcb |
# Copyright (C) 2012 Yannick Brosseau <yannick.brosseau@gmail.com>
|
|
Packit |
c04fcb |
#
|
|
Packit |
c04fcb |
# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
|
|
Packit |
c04fcb |
# OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
|
|
Packit |
c04fcb |
#
|
|
Packit |
c04fcb |
# Permission is hereby granted to use or copy this program for any
|
|
Packit |
c04fcb |
# purpose, provided the above notices are retained on all copies.
|
|
Packit |
c04fcb |
# Permission to modify the code and to distribute modified code is
|
|
Packit |
c04fcb |
# granted, provided the above notices are retained, and a notice that
|
|
Packit |
c04fcb |
# the code was modified is included with the above copyright notice.
|
|
Packit |
c04fcb |
#
|
|
Packit |
c04fcb |
# This makefile is not using automake so that people can see how to make
|
|
Packit |
c04fcb |
# simply. It builds a program with a statically embedded tracepoint
|
|
Packit |
c04fcb |
# provider probe.
|
|
Packit |
c04fcb |
#
|
|
Packit |
c04fcb |
# This makefile is purposefully kept simple to support GNU and BSD make.
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
ifdef AM_CC
|
|
Packit |
c04fcb |
CC = $(AM_CC)
|
|
Packit |
c04fcb |
endif
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
LIBS = -ldl -llttng-ust #On Linux
|
|
Packit |
c04fcb |
#LIBS = -lc -llttng-ust #On BSD
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
all: sample
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
sample: sample.o sample_tracepoint.o
|
|
Packit |
c04fcb |
$(CC) $(LDFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(AM_CFLAGS) \
|
|
Packit |
c04fcb |
-o $@ sample.o sample_tracepoint.o $(LIBS)
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
sample.o: sample.c sample_tracepoint.h
|
|
Packit |
c04fcb |
$(CC) $(CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) $(AM_CFLAGS) \
|
|
Packit |
c04fcb |
-c -o $@ $<
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
# Use this command to compile the .c manually
|
|
Packit |
c04fcb |
#sample_tracepoint.o: sample_tracepoint.c sample_tracepoint.h
|
|
Packit |
c04fcb |
# $(CC) $(CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) $(AM_CFLAGS) \
|
|
Packit |
c04fcb |
# -I. -c -o $@ $<
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
# This rule generate .o only and depends on rules for generating
|
|
Packit |
c04fcb |
# the .h and .c
|
|
Packit |
c04fcb |
%.o: %.tp %.c %.h
|
|
Packit |
c04fcb |
CPPFLAGS="$(CPPFLAGS) $(AM_CPPFLAGS)" \
|
|
Packit |
c04fcb |
CFLAGS="$(CFLAGS) $(AM_CFLAGS)" \
|
|
Packit |
c04fcb |
LDFLAGS="$(LDFLAGS) $(AM_LDFLAGS)" \
|
|
Packit |
c04fcb |
CC="$(CC)" \
|
|
Packit |
c04fcb |
$(LTTNG_GEN_TP_PATH)lttng-gen-tp -o $@ $<
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
# The following rule can be used to generate all files instead of having one
|
|
Packit |
c04fcb |
# for each file type. Note that the sample.o has a dependency on the
|
|
Packit |
c04fcb |
# .h, so you need to change that if you remove the %.h rule.
|
|
Packit |
c04fcb |
#%.o: %.tp
|
|
Packit |
c04fcb |
# lttng-gen-tp $<
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
%.h: %.tp
|
|
Packit |
c04fcb |
$(LTTNG_GEN_TP_PATH)lttng-gen-tp -o $@ $<
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
%.c: %.tp
|
|
Packit |
c04fcb |
$(LTTNG_GEN_TP_PATH)lttng-gen-tp -o $@ $<
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
.PHONY: clean
|
|
Packit |
c04fcb |
clean:
|
|
Packit |
c04fcb |
rm -f *.o sample
|
|
Packit |
c04fcb |
rm -f sample_tracepoint.h sample_tracepoint.c
|