about summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile32
1 files changed, 18 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index 48fc350..3abba03 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,8 @@ BINDIR ?= ${PREFIX}/bin
 MANDIR ?= ${PREFIX}/man
 
 CEXTS = gnu-case-range gnu-conditional-omitted-operand
-CFLAGS += -std=c11 -Wall -Wextra -Wpedantic ${CEXTS:%=-Wno-%}
+CFLAGS += -std=c11 -Wall -Wextra -Wpedantic -Wmissing-prototypes
+CFLAGS += ${CEXTS:%=-Wno-%}
 LDADD.libtls = -ltls
 LDADD.ncursesw = -lncursesw
 
@@ -19,13 +20,17 @@ OBJS += config.o
 OBJS += edit.o
 OBJS += filter.o
 OBJS += handle.o
+OBJS += input.o
 OBJS += irc.o
 OBJS += log.o
 OBJS += ui.o
 OBJS += url.o
+OBJS += window.o
 OBJS += xdg.o
 
-dev: tags all
+TESTS += edit.t
+
+dev: tags all check
 
 all: catgirl
 
@@ -34,11 +39,21 @@ catgirl: ${OBJS}
 
 ${OBJS}: chat.h
 
+edit.o edit.t input.o: edit.h
+
+check: ${TESTS}
+
+.SUFFIXES: .t
+
+.c.t:
+	${CC} ${CFLAGS} -DTEST ${LDFLAGS} $< ${LDLIBS} -o $@
+	./$@ || rm $@
+
 tags: *.[ch]
 	ctags -w *.[ch]
 
 clean:
-	rm -f catgirl ${OBJS} tags
+	rm -f catgirl ${OBJS} ${TESTS} tags
 
 install: catgirl catgirl.1
 	install -d ${DESTDIR}${BINDIR} ${DESTDIR}${MANDIR}/man1
@@ -48,17 +63,6 @@ install: catgirl catgirl.1
 uninstall:
 	rm -f ${DESTDIR}${BINDIR}/catgirl ${DESTDIR}${MANDIR}/man1/catgirl.1
 
-scripts/sandman: scripts/sandman.o
-	${CC} ${LDFLAGS} scripts/sandman.o -framework Cocoa -o $@
-
-install-sandman: scripts/sandman scripts/sandman.1
-	install -d ${DESTDIR}${BINDIR} ${DESTDIR}${MANDIR}/man1
-	install scripts/sandman ${DESTDIR}${BINDIR}
-	install -m 644 scripts/sandman.1 ${DESTDIR}${MANDIR}/man1
-
-uninstall-sandman:
-	rm -f ${DESTDIR}${BINDIR}/sandman ${DESTDIR}${MANDIR}/man1/sandman.1
-
 CHROOT_USER = chat
 CHROOT_GROUP = ${CHROOT_USER}