aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2012-04-01 20:04:01 +0100
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2012-04-01 20:04:01 +0100
commita29d9f0f3c23bfe28c29aa216fd9c5ef809b8246 (patch)
treeb114da96798b1f910a042286d0f433a24f10d834 /Makefile
parent6070de26f1ce8e9447054b7e995b577881b0fc15 (diff)
downloadtermo-a29d9f0f3c23bfe28c29aa216fd9c5ef809b8246.tar.gz
termo-a29d9f0f3c23bfe28c29aa216fd9c5ef809b8246.tar.xz
termo-a29d9f0f3c23bfe28c29aa216fd9c5ef809b8246.zip
Created a demo to show libtermkey in a GLib-based program
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 13 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 472bada..14efe91 100644
--- a/Makefile
+++ b/Makefile
@@ -32,6 +32,12 @@ endif
OBJECTS=termkey.lo driver-csi.lo driver-ti.lo
LIBRARY=libtermkey.la
+DEMOS=demo demo-async
+
+ifeq ($(shell pkg-config glib-2.0 && echo 1),1)
+ DEMOS+=demo-glib
+endif
+
TESTSOURCES=$(wildcard t/[0-9]*.c)
TESTFILES=$(TESTSOURCES:.c=.t)
@@ -49,7 +55,7 @@ MANDIR=$(PREFIX)/share/man
MAN3DIR=$(MANDIR)/man3
MAN7DIR=$(MANDIR)/man7
-all: $(LIBRARY) demo demo-async
+all: $(LIBRARY) $(DEMOS)
%.lo: %.c termkey.h termkey-internal.h
$(LIBTOOL) --mode=compile --tag=CC gcc $(CFLAGS) -o $@ -c $<
@@ -63,6 +69,12 @@ demo: $(LIBRARY) demo.lo
demo-async: $(LIBRARY) demo-async.lo
$(LIBTOOL) --mode=link --tag=CC gcc -o $@ $^
+demo-glib.lo: demo-glib.c termkey.h
+ $(LIBTOOL) --mode=compile --tag=CC gcc -o $@ -c $< $(shell pkg-config glib-2.0 --cflags)
+
+demo-glib: $(LIBRARY) demo-glib.lo
+ $(LIBTOOL) --mode=link --tag=CC gcc -o $@ $^ $(shell pkg-config glib-2.0 --libs)
+
t/%.t: t/%.c $(LIBRARY) t/taplib.lo
$(LIBTOOL) --mode=link --tag=CC gcc -o $@ $^