$NetBSD$

# Create install dirs

--- Makefile.orig	2020-11-16 01:19:09.379126643 +0000
+++ Makefile
@@ -62,11 +62,11 @@ clean:
 # an extra reminder that they're auto-generated (as well
 # as the explanatory comment at the top)
 128.h 32.h 32-64.h: 64.h 64-128.h
-	chmod +w 128.h 32.h 32-64.h 2>/dev/null || true
+	chmod u+w 128.h 32.h 32-64.h 2>/dev/null || true
 	sed -e s/64/128/g < 64.h > 128.h
 	sed -e s/64/32/g < 64.h > 32.h
 	sed -e s/64/32/g -e s/128/64/g < 64-128.h > 32-64.h
-	chmod -w 128.h 32.h 32-64.h
+	chmod u-w 128.h 32.h 32-64.h
 
 # -----------------------------------------------------
 # Rules you won't need unless releasing new versions:
@@ -130,6 +130,7 @@ publish-src: test-other
 # compatibility with bsd.port.mk:
 all: pooler
 install: all
+	$(MKDIR) -p $(DESTDIR)/$(PREFIX)/bin $(DESTDIR)/$(PREFIX)/man/man1
 	$(INSTALL_PROGRAM) pooler $(DESTDIR)/$(PREFIX)/bin/
 	$(INSTALL_MAN) pooler.1 $(DESTDIR)/$(PREFIX)/man/man1/
 install-strip: install
@@ -138,3 +139,4 @@ PREFIX          ?= usr/local
 INSTALL_PROGRAM ?= cp
 INSTALL_MAN     ?= cp
 STRIP           ?= strip
+MKDIR		?= mkdir
