From 9cf2cd7ca92ee637cd97427b8f4181a524181fc4 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Thu, 5 Sep 2019 23:20:46 +0200 Subject: [PATCH] remove leading/tailing "/" from installation RELPATHs --- Makefile | 38 +++++++++++++++---------------- Makefile.defs | 14 ++++++------ Makefile.host | 6 ++--- armsrc/Makefile | 6 ++--- bootrom/Makefile | 6 ++--- client/Makefile | 12 +++++----- doc/md/Development/Maintainers.md | 4 +--- recovery/Makefile | 6 ++--- 8 files changed, 45 insertions(+), 47 deletions(-) diff --git a/Makefile b/Makefile index 77e038124..90ee442ca 100644 --- a/Makefile +++ b/Makefile @@ -27,24 +27,24 @@ install: all common/install common/install: $(info [@] Installing common resources to $(MYDESTDIR)$(PREFIX)...) ifneq (,$(INSTALLSCRIPTS)) - $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(INSTALLBINRELPATH) - $(Q)$(CP) $(INSTALLSCRIPTS) $(DESTDIR)$(PREFIX)$(INSTALLBINRELPATH) + $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLBINRELPATH) + $(Q)$(CP) $(INSTALLSCRIPTS) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLBINRELPATH) endif ifneq (,$(INSTALLSHARES)) - $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(INSTALLSHARERELPATH) - $(Q)$(CP) $(INSTALLSHARES) $(DESTDIR)$(PREFIX)$(INSTALLSHARERELPATH) + $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLSHARERELPATH) + $(Q)$(CP) $(INSTALLSHARES) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLSHARERELPATH) endif ifneq (,$(INSTALLDOCS)) - $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(INSTALLDOCSRELPATH) - $(Q)$(CP) $(INSTALLDOCS) $(DESTDIR)$(PREFIX)$(INSTALLDOCSRELPATH) + $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLDOCSRELPATH) + $(Q)$(CP) $(INSTALLDOCS) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLDOCSRELPATH) endif ifneq (,$(INSTALLTOOLS)) - $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(INSTALLTOOLSRELPATH) - $(Q)$(CP) $(foreach tool,$(INSTALLTOOLS),tools/$(tool)) $(DESTDIR)$(PREFIX)$(INSTALLTOOLSRELPATH) + $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLTOOLSRELPATH) + $(Q)$(CP) $(foreach tool,$(INSTALLTOOLS),tools/$(tool)) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLTOOLSRELPATH) endif ifneq (,$(INSTALLSIMFW)) - $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(INSTALLFWRELPATH) - $(Q)$(CP) $(foreach fw,$(INSTALLSIMFW),tools/simmodule/$(fw)) $(DESTDIR)$(PREFIX)$(INSTALLFWRELPATH) + $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLFWRELPATH) + $(Q)$(CP) $(foreach fw,$(INSTALLSIMFW),tools/simmodule/$(fw)) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLFWRELPATH) endif ifeq ($(platform),Linux) $(Q)$(MKDIR) $(DESTDIR)$(UDEV_PREFIX) @@ -56,27 +56,27 @@ uninstall: common/uninstall common/uninstall: $(info [@] Uninstalling common resources from $(MYDESTDIR)$(PREFIX)...) ifneq (,$(INSTALLSCRIPTS)) - $(Q)$(RM) $(foreach script,$(INSTALLSCRIPTS),$(DESTDIR)$(PREFIX)$(INSTALLBINRELPATH)$(notdir $(script))) + $(Q)$(RM) $(foreach script,$(INSTALLSCRIPTS),$(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLBINRELPATH)$(PATHSEP)$(notdir $(script))) endif ifneq (,$(INSTALLSHARES)) - $(Q)$(RMDIR) $(foreach share,$(INSTALLSHARES),$(DESTDIR)$(PREFIX)$(INSTALLSHARERELPATH)$(notdir $(share))) + $(Q)$(RMDIR) $(foreach share,$(INSTALLSHARES),$(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLSHARERELPATH)$(PATHSEP)$(notdir $(share))) endif ifneq (,$(INSTALLDOCS)) - $(Q)$(RMDIR) $(foreach doc,$(INSTALLDOCS),$(DESTDIR)$(PREFIX)$(INSTALLDOCSRELPATH)$(notdir $(doc))) - $(Q)$(RMDIR_SOFT) $(DESTDIR)$(PREFIX)$(INSTALLDOCSRELPATH) + $(Q)$(RMDIR) $(foreach doc,$(INSTALLDOCS),$(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLDOCSRELPATH)$(PATHSEP)$(notdir $(doc))) + $(Q)$(RMDIR_SOFT) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLDOCSRELPATH) endif ifneq (,$(INSTALLTOOLS)) - $(Q)$(RM) $(foreach tool,$(INSTALLTOOLS),$(DESTDIR)$(PREFIX)$(INSTALLTOOLSRELPATH)$(notdir $(tool))) + $(Q)$(RM) $(foreach tool,$(INSTALLTOOLS),$(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLTOOLSRELPATH)$(PATHSEP)$(notdir $(tool))) endif - $(Q)$(RMDIR_SOFT) $(DESTDIR)$(PREFIX)$(INSTALLTOOLSRELPATH) + $(Q)$(RMDIR_SOFT) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLTOOLSRELPATH) ifneq (,$(INSTALLSIMFW)) - $(Q)$(RM) $(foreach fw,$(INSTALLSIMFW),$(DESTDIR)$(PREFIX)$(INSTALLFWRELPATH)$(notdir $(fw))) + $(Q)$(RM) $(foreach fw,$(INSTALLSIMFW),$(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLFWRELPATH)$(PATHSEP)$(notdir $(fw))) endif - $(Q)$(RMDIR_SOFT) $(DESTDIR)$(PREFIX)$(INSTALLFWRELPATH) + $(Q)$(RMDIR_SOFT) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLFWRELPATH) ifeq ($(platform),Linux) $(Q)$(RM) $(DESTDIR)$(UDEV_PREFIX)/77-pm3-usb-device-blacklist.rules endif - $(Q)$(RMDIR_SOFT) $(DESTDIR)$(PREFIX)$(INSTALLSHARERELPATH) + $(Q)$(RMDIR_SOFT) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLSHARERELPATH) mfkey/%: FORCE $(info [*] MAKE $@) diff --git a/Makefile.defs b/Makefile.defs index 64e74c243..4068d7516 100644 --- a/Makefile.defs +++ b/Makefile.defs @@ -26,13 +26,13 @@ CXX = g++ LD = g++ PATHSEP=/ -PREFIX ?= /usr/local -UDEV_PREFIX ?= /etc/udev/rules.d -INSTALLBINRELPATH ?= /bin/ -INSTALLSHARERELPATH ?= /share/proxmark3/ -INSTALLFWRELPATH ?= /share/proxmark3/firmware/ -INSTALLTOOLSRELPATH ?= /share/proxmark3/tools/ -INSTALLDOCSRELPATH ?= /share/doc/proxmark3/ +PREFIX ?= /usr/local +UDEV_PREFIX ?= /etc/udev/rules.d +INSTALLBINRELPATH ?= bin +INSTALLSHARERELPATH ?= share/proxmark3 +INSTALLFWRELPATH ?= share/proxmark3/firmware +INSTALLTOOLSRELPATH ?= share/proxmark3/tools +INSTALLDOCSRELPATH ?= share/doc/proxmark3 platform = $(shell uname) DETECTED_OS=$(platform) diff --git a/Makefile.host b/Makefile.host index 8fb6fceed..bfadd82b7 100644 --- a/Makefile.host +++ b/Makefile.host @@ -37,15 +37,15 @@ clean: install: all ifneq (,$(INSTALLTOOLS)) $(info [@] Installing $(BINS) to $(DESTDIR)$(PREFIX)...) - $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(INSTALLTOOLSRELPATH) - $(Q)$(CP) $(INSTALLTOOLS) $(DESTDIR)$(PREFIX)$(INSTALLTOOLSRELPATH) + $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLTOOLSRELPATH) + $(Q)$(CP) $(INSTALLTOOLS) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLTOOLSRELPATH) endif @true uninstall: ifneq (,$(INSTALLTOOLS)) $(info [@] Uninstalling $(BINS) from $(DESTDIR)$(PREFIX)...) - $(Q)$(RM) $(foreach tool,$(INSTALLTOOLS),$(DESTDIR)$(PREFIX)$(INSTALLTOOLSRELPATH)$(notdir $(tool))) + $(Q)$(RM) $(foreach tool,$(INSTALLTOOLS),$(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLTOOLSRELPATH)$(PATHSEP)$(notdir $(tool))) endif @true diff --git a/armsrc/Makefile b/armsrc/Makefile index bb8f17ef2..f94868b6e 100644 --- a/armsrc/Makefile +++ b/armsrc/Makefile @@ -222,12 +222,12 @@ clean: install: all $(info [@] Installing fullimage to $(DESTDIR)$(PREFIX)...) - $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(INSTALLFWRELPATH) - $(Q)$(CP) $(INSTALLFW) $(DESTDIR)$(PREFIX)$(INSTALLFWRELPATH)$(INSTALLFWTAG) + $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLFWRELPATH) + $(Q)$(CP) $(INSTALLFW) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLFWRELPATH)$(PATHSEP)$(INSTALLFWTAG) uninstall: $(info [@] Uninstalling fullimage from $(DESTDIR)$(PREFIX)...) - $(Q)$(RM) $(DESTDIR)$(PREFIX)$(INSTALLFWRELPATH)$(INSTALLFWTAG) + $(Q)$(RM) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLFWRELPATH)$(PATHSEP)$(INSTALLFWTAG) .PHONY: all clean help install uninstall help: diff --git a/bootrom/Makefile b/bootrom/Makefile index 0d3f081d9..d666f3acd 100644 --- a/bootrom/Makefile +++ b/bootrom/Makefile @@ -60,12 +60,12 @@ clean: install: all $(info [@] Installing bootrom to $(DESTDIR)$(PREFIX)...) - $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(INSTALLFWRELPATH) - $(Q)$(CP) $(INSTALLFW) $(DESTDIR)$(PREFIX)$(INSTALLFWRELPATH) + $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLFWRELPATH) + $(Q)$(CP) $(INSTALLFW) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLFWRELPATH) uninstall: $(info [@] Uninstalling bootrom from $(DESTDIR)$(PREFIX)...) - $(Q)$(RM) $(foreach fw,$(INSTALLFW),$(DESTDIR)$(PREFIX)$(INSTALLFWRELPATH)$(notdir $(fw))) + $(Q)$(RM) $(foreach fw,$(INSTALLFW),$(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLFWRELPATH)$(PATHSEP)$(notdir $(fw))) .PHONY: all clean help install help: diff --git a/client/Makefile b/client/Makefile index b670965b6..96b5d1bf4 100644 --- a/client/Makefile +++ b/client/Makefile @@ -328,22 +328,22 @@ clean: install: all $(info [@] Installing client to $(DESTDIR)$(PREFIX)...) ifneq (,$(INSTALLBIN)) - $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(INSTALLBINRELPATH) - $(Q)$(CP) $(INSTALLBIN) $(DESTDIR)$(PREFIX)$(INSTALLBINRELPATH) + $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLBINRELPATH) + $(Q)$(CP) $(INSTALLBIN) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLBINRELPATH) endif ifneq (,$(INSTALLSHARE)) - $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(INSTALLSHARERELPATH) - $(Q)$(CP) $(INSTALLSHARE) $(DESTDIR)$(PREFIX)$(INSTALLSHARERELPATH) + $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLSHARERELPATH) + $(Q)$(CP) $(INSTALLSHARE) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLSHARERELPATH) endif @true uninstall: $(info [@] Uninstalling client from $(DESTDIR)$(PREFIX)...) ifneq (,$(INSTALLBIN)) - $(Q)$(RM) $(foreach tool,$(INSTALLBIN),$(DESTDIR)$(PREFIX)$(INSTALLBINRELPATH)$(notdir $(tool))) + $(Q)$(RM) $(foreach tool,$(INSTALLBIN),$(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLBINRELPATH)$(PATHSEP)$(notdir $(tool))) endif ifneq (,$(INSTALLSHARE)) - $(Q)$(RMDIR) $(foreach tool,$(INSTALLSHARE),$(DESTDIR)$(PREFIX)$(INSTALLSHARERELPATH)$(notdir $(tool))) + $(Q)$(RMDIR) $(foreach tool,$(INSTALLSHARE),$(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLSHARERELPATH)$(PATHSEP)$(notdir $(tool))) endif @true diff --git a/doc/md/Development/Maintainers.md b/doc/md/Development/Maintainers.md index bc6b66cf5..ff3525784 100644 --- a/doc/md/Development/Maintainers.md +++ b/doc/md/Development/Maintainers.md @@ -31,11 +31,9 @@ If you need to tune some more paths, see their definition in `Makefile.defs`. E.g. you might need to move the documentation elsewhere according to your distro policy: ``` -make install PREFIX=/usr INSTALLDOCSRELPATH=/share/doc/proxmark3-${version}/ +make install PREFIX=/usr INSTALLDOCSRELPATH=share/doc/proxmark3-${version} ``` -Be careful to respect the same leading/closing `/` schema else you'll mess up your paths! - It's possible to add other firmwares as well with tagged names (`FWTAG=`), e.g. here we're compiling another image for non-RDV4 devices: ``` diff --git a/recovery/Makefile b/recovery/Makefile index 5a5fda0e8..2bfd1475f 100644 --- a/recovery/Makefile +++ b/recovery/Makefile @@ -28,11 +28,11 @@ clean: install: all $(info [@] Installing recovery to $(DESTDIR)$(PREFIX)...) - $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(INSTALLFWRELPATH) - $(Q)$(CP) $(INSTALLFW) $(DESTDIR)$(PREFIX)$(INSTALLFWRELPATH)$(INSTALLFWTAG) + $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLFWRELPATH) + $(Q)$(CP) $(INSTALLFW) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLFWRELPATH)$(PATHSEP)$(INSTALLFWTAG) uninstall: $(info [@] Uninstalling recovery from $(DESTDIR)$(PREFIX)...) - $(Q)$(RM) $(DESTDIR)$(PREFIX)$(INSTALLFWRELPATH)$(INSTALLFWTAG) + $(Q)$(RM) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLFWRELPATH)$(PATHSEP)$(INSTALLFWTAG) .PHONY: all clean install uninstall