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