diff options
author | Adam Borowski <kilobyte@angband.pl> | 2009-11-09 11:37:41 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2009-11-09 13:38:40 +0100 |
commit | b0abf04f6d1def77a4641345fc7b129c6a346ab4 (patch) | |
tree | 6301315f7b2221ba620f5d35a90b012c1f0211b8 /crawl-ref | |
parent | 288cb7259a3f9a06a7ae3e20c3e15df31d2ee1a2 (diff) | |
download | crawl-ref-b0abf04f6d1def77a4641345fc7b129c6a346ab4.tar.gz crawl-ref-b0abf04f6d1def77a4641345fc7b129c6a346ab4.zip |
Support $DESTDIR, as needed by distro packaging.
This is different from $prefix, since the latter leaks into the compiled
binary, while the former is needed to install to a staging area. Both
Debian and Red Hat had to patch this in...
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/makefile | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crawl-ref/source/makefile b/crawl-ref/source/makefile index a81bf1a9d9..87b91a2197 100644 --- a/crawl-ref/source/makefile +++ b/crawl-ref/source/makefile @@ -435,9 +435,9 @@ CFOTHERS_L += -DDGAMELAUNCH endif ifdef USE_CHROOT -prefix_fp := $(abspath $(strip $(chroot_prefix))/$(strip $(prefix))) +prefix_fp := $(abspath $(strip $(DESTDIR)$(chroot_prefix))/$(strip $(prefix))) else -prefix_fp := $(abspath $(strip $(prefix))) +prefix_fp := $(abspath $(strip $(DESTDIR)$(prefix))) endif ifneq ($(strip $(SAVEDIR)),) @@ -710,6 +710,10 @@ endif # The actual build targets # install: $(GAME) +ifeq ($(DESTDIR)$(prefix),) + @echo Neither "DESTDIR" nor "prefix" defined -- nowhere to install to, aborting. + @exit 1 +endif [ -d $(prefix_fp)/$(bin_prefix) ] || mkdir -p $(prefix_fp)/$(bin_prefix) $(COPY) $(GAME) $(prefix_fp)/$(bin_prefix)/ $(STRIP) -s $(prefix_fp)/$(bin_prefix)/$(GAME) |