$OpenBSD: patch-Makefile,v 1.3 2017/08/06 15:01:45 abieber Exp $
Index: Makefile
--- Makefile.orig
+++ Makefile
@@ -83,7 +83,7 @@ out/Makefile: common.gypi deps/uv/uv.gyp deps/http_par
 config.gypi: configure
 	$(error Missing or stale $@, please run ./$<)
 
-install: all
+install: all build-pledge
 	$(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)'
 
 uninstall:
@@ -185,6 +185,12 @@ test/addons/.buildstamp: config.gypi \
 # Just goes to show that recursive make really is harmful...
 # TODO(bnoordhuis) Force rebuild after gyp update.
 build-addons: $(NODE_EXE) test/addons/.buildstamp
+
+build-pledge: $(NODE_EXE)
+	$(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \
+		--directory="deps/npm/node_modules/node-pledge" \
+		--nodedir="$(shell pwd)" && \
+	$(RM) -rf deps/npm/node_modules/node-pledge/build/Release/{.deps,../Makefile,obj.target}
 
 clear-stalled:
 	# Clean up any leftover processes but don't error if found.
