Fix: build example SO when PIE is enabled
[lttng-ust.git] / doc / examples / getcpu-override / Makefile
CommitLineData
5e1b7b8b
MD
1# Copyright (C) 2013 Jérémie Galarneau <jeremie.galarneau@efficios.com>
2# Copyright (C) 2014 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 users may see how to build
14# a program with tracepoint provider probes as stand-alone shared objects.
15#
16# This makefile is purposefully kept simple to support GNU and BSD make.
17
5e1b7b8b
MD
18LIBS = -ldl # On Linux
19#LIBS = -lc # On BSD
20LOCAL_CPPFLAGS += -I.
21
22all: lttng-ust-getcpu-override-example.so
23
24lttng-ust-getcpu-override-example.o: lttng-ust-getcpu-override-example.c
e1c62734
MJ
25 $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS) \
26 $(CFLAGS) -fpic -c -o $@ $<
5e1b7b8b
MD
27
28lttng-ust-getcpu-override-example.so: lttng-ust-getcpu-override-example.o
40c1d6b9
MJ
29 $(CC) -Wl,--no-as-needed -o $@ $(LDFLAGS) $(AM_CFLAGS) \
30 $(AM_LDFLAGS) $(CFLAGS) -shared -fpic lttng-ust-getcpu-override-example.o
5e1b7b8b
MD
31
32.PHONY: clean
33clean:
34 rm -f *.o *.so
This page took 0.023696 seconds and 4 git commands to generate.