LIB_DIR=/usr/lib
RANLIB=ranlib
-CFLAGS=-I. -O3
-LDFLAGS=-L.
+CFLAGS=-I. -O2 -L.
#For testing lib ltt-usertrace-fast
#CFLAGS+=-DLTT_SUBBUF_SIZE_CPU=134217728
all: libs samples
+#SAMPLE PROGRAMS
-libs: libltt-instrument-functions.a libltt-instrument-functions.so.0 \
- libltt-usertrace-fast.a libltt-usertrace-fast.so.0
-
-samples: sample-thread sample sample-highspeed sample-printf \
- sample-instrument-fct
-
-sample-thread: sample-thread.c ltt-facility-loader-user_generic.c
- $(CC) $(CFLAGS) -lpthread -o $@ $^
+samples: sample sample-highspeed sample-printf \
+ sample-instrument-fct sample-thread-slow sample-thread-fast
sample: sample.c ltt-facility-loader-user_generic.c
$(CC) $(CFLAGS) -o $@ $^
sample-highspeed: sample-highspeed.c ltt-facility-loader-user_generic.c
- $(CC) $(CFLAGS) -L. -lltt-usertrace-fast -o $@ $^
+ $(CC) $(CFLAGS) -lltt-usertrace-fast -o $@ $^
sample-printf: sample-printf.c ltt-facility-loader-user_generic.c
$(CC) $(CFLAGS) -o $@ $^
sample-instrument-fct: sample-instrument-fct.c
- $(CC) $(CFLAGS) -L. -g -finstrument-functions -lltt-instrument-functions -o $@ $^
+ $(CC) $(CFLAGS) -g -finstrument-functions -lltt-instrument-functions -o $@ $^
+
+sample-thread-slow: sample-thread-slow.c ltt-facility-loader-user_generic.c
+ $(CC) $(CFLAGS) -lpthread -o $@ $^
+
+sample-thread-fast: sample-thread-fast.c ltt-facility-loader-user_generic.c
+ $(CC) $(CFLAGS) -lpthread -lltt-usertrace-fast -o $@ $^
+
+
+#LIBRAIRIES
+
+libs: libltt-instrument-functions.a libltt-instrument-functions.so.0 \
+ libltt-usertrace-fast.a libltt-usertrace-fast.so.0
-libltt-usertrace-fast.a: ltt-usertrace-fast.o ltt-facility-loader-user_generic.o
+libltt-usertrace-fast.a: ltt-usertrace-fast.o
@rm -f libltt-usertrace-fast.a
$(AR) rc $@ $^
$(RANLIB) $@
-libltt-usertrace-fast.so.0: ltt-usertrace-fast.o ltt-facility-loader-user_generic.o
+libltt-usertrace-fast.so.0: ltt-usertrace-fast.o
@rm -f libltt-usertrace-fast.so libltt-usertrace-fast.so.0
$(CC) $(CFLAGS) -lpthread -shared -Wl,-soname,libltt-usertrace-fast.so -o $@ $^
ln -s libltt-usertrace-fast.so.0 libltt-usertrace-fast.so