b09f3215 |
1 | |
8b30e7bc |
2 | RANLIB=ranlib |
b09f3215 |
3 | |
4 | CC=gcc |
5 | |
8b30e7bc |
6 | all: test sample-instrument-fct libltt-instrument-functions.a libltt-instrument-functions.so.0 |
7 | |
1c48e587 |
8 | test: test.c ltt-usertrace-fast.c |
b09f3215 |
9 | $(CC) $(CFLAGS) -lpthread -o $@ $^ |
10 | |
8b30e7bc |
11 | |
12 | sample-instrument-fct: sample-instrument-fct.c |
13 | $(CC) $(CFLAGS) -L. -g -finstrument-functions -lltt-instrument-functions -o $@ $^ |
14 | |
15 | libltt-instrument-functions.a: ltt-instrument-functions.o ltt-facility-loader-user_generic.o |
16 | @rm -f libltt-instrument-functions.a |
17 | $(AR) rc $@ $^ |
18 | $(RANLIB) $@ |
19 | |
20 | libltt-instrument-functions.so.0: ltt-instrument-functions.o ltt-facility-loader-user_generic.o |
21 | @rm -f libltt-instrument-functions.so libltt-instrument-functions.so.0 |
22 | $(CC) $(CFLAGS) -shared -Wl,-soname,libltt-instrument-functions.so -o $@ $^ |
23 | ln -s libltt-instrument-functions.so.0 libltt-instrument-functions.so |
24 | |
25 | install: |
26 | if [ ! -e "$(INCLUDE_DIR)/ltt" ] ; then mkdir $(INCLUDE_DIR)/ltt ; fi |
27 | cp -f ltt/*.h $(INCLUDE_DIR)/ltt |
28 | cp -df libltt-instrument-functions.so* libltt-instrument-functions.a $(LIB_DIR) |
29 | |
30 | .PHONY : clean install |
b09f3215 |
31 | |
32 | clean: |
8b30e7bc |
33 | rm -fr *.o *~ test sample-instrument-fct libltt-instrument-functions.a libltt-instrument-functions.so* |