doc/examples: support BSD make
[lttng-ust.git] / doc / examples / hello-static-lib / Makefile
CommitLineData
a106a9f8
JG
1# Copyright (C) 2013 Jérémie Galarneau <jeremie.galarneau@efficios.com>
2#
3# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
4# OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
5#
6# Permission is hereby granted to use or copy this program for any
7# purpose, provided the above notices are retained on all copies.
8# Permission to modify the code and to distribute modified code is
9# granted, provided the above notices are retained, and a notice that
10# the code was modified is included with the above copyright notice.
2cd19027 11#
a106a9f8
JG
12# This Makefile is not using automake so that users may see how to build
13# a program with tracepoint provider probes compiled as static libraries.
2cd19027
MD
14#
15# This makefile is purposefully kept simple to support GNU and BSD make.
a106a9f8
JG
16
17CC = gcc
2d6a253a 18LOCAL_CPPFLAGS += -I.
a106a9f8
JG
19LIBS = -ldl -llttng-ust # On Linux
20#LIBS = -lc -llttng-ust # On BSD
21
a106a9f8
JG
22all: hello
23
24lttng-ust-provider-hello.o: tp.c ust_tests_hello.h
2cd19027
MD
25 $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \
26 $(AM_CFLAGS) -c -o $@ $<
a106a9f8
JG
27
28lttng-ust-provider-hello.a: lttng-ust-provider-hello.o
2cd19027 29 ar -rc $@ lttng-ust-provider-hello.o
a106a9f8
JG
30
31hello.o: hello.c
2cd19027
MD
32 $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \
33 $(AM_CFLAGS) -c -o $@ $<
a106a9f8
JG
34
35hello: hello.o lttng-ust-provider-hello.a
2cd19027
MD
36 $(CC) -o $@ $(LDFLAGS) $(CPPFLAGS) $(AM_LDFLAGS) $(AM_CFLAGS) \
37 $(LIBS) hello.o lttng-ust-provider-hello.a
a106a9f8
JG
38
39.PHONY: clean
40clean:
41 rm -f *.o *.a hello
This page took 0.024765 seconds and 4 git commands to generate.