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