new ltt-usertrace
[lttv.git] / ltt-usertrace / Makefile
1
2 CC=gcc
3 INCLUDE_DIR=/usr/include
4 LIB_DIR=/usr/lib
5 RANLIB=ranlib
6
7 CFLAGS=-I. -O3
8 LDFLAGS=-L.
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
20
21 sample: sample.c ltt-facility-loader-user_generic.c
22 $(CC) $(CFLAGS) -o $@ $^
23
24 sample-highspeed: sample-highspeed.c ltt-facility-loader-user_generic.c
25 $(CC) $(CFLAGS) -L. -lltt-usertrace-fast -o $@ $^
26
27 sample-printf: sample-printf.c ltt-facility-loader-user_generic.c
28 $(CC) $(CFLAGS) -o $@ $^
29
30 sample-instrument-fct: sample-instrument-fct.c
31 $(CC) $(CFLAGS) -L. -g -finstrument-functions -lltt-instrument-functions -o $@ $^
32
33 sample-thread-slow: sample-thread-slow.c ltt-facility-loader-user_generic.c
34 $(CC) $(CFLAGS) -lpthread -o $@ $^
35
36 sample-thread-fast: sample-thread-fast.c ltt-facility-loader-user_generic.c
37 $(CC) $(CFLAGS) -lpthread -o $@ $^
38
39
40 #LIBRAIRIES
41
42 libs: libltt-instrument-functions.a libltt-instrument-functions.so.0 \
43 libltt-usertrace-fast.a libltt-usertrace-fast.so.0
44
45 libltt-usertrace-fast.a: ltt-usertrace-fast.o
46 @rm -f libltt-usertrace-fast.a
47 $(AR) rc $@ $^
48 $(RANLIB) $@
49
50 libltt-usertrace-fast.so.0: ltt-usertrace-fast.o
51 @rm -f libltt-usertrace-fast.so libltt-usertrace-fast.so.0
52 $(CC) $(CFLAGS) -lpthread -shared -Wl,-soname,libltt-usertrace-fast.so -o $@ $^
53 ln -s libltt-usertrace-fast.so.0 libltt-usertrace-fast.so
54
55 libltt-instrument-functions.a: ltt-instrument-functions.o ltt-facility-loader-user_generic.o ltt-usertrace-fast.o
56 @rm -f libltt-instrument-functions.a
57 $(AR) rc $@ $^
58 $(RANLIB) $@
59
60 libltt-instrument-functions.so.0: ltt-instrument-functions.o ltt-facility-loader-user_generic.o ltt-usertrace-fast.o
61 @rm -f libltt-instrument-functions.so libltt-instrument-functions.so.0
62 $(CC) $(CFLAGS) -lpthread -shared -Wl,-soname,libltt-instrument-functions.so -o $@ $^
63 ln -s libltt-instrument-functions.so.0 libltt-instrument-functions.so
64
65 .PHONY : clean install libs samples
66
67 install:
68 if [ ! -e "$(INCLUDE_DIR)/ltt" ] ; then mkdir $(INCLUDE_DIR)/ltt ; fi
69 cp -f ltt/*.h $(INCLUDE_DIR)/ltt
70 cp -df libltt-instrument-functions.so* libltt-instrument-functions.a $(LIB_DIR)
71 cp -df libltt-usertrace-fast.so* libltt-usertrace-fast.a $(LIB_DIR)
72
73 clean:
74 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.0
75
This page took 0.029642 seconds and 4 git commands to generate.