aboutsummaryrefslogtreecommitdiff
path: root/Makefile.in
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmer.dabbelt@eecs.berkeley.edu>2015-05-13 14:52:19 -0700
committerPalmer Dabbelt <palmer.dabbelt@eecs.berkeley.edu>2015-05-13 14:52:19 -0700
commit40580c0409449f1a02664649e97bd397ed9eb171 (patch)
treedb744e709fa4a33fbe4f832ab2f6b12e85e2bf21 /Makefile.in
parente294c392c63b8be738a9493754d302da7e1bb76b (diff)
downloadspike-40580c0409449f1a02664649e97bd397ed9eb171.zip
spike-40580c0409449f1a02664649e97bd397ed9eb171.tar.gz
spike-40580c0409449f1a02664649e97bd397ed9eb171.tar.bz2
Change the behavior of the DESTDIR make variable
DESTDIR is a common make idiom. As per the GNU coding standards https://www.gnu.org/prep/standards/html_node/DESTDIR.html "DESTDIR is a variable prepended to each installed target file, like this: $(INSTALL_PROGRAM) foo $(DESTDIR)$(bindir)/foo $(INSTALL_DATA) libfoo.a $(DESTDIR)$(libdir)/libfoo.a The DESTDIR variable is specified by the user on the make command line as an absolute file name. For example: make DESTDIR=/tmp/stage install DESTDIR should be supported only in the install* and uninstall* targets, as those are the only targets where it is useful. If your installation step would normally install /usr/local/bin/foo and /usr/local/lib/libfoo.a, then an installation invoked as in the example above would install /tmp/stage/usr/local/bin/foo and /tmp/stage/usr/local/lib/libfoo.a instead." The current Makefile.in uses DESTDIR, but has a slightly non-standard behavior: the target install location doesn't include "$prefix". This breaks package managers, because stuff ends up getting installed to the wrong location. Unfortunately the only way I can think of to fix this involves silently changing the behavior of DESTDIR. Hopefully nobody is using it...? [port of 8a2088b59162fe16c16d26ddc1cfcaaaa8c4156f in riscv-fesvr]
Diffstat (limited to 'Makefile.in')
-rw-r--r--Makefile.in10
1 files changed, 5 insertions, 5 deletions
diff --git a/Makefile.in b/Makefile.in
index d9841e2..1d8d9b2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -55,14 +55,14 @@ enable_stow := @enable_stow@
ifeq ($(enable_stow),yes)
stow_pkg_dir := $(prefix)/pkgs
- DESTDIR ?= $(stow_pkg_dir)/$(project_name)-$(project_ver)
+ INSTALLDIR ?= $(DESTDIR)/$(stow_pkg_dir)/$(project_name)-$(project_ver)
else
- DESTDIR ?= $(prefix)
+ INSTALLDIR ?= $(DESTDIR)/$(prefix)
endif
-install_hdrs_dir := $(DESTDIR)/include/$(project_name)
-install_libs_dir := $(DESTDIR)/lib
-install_exes_dir := $(DESTDIR)/bin
+install_hdrs_dir := $(INSTALLDIR)/include/$(project_name)
+install_libs_dir := $(INSTALLDIR)/lib
+install_exes_dir := $(INSTALLDIR)/bin
#-------------------------------------------------------------------------
# List of subprojects