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