Skip to content

Commit

Permalink
Make the Makefile variables externally configurable.
Browse files Browse the repository at this point in the history
As of manual page INSTALL.md, it is stated that those variables can be
overridden by means of environmental variables.

export BINDIR="somedir"
export SBINDIR="somedir"
export LIBDIR="somedir"
export MANDIR="somedir"
export INCLUDEDIR="somedir"
export LIBEXECDIR="somedir"

make install

But those settings will not be honored, sticking to default Makefile values.
This patch fixes the issue.

Signed-off-by: Francesco Giancane <[email protected]>
Reviewed-by: Dmitry Safonov <[email protected]>
Signed-off-by: Andrei Vagin <[email protected]>
  • Loading branch information
fgiancane8 authored and xemul committed Aug 15, 2017
1 parent 5f09c25 commit 833fa4d
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions Makefile.install
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
#
# Installation paths.
PREFIX ?= /usr/local
BINDIR := $(PREFIX)/bin
SBINDIR := $(PREFIX)/sbin
MANDIR := $(PREFIX)/share/man
LIBDIR := $(PREFIX)/lib
INCLUDEDIR := $(PREFIX)/include
LIBEXECDIR := $(PREFIX)/libexec
BINDIR ?= $(PREFIX)/bin
SBINDIR ?= $(PREFIX)/sbin
MANDIR ?= $(PREFIX)/share/man
INCLUDEDIR ?= $(PREFIX)/include
LIBEXECDIR ?= $(PREFIX)/libexec
RUNDIR ?= /run

#
# For recent Debian/Ubuntu with multiarch support.
DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null)
ifneq "$(DEB_HOST_MULTIARCH)" ""
LIBDIR := $(PREFIX)/lib/$(DEB_HOST_MULTIARCH)
LIBDIR ?= $(PREFIX)/lib/$(DEB_HOST_MULTIARCH)
else
#
# For most other systems
ifeq "$(shell uname -m)" "x86_64"
LIBDIR := $(PREFIX)/lib64
LIBDIR ?= $(PREFIX)/lib64
endif
endif

#
# LIBDIR falls back to the standard path.
LIBDIR ?= $(PREFIX)/lib

export PREFIX BINDIR SBINDIR MANDIR RUNDIR
export LIBDIR INCLUDEDIR LIBEXECDIR

Expand Down

0 comments on commit 833fa4d

Please sign in to comment.