3d57eb5b |
1 | |
3d57eb5b |
2 | CC=gcc |
15146922 |
3 | INCLUDE_DIR=/usr/include |
20f73bc0 |
4 | LIB_DIR=/usr/lib |
06b6cf12 |
5 | RANLIB=ranlib |
3d57eb5b |
6 | |
976db1b3 |
7 | CFLAGS=-I. -O3 |
8 | LDFLAGS=-L. |
9 | |
10 | #For testing lib ltt-usertrace-fast |
11 | #CFLAGS+=-DLTT_SUBBUF_SIZE_CPU=134217728 |
12 | #CFLAGS+=-DLTT_NULL_OUTPUT_TEST |
13 | |
14 | all: libs samples |
15 | |
16 | |
17 | libs: libltt-instrument-functions.a libltt-instrument-functions.so.0 \ |
18 | libltt-usertrace-fast.a libltt-usertrace-fast.so.0 |
19 | |
20 | samples: sample-thread sample sample-highspeed sample-printf \ |
21 | sample-instrument-fct |
3d57eb5b |
22 | |
23 | sample-thread: sample-thread.c ltt-facility-loader-user_generic.c |
15146922 |
24 | $(CC) $(CFLAGS) -lpthread -o $@ $^ |
3d57eb5b |
25 | |
26 | sample: sample.c ltt-facility-loader-user_generic.c |
15146922 |
27 | $(CC) $(CFLAGS) -o $@ $^ |
972a52cf |
28 | |
29 | sample-highspeed: sample-highspeed.c ltt-facility-loader-user_generic.c |
976db1b3 |
30 | $(CC) $(CFLAGS) -L. -lltt-usertrace-fast -o $@ $^ |
3d57eb5b |
31 | |
e36efdc5 |
32 | sample-printf: sample-printf.c ltt-facility-loader-user_generic.c |
15146922 |
33 | $(CC) $(CFLAGS) -o $@ $^ |
34 | |
06b6cf12 |
35 | sample-instrument-fct: sample-instrument-fct.c |
36 | $(CC) $(CFLAGS) -L. -g -finstrument-functions -lltt-instrument-functions -o $@ $^ |
20f73bc0 |
37 | |
976db1b3 |
38 | libltt-usertrace-fast.a: ltt-usertrace-fast.o ltt-facility-loader-user_generic.o |
39 | @rm -f libltt-usertrace-fast.a |
40 | $(AR) rc $@ $^ |
41 | $(RANLIB) $@ |
42 | |
43 | libltt-usertrace-fast.so.0: ltt-usertrace-fast.o ltt-facility-loader-user_generic.o |
44 | @rm -f libltt-usertrace-fast.so libltt-usertrace-fast.so.0 |
45 | $(CC) $(CFLAGS) -lpthread -shared -Wl,-soname,libltt-usertrace-fast.so -o $@ $^ |
46 | ln -s libltt-usertrace-fast.so.0 libltt-usertrace-fast.so |
47 | |
48 | libltt-instrument-functions.a: ltt-instrument-functions.o ltt-facility-loader-user_generic.o ltt-usertrace-fast.o |
06b6cf12 |
49 | @rm -f libltt-instrument-functions.a |
50 | $(AR) rc $@ $^ |
51 | $(RANLIB) $@ |
52 | |
976db1b3 |
53 | libltt-instrument-functions.so.0: ltt-instrument-functions.o ltt-facility-loader-user_generic.o ltt-usertrace-fast.o |
06b6cf12 |
54 | @rm -f libltt-instrument-functions.so libltt-instrument-functions.so.0 |
976db1b3 |
55 | $(CC) $(CFLAGS) -lpthread -shared -Wl,-soname,libltt-instrument-functions.so -o $@ $^ |
06b6cf12 |
56 | ln -s libltt-instrument-functions.so.0 libltt-instrument-functions.so |
e90c7b86 |
57 | |
976db1b3 |
58 | .PHONY : clean install libs samples |
e36efdc5 |
59 | |
15146922 |
60 | install: |
61 | if [ ! -e "$(INCLUDE_DIR)/ltt" ] ; then mkdir $(INCLUDE_DIR)/ltt ; fi |
62 | cp -f ltt/*.h $(INCLUDE_DIR)/ltt |
b09f3215 |
63 | cp -df libltt-instrument-functions.so* libltt-instrument-functions.a $(LIB_DIR) |
976db1b3 |
64 | cp -df libltt-usertrace-fast.so* libltt-usertrace-fast.a $(LIB_DIR) |
3d57eb5b |
65 | |
66 | clean: |
976db1b3 |
67 | rm -fr *.o *~ sample-thread sample sample-highspeed sample-printf sample-instrument-fct libltt-instrument-functions.so* libltt-instrument-functions.a libltt-usertrace-fast.a libltt-usertrace-fast.so.0 |
3d57eb5b |
68 | |