diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-11-23 23:32:06 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-11-24 15:17:20 -0500 |
commit | ed16442fb72dadaac18c0d8ade509a9c8fc89746 (patch) | |
tree | b83a7706e860d92055be17fb44220cd4d5722861 /Makefile | |
parent | bf74f171cbb99694dad0097dfa72c5a986d44c26 (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-- | Makefile | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -1,4 +1,5 @@ | |||
1 | CC = gcc | 1 | CC = gcc |
2 | AR = ar | ||
2 | EXT = -std=gnu99 | 3 | EXT = -std=gnu99 |
3 | CFLAGS = -g -Wall # -O2 | 4 | CFLAGS = -g -Wall # -O2 |
4 | INCLUDES = -I. -I/usr/local/include | 5 | INCLUDES = -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 | ||
11 | TARGETS = libparsevent.so trace-cmd | 12 | TARGETS = libparsevent.a trace-cmd |
12 | 13 | ||
13 | all: $(TARGETS) | 14 | all: $(TARGETS) |
14 | 15 | ||
16 | LIB_FILE = libparsevent.a | ||
17 | |||
15 | trace-read.o:: parse-events.h | 18 | trace-read.o:: parse-events.h |
16 | trace-cmd.o:: parse-events.h | 19 | trace-cmd.o:: parse-events.h $(LIB_FILE) |
17 | 20 | ||
18 | trace-cmd:: trace-cmd.o trace-read.o | 21 | trace-cmd:: trace-cmd.o trace-read.o |
19 | $(CC) $^ -o $@ $(LIBS) | 22 | $(CC) $^ $(LIBS) -o $@ |
20 | 23 | ||
21 | parse-events.o: parse-events.c parse-events.h | 24 | parse-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 | |||
24 | trace-seq.o: trace-seq.c parse-events.h | 27 | trace-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 | ||
27 | libparsevent.so: parse-events.o trace-seq.o | 30 | LIB_OBJS = parse-events.o trace-seq.o |
31 | |||
32 | libparsevent.so: $(LIB_OBJS) | ||
28 | $(CC) --shared $^ -o $@ | 33 | $(CC) --shared $^ -o $@ |
29 | 34 | ||
35 | libparsevent.a: $(LIB_OBJS) | ||
36 | $(RM) $@; $(AR) rcs $@ $^ | ||
37 | |||
30 | .PHONY: force | 38 | .PHONY: force |
31 | force: | 39 | force: |
32 | 40 | ||
@@ -34,4 +42,4 @@ TAGS: force | |||
34 | find . -name '*.[ch]' | xargs etags | 42 | find . -name '*.[ch]' | xargs etags |
35 | 43 | ||
36 | clean: | 44 | clean: |
37 | $(RM) *.o *~ $(TARGETS) | 45 | $(RM) *.o *~ $(TARGETS) *.a *.so |