From: compudj Date: Tue, 7 Mar 2006 02:12:51 +0000 (+0000) Subject: make a dynamic lib X-Git-Tag: v0.12.20~1891 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=20f73bc0a87bdb4b616c84855f30dd2dd21aa70c;p=lttv.git make a dynamic lib git-svn-id: http://ltt.polymtl.ca/svn@1598 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/usertrace-generic/Makefile b/usertrace-generic/Makefile index e4cab2f6..dfcccf9e 100644 --- a/usertrace-generic/Makefile +++ b/usertrace-generic/Makefile @@ -1,8 +1,9 @@ CC=gcc INCLUDE_DIR=/usr/include +LIB_DIR=/usr/lib -all: sample-thread sample sample-highspeed sample-printf sample-instrument-fct +all: sample-thread sample sample-highspeed sample-printf sample-instrument-fct ltt-instrument-functions.so.0 sample-thread: sample-thread.c ltt-facility-loader-user_generic.c $(CC) $(CFLAGS) -lpthread -o $@ $^ @@ -18,14 +19,18 @@ sample-printf: sample-printf.c ltt-facility-loader-user_generic.c sample-instrument-fct: sample-instrument-fct.c ltt-facility-loader-user_generic.c ltt-instrument-functions.c $(CC) $(CFLAGS) -g -finstrument-functions -o $@ $^ - + +ltt-instrument-functions.so.0: ltt-facility-loader-user_generic.c ltt-instrument-functions.c + $(CC) $(CFLAGS) -shared -Wl,-soname,ltt-instrument-functions.so -o $@ $^ + ln -s ltt-instrument-functions.so.0 ltt-instrument-functions.so .PHONY : clean install install: if [ ! -e "$(INCLUDE_DIR)/ltt" ] ; then mkdir $(INCLUDE_DIR)/ltt ; fi cp -f ltt/*.h $(INCLUDE_DIR)/ltt + cp -f ltt-instrument-functions.so* $(LIB_DIR) clean: - rm -fr *.o *~ sample-thread sample sample-highspeed sample-printf sample-instrument-fct + rm -fr *.o *~ sample-thread sample sample-highspeed sample-printf sample-instrument-fct ltt-instrument-functions.so.0 ltt-instrument-functions.so diff --git a/usertrace-generic/README b/usertrace-generic/README index a10b3b22..01477a3d 100644 --- a/usertrace-generic/README +++ b/usertrace-generic/README @@ -169,8 +169,7 @@ See the sample-instrument-fct.c example program. - Compile your application with at least these parameters to gcc (it is splitted on two lines, joined by a "\") : gcc -g -finstrument-functions -I /usr/src/usertrace-generic -o myapp myapp.c \ - /usr/src/usertrace-generic/ltt-facility-loader-user_generic.c \ - /usr/src/usertrace-generic/ltt-instrument-functions.c + -l/usr/lib/ltt-instrument-functions.so To see what the final result looks like : - Start tracing