=== modified file 'Makefile' --- Makefile 2012-03-12 19:47:30 +0000 +++ Makefile 2012-03-08 21:51:42 +0000 @@ -1,23 +1,6 @@ -ifeq ($(shell uname),Darwin) - LIBTOOL ?= glibtool -else - LIBTOOL ?= libtool -endif - -ifneq ($(VERBOSE),1) - LIBTOOL +=--quiet -endif - -CFLAGS +=-Wall -std=c99 - -ifeq ($(DEBUG),1) - CFLAGS +=-ggdb -DDEBUG -endif - -ifeq ($(PROFILE),1) - CFLAGS +=-pg - LDFLAGS+=-pg -endif +LIBTOOL=libtool + +CFLAGS?= ifeq ($(shell pkg-config --atleast-version=0.1.0 unibilium && echo 1),1) CFLAGS +=$(shell pkg-config --cflags unibilium) -DHAVE_UNIBILIUM @@ -29,8 +12,7 @@ LDFLAGS+=-lncurses endif -OBJECTS=termkey.lo driver-csi.lo driver-ti.lo -LIBRARY=libtermkey.la +CFLAGS_DEBUG= VERSION_MAJOR=0 VERSION_MINOR=13 @@ -46,10 +28,17 @@ MAN3DIR=$(MANDIR)/man3 MAN7DIR=$(MANDIR)/man7 -all: $(LIBRARY) demo demo-async +ifeq ($(DEBUG),1) + CFLAGS_DEBUG=-ggdb -DDEBUG +endif + +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 --tag=CC gcc $(CFLAGS) -o $@ -c $< + $(LIBTOOL) --mode=compile --tag=CC gcc $(CFLAGS) $(CFLAGS_DEBUG) -Wall -std=c99 -o $@ -c $< $(LIBRARY): $(OBJECTS) $(LIBTOOL) --mode=link --tag=CC gcc -rpath $(LIBDIR) -version-info $(VERSION_CURRENT):$(VERSION_REVISION):$(VERSION_AGE) $(LDFLAGS) -o $@ $^ @@ -70,16 +59,15 @@ install: install-inc install-lib install-man $(LIBTOOL) --mode=finish $(DESTDIR)$(LIBDIR) -install-inc: termkey.h +install-inc: install -d $(DESTDIR)$(INCDIR) install -m644 termkey.h $(DESTDIR)$(INCDIR) install -d $(DESTDIR)$(LIBDIR)/pkgconfig sed "s,@LIBDIR@,$(LIBDIR),;s,@INCDIR@,$(INCDIR)," $(DESTDIR)$(LIBDIR)/pkgconfig/termkey.pc -# rm the old binary first in case it's still in use -install-lib: $(LIBRARY) +install-lib: install -d $(DESTDIR)$(LIBDIR) - $(LIBTOOL) --mode=install cp --remove-destination libtermkey.la $(DESTDIR)$(LIBDIR)/libtermkey.la + $(LIBTOOL) --mode=install cp libtermkey.la $(DESTDIR)$(LIBDIR)/libtermkey.la install-man: install -d $(DESTDIR)$(MAN3DIR)