make a dynamic lib
[lttv.git] / usertrace-generic / Makefile
index 91e09a85b7efb048dcd94301f25f3719494e9354..dfcccf9ea28db93a1993b907b846f7fb6fdb05a9 100644 (file)
@@ -1,23 +1,36 @@
 
-
 CC=gcc
+INCLUDE_DIR=/usr/include
+LIB_DIR=/usr/lib
 
-all: sample-thread sample sample-highspeed sample-printf
+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) -I. -lpthread -o $@ $^
+       $(CC) $(CFLAGS) -lpthread -o $@ $^
 
 sample: sample.c ltt-facility-loader-user_generic.c
-       $(CC) $(CFLAGS) -I. -o $@ $^
+       $(CC) $(CFLAGS) -o $@ $^
        
 sample-highspeed: sample-highspeed.c ltt-facility-loader-user_generic.c
-       $(CC) $(CFLAGS) -I. -o $@ $^
+       $(CC) $(CFLAGS) -o $@ $^
 
 sample-printf: sample-printf.c ltt-facility-loader-user_generic.c
-       $(CC) $(CFLAGS) -I. -o $@ $^
+       $(CC) $(CFLAGS) -o $@ $^
+
+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
 
-.PHONY : clean
+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
+       rm -fr *.o *~ sample-thread sample sample-highspeed sample-printf sample-instrument-fct ltt-instrument-functions.so.0 ltt-instrument-functions.so
 
This page took 0.023306 seconds and 4 git commands to generate.