From 65741989938f91bfcfd91d655adcd7aa57f44511 Mon Sep 17 00:00:00 2001 From: Paul LeoNerd Evans Date: Sun, 2 Nov 2008 14:18:16 +0000 Subject: Adjusted Makefile to build a shared library --- Makefile | 9 +++++++-- 1 file 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 $^ -- cgit v1.2.3-70-g09d2