$OpenBSD: patch-src_Makefile,v 1.1 2015/01/16 09:20:47 daniel Exp $
--- src/Makefile.orig	Mon Dec 15 10:25:48 2014
+++ src/Makefile	Fri Jan 16 03:50:24 2015
@@ -60,8 +60,12 @@ stage1:
 # Stage 2.
 # Build Menhir using Menhir (from stage 1).
 
-FLAGS := -v -lg 1 -la 1 -lc 1 --comment --infer --stdlib . --strict --fixed-exception
+# Do not use . to refer to the current directory, because ocamlbuild
+# descends into another directory when executing commands.
+SRC   := $(shell pwd)
 
+FLAGS := -v -lg 1 -la 1 -lc 1 --comment --infer --stdlib $(SRC) --strict --fixed-exception
+
 stage2:
 	@$(OCAMLBUILD) -build-dir _stage2 -tag fancy_parser \
 	  -use-menhir -menhir "$(shell pwd)/_stage1/menhir.$(TARGET) $(FLAGS)" \
@@ -73,7 +77,7 @@ stage2:
 # is identical to the stage 2 parser.
 stage3:
 	@$(OCAMLBUILD) -build-dir _stage3 -tag fancy_parser \
-	  -use-menhir -menhir "$(shell pwd)/_stage2/menhir.$(TARGET) $(FLAGS)" \
+	  -use-menhir -menhir "$(SRC)/_stage2/menhir.$(TARGET) $(FLAGS)" \
 	  parser.ml parser.mli
 	@for i in parser.ml parser.mli ; do \
 	  if ! diff _stage2/$$i _stage3/$$i 2>&1 >/dev/null ; then \
