completely remove kernel headers
[lttv.git] / ltt-usertrace / Makefile
1
2 CC=gcc
3 INCLUDE_DIR=/usr/include
4 LIB_DIR?=/usr/lib
5 RANLIB=ranlib
6
7 LTT_CFLAGS=-I. -O2 -L. -fPIC
8 # note : x86_64 needs -fPIC ? FIXME
9
10 #For testing lib ltt-usertrace-fast
11 #CFLAGS+=-DLTT_SUBBUF_SIZE_CPU=134217728
12 #CFLAGS+=-DLTT_NULL_OUTPUT_TEST
13
14 all: libs samples
15
16 #SAMPLE PROGRAMS
17
18 samples: sample sample-highspeed sample-printf \
19 sample-instrument-fct sample-thread-slow sample-thread-fast sample-thread-brand sample-block
20
21 sample: sample.c
22 $(CC) $(LTT_CFLAGS) $(CFLAGS) -lltt-loader-user_generic -o $@ $^
23 sample-block: sample-block.c
24 $(CC) $(LTT_CFLAGS) $(CFLAGS) -lltt-loader-user_generic -o $@ $^
25
26 sample-thread-brand: sample-thread-brand.c
27 $(CC) $(LTT_CFLAGS) $(CFLAGS) -lltt-loader-user_generic -o $@ $^
28
29 sample-highspeed: sample-highspeed.c
30 $(CC) $(LTT_CFLAGS) $(CFLAGS) -lltt-usertrace-fast -lltt-loader-user_generic -o $@ $^
31
32 sample-printf: sample-printf.c
33 $(CC) $(LTT_CFLAGS) $(CFLAGS) -lltt-loader-user_generic -o $@ $^
34
35 sample-instrument-fct: sample-instrument-fct.c
36 $(CC) $(LTT_CFLAGS) $(CFLAGS) -g -finstrument-functions -lltt-instrument-functions -o $@ $^
37
38 sample-thread-slow: sample-thread-slow.c
39 $(CC) $(LTT_CFLAGS) $(CFLAGS) -lpthread -lltt-loader-user_generic -o $@ $^
40
41 sample-thread-fast: sample-thread-fast.c
42 $(CC) $(LTT_CFLAGS) $(CFLAGS) -lpthread -lltt-usertrace-fast -lltt-loader-user_generic -o $@ $^
43
44
45 #LIBRAIRIES
46
47 libs: libltt-instrument-functions.a libltt-instrument-functions.so.0 \
48 libltt-usertrace-fast.a libltt-usertrace-fast.so.0 \
49 libltt-loader-user_generic.a libltt-loader-user_generic.so.0
50
51 libltt-usertrace-fast.a: ltt-usertrace-fast.o
52 @rm -f libltt-usertrace-fast.a
53 $(AR) rc $@ $^
54 $(RANLIB) $@
55
56 libltt-usertrace-fast.so.0: ltt-usertrace-fast.o
57 @rm -f libltt-usertrace-fast.so libltt-usertrace-fast.so.0
58 $(CC) $(LTT_CFLAGS) $(CFLAGS) -lpthread -shared -Wl,-soname,libltt-usertrace-fast.so -o $@ $^
59 ln -s libltt-usertrace-fast.so.0 libltt-usertrace-fast.so
60
61 libltt-instrument-functions.a: ltt-instrument-functions.o ltt-facility-loader-user_generic.o ltt-usertrace-fast.o
62 @rm -f libltt-instrument-functions.a
63 $(AR) rc $@ $^
64 $(RANLIB) $@
65
66 libltt-instrument-functions.so.0: ltt-instrument-functions.o ltt-facility-loader-user_generic.o ltt-usertrace-fast.o
67 @rm -f libltt-instrument-functions.so libltt-instrument-functions.so.0
68 $(CC) $(LTT_CFLAGS) $(CFLAGS) -lpthread -shared -Wl,-soname,libltt-instrument-functions.so -o $@ $^
69 ln -s libltt-instrument-functions.so.0 libltt-instrument-functions.so
70
71 libltt-loader-user_generic.a: ltt-facility-loader-user_generic.o
72 @rm -f libltt-loader-user_generic.a
73 $(AR) rc $@ $^
74 $(RANLIB) $@
75
76 libltt-loader-user_generic.so.0: ltt-facility-loader-user_generic.o
77 @rm -f libltt-loader-user_generic.so libltt-loader-user_generic.so.0
78 $(CC) $(LTT_CFLAGS) $(CFLAGS) -lpthread -shared -Wl,-soname,libltt-loader-user_generic.so -o $@ $^
79 ln -s libltt-loader-user_generic.so.0 libltt-loader-user_generic.so
80
81 %.o: %.c
82 $(CC) $(LTT_CFLAGS) $(CFLAGS) -c -o $@ $+
83
84 .PHONY : clean install libs install_libs install_headers samples
85
86 install_headers:
87 if [ ! -e "$(INCLUDE_DIR)/ltt" ] ; then mkdir $(INCLUDE_DIR)/ltt ; fi
88 cp -f ltt/*.h $(INCLUDE_DIR)/ltt
89
90 install_libs:
91 cp -df libltt-instrument-functions.so* libltt-instrument-functions.a $(LIB_DIR)
92 cp -df libltt-usertrace-fast.so* libltt-usertrace-fast.a $(LIB_DIR)
93 cp -df libltt-loader-user_generic.so* libltt-loader-user_generic.a $(LIB_DIR)
94
95 install: install_headers libs install_libs
96
97 clean:
98 find . -name \*~ | xargs rm -fr *.o sample-thread sample sample-highspeed sample-printf sample-instrument-fct libltt-instrument-functions.so* libltt-instrument-functions.a libltt-usertrace-fast.a libltt-usertrace-fast.so* libltt-loader-user_generic.so* libltt-loader-user_generic.a sample-thread-slow sample-thread-fast sample-thread-brand sample-block java/*.class java/Sample.h java/TestBrand.h
This page took 0.033125 seconds and 4 git commands to generate.