summaryrefslogtreecommitdiffstats
path: root/testpat
diff options
context:
space:
mode:
Diffstat (limited to 'testpat')
-rw-r--r--testpat/Makefile18
-rw-r--r--testpat/testpat.c2
2 files changed, 17 insertions, 3 deletions
diff --git a/testpat/Makefile b/testpat/Makefile
index 675cd9b7..40a1d702 100644
--- a/testpat/Makefile
+++ b/testpat/Makefile
@@ -2,7 +2,19 @@
PROG= testpat
MAN= testpat.6
-DPADD= ${LIBMATH} ${LIBCURSES} ${LIBTERMINFO}
-LDADD= -lcurses -lm -lterminfo
+SRCS= testpat.c
-.include <bsd.prog.mk>
+all: $(PROG)
+
+$(PROG): $(SRCS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw
+ $(STRIP) $(PROG)
+
+install: $(PROG) $(MAN)
+ $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG)
+ $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN)
+
+clean:
+ rm -f $(CLEANFILES) $(PROG)
+
+.PHONY: all clean install
diff --git a/testpat/testpat.c b/testpat/testpat.c
index c54908ba..327da7eb 100644
--- a/testpat/testpat.c
+++ b/testpat/testpat.c
@@ -40,6 +40,8 @@ __RCSID("$NetBSD: testpat.c,v 1.4 2021/01/08 15:16:04 christos Exp $");
#include <string.h>
#include <time.h>
+#define __arraycount(a) (sizeof(a) / sizeof(*(a)))
+
static int colour_list[6] = {
COLOR_YELLOW,
COLOR_CYAN,