aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-11-23 23:32:06 -0500
committerSteven Rostedt <rostedt@goodmis.org>2009-11-24 15:17:20 -0500
commited16442fb72dadaac18c0d8ade509a9c8fc89746 (patch)
treeb83a7706e860d92055be17fb44220cd4d5722861 /Makefile
parentbf74f171cbb99694dad0097dfa72c5a986d44c26 (diff)
Use a static library instead of a dynamic one
A dynamic library will cause pain to users when they find that the tool can not find the library. For now, just use a static library to make the use of the tool more convenient. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 13 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 1c042e0..7472c11 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,5 @@
1CC = gcc 1CC = gcc
2AR = ar
2EXT = -std=gnu99 3EXT = -std=gnu99
3CFLAGS = -g -Wall # -O2 4CFLAGS = -g -Wall # -O2
4INCLUDES = -I. -I/usr/local/include 5INCLUDES = -I. -I/usr/local/include
@@ -8,15 +9,17 @@ LIBS = -L. -lparsevent
8%.o: %.c 9%.o: %.c
9 $(CC) -c $(CFLAGS) $(EXT) $(INCLUDES) $< -o $@ 10 $(CC) -c $(CFLAGS) $(EXT) $(INCLUDES) $< -o $@
10 11
11TARGETS = libparsevent.so trace-cmd 12TARGETS = libparsevent.a trace-cmd
12 13
13all: $(TARGETS) 14all: $(TARGETS)
14 15
16LIB_FILE = libparsevent.a
17
15trace-read.o:: parse-events.h 18trace-read.o:: parse-events.h
16trace-cmd.o:: parse-events.h 19trace-cmd.o:: parse-events.h $(LIB_FILE)
17 20
18trace-cmd:: trace-cmd.o trace-read.o 21trace-cmd:: trace-cmd.o trace-read.o
19 $(CC) $^ -o $@ $(LIBS) 22 $(CC) $^ $(LIBS) -o $@
20 23
21parse-events.o: parse-events.c parse-events.h 24parse-events.o: parse-events.c parse-events.h
22 $(CC) -c $(CFLAGS) $(EXT) $(INCLUDES) -fPIC $< -o $@ 25 $(CC) -c $(CFLAGS) $(EXT) $(INCLUDES) -fPIC $< -o $@
@@ -24,9 +27,14 @@ parse-events.o: parse-events.c parse-events.h
24trace-seq.o: trace-seq.c parse-events.h 27trace-seq.o: trace-seq.c parse-events.h
25 $(CC) -c $(CFLAGS) $(EXT) $(INCLUDES) -fPIC $< -o $@ 28 $(CC) -c $(CFLAGS) $(EXT) $(INCLUDES) -fPIC $< -o $@
26 29
27libparsevent.so: parse-events.o trace-seq.o 30LIB_OBJS = parse-events.o trace-seq.o
31
32libparsevent.so: $(LIB_OBJS)
28 $(CC) --shared $^ -o $@ 33 $(CC) --shared $^ -o $@
29 34
35libparsevent.a: $(LIB_OBJS)
36 $(RM) $@; $(AR) rcs $@ $^
37
30.PHONY: force 38.PHONY: force
31force: 39force:
32 40
@@ -34,4 +42,4 @@ TAGS: force
34 find . -name '*.[ch]' | xargs etags 42 find . -name '*.[ch]' | xargs etags
35 43
36clean: 44clean:
37 $(RM) *.o *~ $(TARGETS) 45 $(RM) *.o *~ $(TARGETS) *.a *.so