1 From 9eae71dcd60834f753264ddde13f37993f8b5556 Mon Sep 17 00:00:00 2001
2 From: Dan Callaghan <dcallagh@redhat.com>
3 Date: Mon, 7 Jan 2013 09:37:31 +1000
4 Subject: [PATCH 1/2] build shared library
7 Makefile | 29 +++++++++++++++++++++++++++--
8 1 file changed, 27 insertions(+), 2 deletions(-)
10 diff --git a/Makefile b/Makefile
11 index 3086e92..a1a906f 100644
15 -all: linenoise_example linenoise_utf8_example linenoise_cpp_example
19 +SONAME = liblinenoise.so.$(MAJOR_VERSION)
20 +LIB = $(SONAME)$(EXTRA_VERSION)
22 +export CFLAGS ?= -Os -g
23 +CFLAGS += -Wall -fpic -DUSE_UTF8
25 +INCLUDEDIR ?= /usr/include
28 +all: $(LIB) linenoise_example linenoise_utf8_example linenoise_cpp_example
30 +$(LIB): linenoise.o utf8.o
31 + $(CC) $(CFLAGS) -shared -Wl,-soname,$(SONAME) $(LDFLAGS) -o $@ $^
33 linenoise_example: linenoise.h linenoise.c example.c
34 $(CC) -Wall -W -Os -g -o $@ linenoise.c example.c
35 @@ -9,5 +24,15 @@ linenoise_utf8_example: linenoise.c utf8.c example.c
36 linenoise_cpp_example: linenoise.h linenoise.c
37 g++ -Wall -W -Os -g -o $@ linenoise.c example.c
41 - rm -f linenoise_example linenoise_utf8_example linenoise_cpp_example *.o
42 + rm -f $(LIB) linenoise_example linenoise_utf8_example linenoise_cpp_example *.o
46 + install -m 0755 -d $(DESTDIR)$(INCLUDEDIR)
47 + install -m 0644 linenoise.h $(DESTDIR)$(INCLUDEDIR)
48 + install -m 0755 -d $(DESTDIR)$(LIBDIR)
49 + install -m 0755 $(LIB) $(DESTDIR)$(LIBDIR)
50 + ldconfig -n $(DESTDIR)$(LIBDIR)
51 + ln -s $(LIB) $(DESTDIR)$(LIBDIR)/liblinenoise.so