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
|
From: Nicolas Boulenguez <nicolas@debian.org>
Forwarded: https://sourceforge.net/p/mp3gain/bugs/62/
Subject: [PATCH 2/4] Configure and create installation directories
Allow non-default DESTDIR for stagged installations.
Allow prefix other than '/usr/local'.
Create intermediate directories when installing.
--- a/Makefile
+++ b/Makefile
@@ -5,6 +5,8 @@
#
CC?= gcc
+DESTDIR ?=
+prefix ?= /usr/local
CFLAGS+= -Wall -DHAVE_MEMCPY
@@ -19,7 +21,8 @@
endif
ifneq ($(OSTYPE),beos)
-INSTALL_PATH= /usr/local/bin
+INSTALL_PATH= $(prefix)/bin
+
else
INSTALL_PATH= $(HOME)/config/bin
endif
@@ -59,9 +62,9 @@
install: mp3gain
ifneq ($(OSTYPE),win)
- cp -p mp3gain$(EXE_EXT) "$(INSTALL_PATH)"
+ install '-Dt$(DESTDIR)$(INSTALL_PATH)' mp3gain$(EXE_EXT)
ifeq ($(OSTYPE),beos)
- mimeset -f "$(INSTALL_PATH)/mp3gain$(EXE_EXT)"
+ mimeset -f "$(DESTDIR)$(INSTALL_PATH)/mp3gain$(EXE_EXT)"
endif
else
@echo install target is not implemented on windows
|