Browse Source

Install: allow specifying sbin and man directories.

Davin McCall 6 years ago
parent
commit
4bb3e3ef43
3 changed files with 14 additions and 6 deletions
  1. 2 2
      doc/manpages/Makefile
  2. 9 1
      mconfig
  3. 3 3
      src/Makefile

+ 2 - 2
doc/manpages/Makefile

@@ -1,3 +1,3 @@
 install:
-	mkdir -p "$(DESTDIR)/usr/share/man/man8"
-	cp dinit.8 dinitctl.8 "$(DESTDIR)/usr/share/man/man8"
+	mkdir -p "$(DESTDIR)$(MANDIR)/man8"
+	install dinit.8 dinitctl.8 "$(DESTDIR)$(MANDIR)/man8"

+ 9 - 1
mconfig

@@ -1,3 +1,11 @@
+# Installation path options.
+
+SBINDIR=/sbin
+MANDIR=/usr/share/man
+
+
+# General build options. Uncomment the options appropriate for your system.
+
 # Linux (GCC). Note with GCC 5.x/6.x you must use the old ABI, with GCC 7.x you must use
 # the new ABI. See BUILD file for more information.
 CXX=g++
@@ -6,7 +14,7 @@ EXTRA_LIBS=
 BUILD_SHUTDOWN=yes
 SANITIZEOPTS=-fsanitize=address,undefined
 
-# OpenBSD, tested with GCC 4.9.3 and gmake:
+# OpenBSD, tested with GCC 4.9.3 / Clang++ 4/5 and gmake:
 #CXX=clang++
 #CXXOPTS=-std=gnu++11 -Os -Wall -fno-rtti
 #EXTRA_LIBS=

+ 3 - 3
src/Makefile

@@ -26,10 +26,10 @@ check: $(dinit_objects)
 	$(MAKE) -C tests check
 
 install: all
-	install -d $(DESTDIR)/sbin
-	install -s dinit dinitctl $(SHUTDOWN) $(DESTDIR)/sbin
+	install -d $(DESTDIR)$(SBINDIR)
+	install -s dinit dinitctl $(SHUTDOWN) $(DESTDIR)$(SBINDIR)
 ifeq ($(BUILD_SHUTDOWN),yes)
-	install halt reboot $(DESTDIR)/sbin
+	install halt reboot $(DESTDIR)$(SBINDIR)
 endif
 
 clean: