aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2008-11-02 14:18:16 +0000
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2008-11-02 14:18:16 +0000
commit65741989938f91bfcfd91d655adcd7aa57f44511 (patch)
tree07b36848a224484495ec1d5d7b05aa6460c0a07f
parentbb00cd64b1d111122d22a5bd71a8ccedc45c0484 (diff)
downloadtermo-65741989938f91bfcfd91d655adcd7aa57f44511.tar.gz
termo-65741989938f91bfcfd91d655adcd7aa57f44511.tar.xz
termo-65741989938f91bfcfd91d655adcd7aa57f44511.zip
Adjusted Makefile to build a shared library
-rw-r--r--Makefile9
1 files changed, 7 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 9f25d79..ff496ca 100644
--- a/Makefile
+++ b/Makefile
@@ -3,14 +3,19 @@ CFLAGS?=
CFLAGS_DEBUG=
+SONAME=libtermkey.so.0
+
ifeq ($(DEBUG),1)
CFLAGS_DEBUG=-ggdb -DDEBUG
endif
all: demo
-demo: termkey.o driver-csi.o driver-ti.o demo.c
- $(CC) $(CFLAGS) $(CFLAGS_DEBUG) -o $@ $^ -lncurses
+demo: libtermkey.so demo.c
+ $(CC) $(CFLAGS) $(CFLAGS_DEBUG) -o $@ $^
+
+libtermkey.so: termkey.o driver-csi.o driver-ti.o
+ $(LD) -shared -soname=$(SONAME) -o $@ $^ -lncurses
%.o: %.c
$(CC) $(CFLAGS) $(CFLAGS_DEBUG) -Wall -std=c99 -o $@ -c $^