Skip to content

Instantly share code, notes, and snippets.

@5kg
Created May 10, 2013 16:24
Show Gist options
  • Save 5kg/5555517 to your computer and use it in GitHub Desktop.
Save 5kg/5555517 to your computer and use it in GitHub Desktop.
diff --git a/doc/examples/demo/Makefile b/doc/examples/demo/Makefile
index 41f4321..3bd22c2 100644
--- a/doc/examples/demo/Makefile
+++ b/doc/examples/demo/Makefile
@@ -19,11 +19,14 @@ CFLAGS = -I.
all: demo lttng-ust-provider-ust-tests-demo.so lttng-ust-provider-ust-tests-demo3.so
-lttng-ust-provider-ust-tests-demo.o: tp.c tp2.c ust_tests_demo.h ust_tests_demo2.h
+lttng-ust-provider-ust-tests-demo.o: tp.c ust_tests_demo.h
$(CC) $(CFLAGS) -fpic -c -o $@ $<
-lttng-ust-provider-ust-tests-demo.so: lttng-ust-provider-ust-tests-demo.o
- $(CC) -shared -o $@ -llttng-ust $<
+lttng-ust-provider-ust-tests-demo2.o: tp2.c ust_tests_demo2.h
+ $(CC) $(CFLAGS) -fpic -c -o $@ $<
+
+lttng-ust-provider-ust-tests-demo.so: lttng-ust-provider-ust-tests-demo.o lttng-ust-provider-ust-tests-demo2.o
+ $(CC) -shared -o $@ -llttng-ust $?
lttng-ust-provider-ust-tests-demo3.o: tp3.c ust_tests_demo3.h
$(CC) $(CFLAGS) -fpic -c -o $@ $<
$ make -n
gcc -I. -c -o demo.o demo.c
gcc demo.o -o demo -ldl
gcc -I. -fpic -c -o lttng-ust-provider-ust-tests-demo.o tp.c
gcc -shared -o lttng-ust-provider-ust-tests-demo.so -llttng-ust lttng-ust-provider-ust-tests-demo.o
gcc -I. -fpic -c -o lttng-ust-provider-ust-tests-demo3.o tp3.c
gcc -shared -o lttng-ust-provider-ust-tests-demo3.so -llttng-ust lttng-ust-provider-ust-tests-demo3.o
# Copyright (C) 2013 Jérémie Galarneau <jeremie.galarneau@efficios.com>
#
# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
# OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
#
# Permission is hereby granted to use or copy this program for any
# purpose, provided the above notices are retained on all copies.
# Permission to modify the code and to distribute modified code is
# granted, provided the above notices are retained, and a notice that
# the code was modified is included with the above copyright notice.
# This Makefile is not using automake so that people may see how to build
# a program and tracepoint provider probes as stand-alone shared objects.
CC = gcc
LIBS = -ldl # On Linux
#LIBS = -lc # On BSD
CFLAGS = -I.
all: demo lttng-ust-provider-ust-tests-demo.so lttng-ust-provider-ust-tests-demo3.so
lttng-ust-provider-ust-tests-demo.o: tp.c ust_tests_demo.h
$(CC) $(CFLAGS) -fpic -c -o $@ $<
lttng-ust-provider-ust-tests-demo2.o: tp2.c ust_tests_demo2.h
$(CC) $(CFLAGS) -fpic -c -o $@ $<
lttng-ust-provider-ust-tests-demo.so: lttng-ust-provider-ust-tests-demo.o lttng-ust-provider-ust-tests-demo2.o
$(CC) -shared -o $@ -llttng-ust $?
lttng-ust-provider-ust-tests-demo3.o: tp3.c ust_tests_demo3.h
$(CC) $(CFLAGS) -fpic -c -o $@ $<
lttng-ust-provider-ust-tests-demo3.so: lttng-ust-provider-ust-tests-demo3.o
$(CC) -shared -o $@ -llttng-ust $<
demo.o: demo.c
$(CC) $(CFLAGS) -c -o $@ $<
demo: demo.o
$(CC) demo.o -o $@ $(LIBS)
.PHONY: clean
clean:
rm -f *.o *.so demo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment