Commit | Line | Data |
---|---|---|
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. | |
16c96fc0 | 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. | |
16c96fc0 MD |
14 | # |
15 | # This makefile is purposefully kept simple to support GNU and BSD make. | |
60302adc JG |
16 | |
17 | CC = gcc | |
18 | LIBS = -ldl # On Linux | |
19 | #LIBS = -lc # On BSD | |
2e390600 | 20 | LOCAL_CPPFLAGS += -I. |
a106a9f8 | 21 | |
60302adc JG |
22 | all: demo lttng-ust-provider-ust-tests-demo.so lttng-ust-provider-ust-tests-demo3.so |
23 | ||
08a10b1b | 24 | tp.o: tp.c ust_tests_demo.h |
16c96fc0 MD |
25 | $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \ |
26 | $(AM_CFLAGS) -fpic -c -o $@ $< | |
60302adc | 27 | |
08a10b1b | 28 | tp2.o: tp2.c ust_tests_demo2.h |
16c96fc0 MD |
29 | $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \ |
30 | $(AM_CFLAGS) -fpic -c -o $@ $< | |
08a10b1b MD |
31 | |
32 | lttng-ust-provider-ust-tests-demo.so: tp.o tp2.o | |
16c96fc0 MD |
33 | $(CC) -shared -Wl,--no-as-needed -o $@ $(LDFLAGS) $(CFLAGS) \ |
34 | $(AM_LDFLAGS) $(AM_CFLAGS) -llttng-ust tp.o tp2.o | |
60302adc | 35 | |
08a10b1b | 36 | tp3.o: tp3.c ust_tests_demo3.h |
16c96fc0 MD |
37 | $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \ |
38 | $(AM_CFLAGS) -fpic -c -o $@ $< | |
60302adc | 39 | |
08a10b1b | 40 | lttng-ust-provider-ust-tests-demo3.so: tp3.o |
16c96fc0 MD |
41 | $(CC) -shared -Wl,--no-as-needed -o $@ $(LDFLAGS) $(CFLAGS) \ |
42 | $(AM_LDFLAGS) $(AM_CFLAGS) -llttng-ust tp3.o | |
60302adc JG |
43 | |
44 | demo.o: demo.c | |
16c96fc0 MD |
45 | $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) \ |
46 | $(AM_CFLAGS) -c -o $@ $< | |
60302adc JG |
47 | |
48 | demo: demo.o | |
16c96fc0 MD |
49 | $(CC) $(LDFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(AM_CFLAGS) \ |
50 | -o $@ demo.o $(LIBS) | |
60302adc JG |
51 | |
52 | .PHONY: clean | |
53 | clean: | |
54 | rm -f *.o *.so demo |