summaryrefslogtreecommitdiff
path: root/devel/menhir/patches/patch-Makefile
blob: 57059612935aaca1f5dc6e068ab1ec2900d94a85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
$NetBSD: patch-Makefile,v 1.6 2018/11/12 17:13:38 jaapb Exp $

Use correct install locations and BSD_INSTALL_*
--- Makefile.orig	2018-10-26 13:17:23.000000000 +0000
+++ Makefile
@@ -46,10 +46,10 @@ endif
 # These may be overridden from outside; e.g., our opam package description
 # provides its own values of docdir, libdir, and mandir.
 
-bindir          := $(PREFIX)/bin
-docdir		:= $(PREFIX)/share/doc/menhir
-libdir	        := $(PREFIX)/share/menhir
-mandir          := $(PREFIX)/share/man/man1
+bindir          := $(DESTDIR)$(PREFIX)/bin
+docdir		:= $(DESTDIR)$(PREFIX)/share/doc/menhir
+libdir	        := $(DESTDIR)$(PREFIX)/share/menhir
+mandir          := $(DESTDIR)$(PREFIX)/${PKGMANDIR}
 MANS            := doc/menhir.1
 DOCS            := doc/manual.pdf doc/manual.html doc/manual*.png demos
 MLYLIB          := src/standard.mly
@@ -177,11 +177,11 @@ endif
 
 install:
 # Install the executable.
-	mkdir -p $(bindir)
-	install $(BUILDDIR)/menhir.$(TARGET) $(bindir)/menhir$(EXE)
+	$(BSD_INSTALL_PROGRAM_DIR) -p $(bindir)
+	$(BSD_INSTALL_PROGRAM) $(BUILDDIR)/menhir.$(TARGET) $(bindir)/menhir$(EXE)
 # Install Menhir's standard library.
-	mkdir -p $(libdir)
-	install -m 644 $(MLYLIB) $(libdir)
+	$(BSD_INSTALL_LIB_DIR) -p $(libdir)
+	$(BSD_INSTALL_DATA) -m 644 $(MLYLIB) $(libdir)
 # Install MenhirLib and MenhirSdk.
 	@if `$(BUILDDIR)/menhir.$(TARGET) --suggest-ocamlfind | tr -d '\r'` ; then \
 	  echo 'Installing MenhirLib and MenhirSdk via ocamlfind.' ; \
@@ -192,13 +192,13 @@ install:
 	  rm -f META ; \
 	else \
 	  echo 'Installing MenhirLib and MenhirSdk manually.' ; \
-	  install -m 644 $(patsubst %,$(BUILDDIR)/%,$(MENHIRLIB)) $(libdir) ; \
-	  install -m 644 $(patsubst %,$(SDKDIR)/%,$(MENHIRSDK)) $(libdir) ; \
+	  $(BSD_INSTALL_DATA) -m 644 $(patsubst %,$(BUILDDIR)/%,$(MENHIRLIB)) $(libdir) ; \
+	  $(BSD_INSTALL_DATA) -m 644 $(patsubst %,$(SDKDIR)/%,$(MENHIRSDK)) $(libdir) ; \
 	fi
 # Install the documentation. (If building from the repository, the documentation
 # may be absent.)
 	if [ -f doc/manual.pdf ] ; then \
-	  mkdir -p $(docdir) $(mandir) ; \
+	  $(BSD_INSTALL_DATA_DIR) -p $(docdir) $(mandir) ; \
 	  cp -r $(DOCS) $(docdir) ; \
 	  cp -r $(MANS) $(mandir) ; \
 	fi