-# from: @(#)Makefile 5.7 (Berkeley) 4/8/91
-# $Id: Makefile,v 1.2 1993/08/01 05:45:35 mycroft Exp $
+# $NetBSD: Makefile,v 1.13 2017/05/21 15:28:41 riastradh Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
PROG= factor
-SRCS= factor.c pr_tbl.c
-CFLAGS+=-I${.CURDIR}/../primes
-MAN6= factor.0
-MLINKS+=factor.6 primes.6
-.PATH: ${.CURDIR}/../primes
+SRCS= factor.c ../primes/pr_tbl.c
+MAN= factor.6
-.include <bsd.prog.mk>
+all: $(PROG)
+
+$(PROG): $(SRCS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -I../primes -DHAVE_OPENSSL -lcrypto
+ $(STRIP) $(PROG)
+
+install: $(PROG) $(MAN)
+ $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG)
+ $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN)
+
+clean:
+ rm -f $(CLEANFILES) $(PROG)
+
+.PHONY: all clean install