fix size_t
[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. -O2 -L.
8
9 #For testing lib ltt-usertrace-fast
10 #CFLAGS+=-DLTT_SUBBUF_SIZE_CPU=134217728
11 #CFLAGS+=-DLTT_NULL_OUTPUT_TEST
12
13 all: libs samples
14
15 #SAMPLE PROGRAMS
16
17 samples: sample sample-highspeed sample-printf \
18 sample-instrument-fct sample-thread-slow sample-thread-fast
19
20 sample: sample.c ltt-facility-loader-user_generic.c
21 $(CC) $(CFLAGS) -o $@ $^
22
23 sample-highspeed: sample-highspeed.c ltt-facility-loader-user_generic.c
24 $(CC) $(CFLAGS) -lltt-usertrace-fast -o $@ $^
25
26 sample-printf: sample-printf.c ltt-facility-loader-user_generic.c
27 $(CC) $(CFLAGS) -o $@ $^
28
29 sample-instrument-fct: sample-instrument-fct.c
30 $(CC) $(CFLAGS) -g -finstrument-functions -lltt-instrument-functions -o $@ $^
31
32 sample-thread-slow: sample-thread-slow.c ltt-facility-loader-user_generic.c
33 $(CC) $(CFLAGS) -lpthread -o $@ $^
34
35 sample-thread-fast: sample-thread-fast.c ltt-facility-loader-user_generic.c
36 $(CC) $(CFLAGS) -lpthread -lltt-usertrace-fast -o $@ $^
37
38
39 #LIBRAIRIES
40
41 libs: libltt-instrument-functions.a libltt-instrument-functions.so.0 \
42 libltt-usertrace-fast.a libltt-usertrace-fast.so.0
43
44 libltt-usertrace-fast.a: ltt-usertrace-fast.o
45 @rm -f libltt-usertrace-fast.a
46 $(AR) rc $@ $^
47 $(RANLIB) $@
48
49 libltt-usertrace-fast.so.0: ltt-usertrace-fast.o
50 @rm -f libltt-usertrace-fast.so libltt-usertrace-fast.so.0
51 $(CC) $(CFLAGS) -lpthread -shared -Wl,-soname,libltt-usertrace-fast.so -o $@ $^
52 ln -s libltt-usertrace-fast.so.0 libltt-usertrace-fast.so
53
54 libltt-instrument-functions.a: ltt-instrument-functions.o ltt-facility-loader-user_generic.o ltt-usertrace-fast.o
55 @rm -f libltt-instrument-functions.a
56 $(AR) rc $@ $^
57 $(RANLIB) $@
58
59 libltt-instrument-functions.so.0: ltt-instrument-functions.o ltt-facility-loader-user_generic.o ltt-usertrace-fast.o
60 @rm -f libltt-instrument-functions.so libltt-instrument-functions.so.0
61 $(CC) $(CFLAGS) -lpthread -shared -Wl,-soname,libltt-instrument-functions.so -o $@ $^
62 ln -s libltt-instrument-functions.so.0 libltt-instrument-functions.so
63
64 .PHONY : clean install libs samples
65
66 install:
67 if [ ! -e "$(INCLUDE_DIR)/ltt" ] ; then mkdir $(INCLUDE_DIR)/ltt ; fi
68 cp -f ltt/*.h $(INCLUDE_DIR)/ltt
69 cp -df libltt-instrument-functions.so* libltt-instrument-functions.a $(LIB_DIR)
70 cp -df libltt-usertrace-fast.so* libltt-usertrace-fast.a $(LIB_DIR)
71
72 clean:
73 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* sample-thread-slow sample-thread-fast
74
This page took 0.038138 seconds and 4 git commands to generate.