Pass the CC variable to the example Makefiles
[lttng-ust.git] / doc / examples / demo / Makefile
CommitLineData
60302adc
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 as stand-alone shared objects.
2cd19027
MD
14#
15# This makefile is purposefully kept simple to support GNU and BSD make.
60302adc 16
0728d307
JG
17ifdef AM_CC
18 CC = $(AM_CC)
19endif
20
60302adc
JG
21LIBS = -ldl # On Linux
22#LIBS = -lc # On BSD
2d6a253a 23LOCAL_CPPFLAGS += -I.
a106a9f8 24
60302adc
JG
25all: demo lttng-ust-provider-ust-tests-demo.so lttng-ust-provider-ust-tests-demo3.so
26
08a10b1b 27tp.o: tp.c ust_tests_demo.h
2cd19027
MD
28 $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \
29 $(AM_CFLAGS) -fpic -c -o $@ $<
60302adc 30
08a10b1b 31tp2.o: tp2.c ust_tests_demo2.h
2cd19027
MD
32 $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \
33 $(AM_CFLAGS) -fpic -c -o $@ $<
08a10b1b
MD
34
35lttng-ust-provider-ust-tests-demo.so: tp.o tp2.o
2cd19027
MD
36 $(CC) -shared -Wl,--no-as-needed -o $@ $(LDFLAGS) $(CFLAGS) \
37 $(AM_LDFLAGS) $(AM_CFLAGS) -llttng-ust tp.o tp2.o
60302adc 38
08a10b1b 39tp3.o: tp3.c ust_tests_demo3.h
2cd19027
MD
40 $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \
41 $(AM_CFLAGS) -fpic -c -o $@ $<
60302adc 42
08a10b1b 43lttng-ust-provider-ust-tests-demo3.so: tp3.o
2cd19027
MD
44 $(CC) -shared -Wl,--no-as-needed -o $@ $(LDFLAGS) $(CFLAGS) \
45 $(AM_LDFLAGS) $(AM_CFLAGS) -llttng-ust tp3.o
60302adc
JG
46
47demo.o: demo.c
2cd19027
MD
48 $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \
49 $(AM_CFLAGS) -c -o $@ $<
60302adc
JG
50
51demo: demo.o
2cd19027
MD
52 $(CC) $(LDFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(AM_CFLAGS) \
53 -o $@ demo.o $(LIBS)
60302adc
JG
54
55.PHONY: clean
56clean:
57 rm -f *.o *.so demo
This page took 0.025317 seconds and 4 git commands to generate.