Fix: Don't override user variables within the build system
[lttng-ust.git] / doc / examples / demo / Makefile
... / ...
CommitLineData
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.
11#
12# This Makefile is not using automake so that users may see how to build
13# a program with tracepoint provider probes as stand-alone shared objects.
14#
15# This makefile is purposefully kept simple to support GNU and BSD make.
16
17LIBS = -ldl # On Linux
18#LIBS = -lc # On BSD
19LOCAL_CPPFLAGS += -I.
20
21all: demo lttng-ust-provider-ust-tests-demo.so lttng-ust-provider-ust-tests-demo3.so
22
23tp.o: tp.c ust_tests_demo.h
24 $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
25 $(CFLAGS) -fpic -c -o $@ $<
26
27tp2.o: tp2.c ust_tests_demo2.h
28 $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
29 $(CFLAGS) -fpic -c -o $@ $<
30
31lttng-ust-provider-ust-tests-demo.so: tp.o tp2.o
32 $(CC) -shared -Wl,--no-as-needed -o $@ $(LDFLAGS) $(AM_CFLAGS) \
33 $(AM_LDFLAGS) $(CFLAGS) -llttng-ust tp.o tp2.o
34
35tp3.o: tp3.c ust_tests_demo3.h
36 $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
37 $(CFLAGS) -fpic -c -o $@ $<
38
39lttng-ust-provider-ust-tests-demo3.so: tp3.o
40 $(CC) -shared -Wl,--no-as-needed -o $@ $(LDFLAGS) $(AM_CFLAGS) \
41 $(AM_LDFLAGS) $(CFLAGS) -llttng-ust tp3.o
42
43demo.o: demo.c
44 $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
45 $(CFLAGS) -c -o $@ $<
46
47demo: demo.o
48 $(CC) $(LDFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) $(CFLAGS) \
49 -o $@ demo.o $(LIBS)
50
51.PHONY: clean
52clean:
53 rm -f *.o *.so demo
This page took 0.021815 seconds and 4 git commands to generate.