make a dynamic lib
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 7 Mar 2006 02:12:51 +0000 (02:12 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 7 Mar 2006 02:12:51 +0000 (02:12 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1598 04897980-b3bd-0310-b5e0-8ef037075253

usertrace-generic/Makefile
usertrace-generic/README

index e4cab2f648ebe19c25714e6a2c1dab951f62a603..dfcccf9ea28db93a1993b907b846f7fb6fdb05a9 100644 (file)
@@ -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
 
index a10b3b227572eef40cc2d6964e49d980d32ea8b8..01477a3d3a4f2d8330818ce7a65fc56b33a51056 100644 (file)
@@ -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
This page took 0.026083 seconds and 4 git commands to generate.