=== modified file '.bzrignore' --- .bzrignore 2009-11-25 02:30:24 +0000 +++ .bzrignore 2008-11-16 12:44:02 +0000 @@ -3,6 +3,3 @@ demo-async termkey_getkey.3 termkey_waitkey.3 -*.lo -*.la -.libs === modified file 'Makefile' --- Makefile 2009-11-25 02:30:24 +0000 +++ Makefile 2009-07-15 19:52:35 +0000 @@ -1,5 +1,4 @@ -LIBTOOL=libtool - +CC?=gcc CFLAGS?= CFLAGS_DEBUG= @@ -7,9 +6,7 @@ VERSION_MAJOR=0 VERSION_MINOR=3 -VERSION_CURRENT=0 -VERSION_REVISION=0 -VERSION_AGE=0 +SONAME=libtermkey.so.$(VERSION_MAJOR) PREFIX=/usr/local LIBDIR=$(PREFIX)/lib @@ -23,30 +20,24 @@ all: termkey.h demo demo-async -OBJECTS=termkey.lo driver-csi.lo driver-ti.lo -LIBRARY=libtermkey.la - -%.lo: %.c termkey.h termkey-internal.h - $(LIBTOOL) --mode=compile gcc $(CFLAGS) $(CFLAGS_DEBUG) -Wall -std=c99 -o $@ -c $< - -$(LIBRARY): $(OBJECTS) - $(LIBTOOL) --mode=link gcc -rpath $(LIBDIR) -version-info $(VERSION_CURRENT):$(VERSION_REVISION):$(VERSION_AGE) -lncurses -o $@ $^ - -demo: $(LIBRARY) demo.lo - $(LIBTOOL) --mode=link gcc -o $@ $^ - -demo-async: $(LIBRARY) demo-async.lo - $(LIBTOOL) --mode=link gcc -o $@ $^ +demo: libtermkey.so demo.c + $(CC) $(CFLAGS) $(CFLAGS_DEBUG) -o $@ $^ + +demo-async: libtermkey.so demo-async.c + $(CC) $(CFLAGS) $(CFLAGS_DEBUG) -o $@ $^ + +libtermkey.so: termkey.o driver-csi.o driver-ti.o + $(LD) -shared -soname=$(SONAME) -o $@ $^ -lncurses + +%.o: %.c termkey.h termkey-internal.h + $(CC) $(CFLAGS) $(CFLAGS_DEBUG) -Wall -std=c99 -fPIC -o $@ -c $< .PHONY: clean clean: - $(LIBTOOL) --mode=clean rm -f $(OBJECTS) demo.lo demo-async.lo - $(LIBTOOL) --mode=clean rm -f $(LIBRARY) - $(LIBTOOL) --mode=clean rm -rf demo demo-async + rm -f *.o libtermkey.so demo demo-async .PHONY: install install: install-inc install-lib install-man - $(LIBTOOL) --mode=finish $(DESTDIR)$(LIBDIR) install-inc: install -d $(DESTDIR)$(INCDIR) @@ -56,7 +47,9 @@ install-lib: install -d $(DESTDIR)$(LIBDIR) - $(LIBTOOL) --mode=install cp libtermkey.la $(DESTDIR)$(LIBDIR)/libtermkey.la + install libtermkey.so $(DESTDIR)$(LIBDIR)/$(SONAME).$(VERSION_MINOR) + ln -sf $(SONAME).$(VERSION_MINOR) $(DESTDIR)$(LIBDIR)/$(SONAME) + ln -sf $(SONAME) $(DESTDIR)$(LIBDIR)/libtermkey.so install-man: install -d $(DESTDIR)$(MAN3DIR)