From 6949a780fc6928f8dfd12b09484bfdfb5c8db56d Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sat, 31 Aug 2019 00:26:35 +0200 Subject: [PATCH] Add possibility to make install more firmware variants --- Makefile | 2 ++ armsrc/Makefile | 10 ++++++++-- doc/md/Development/Maintainers.md | 15 +++++++++++++-- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 79d9a2ff8..43de3969b 100644 --- a/Makefile +++ b/Makefile @@ -130,6 +130,8 @@ fullimage: armsrc/all fullimage/clean: armsrc/clean +fullimage/install: armsrc/install + recovery: recovery/all mfkey: mfkey/all diff --git a/armsrc/Makefile b/armsrc/Makefile index 8cbe03dab..bb8f17ef2 100644 --- a/armsrc/Makefile +++ b/armsrc/Makefile @@ -135,6 +135,12 @@ include ../common_arm/Makefile.common COMMON_FLAGS = -Os INSTALLFW = $(OBJDIR)/fullimage.elf +ifneq (,$(FWTAG)) + INSTALLFWTAG = $(notdir $(INSTALLFW:%.elf=%-$(FWTAG).elf)) +else + INSTALLFWTAG = $(notdir $(INSTALLFW)) +endif + OBJS = $(OBJDIR)/fullimage.s19 FPGA_COMPRESSOR = ../tools/fpga_compress/fpga_compress @@ -217,11 +223,11 @@ clean: install: all $(info [@] Installing fullimage to $(DESTDIR)$(PREFIX)...) $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(INSTALLFWRELPATH) - $(Q)$(CP) $(INSTALLFW) $(DESTDIR)$(PREFIX)$(INSTALLFWRELPATH) + $(Q)$(CP) $(INSTALLFW) $(DESTDIR)$(PREFIX)$(INSTALLFWRELPATH)$(INSTALLFWTAG) uninstall: $(info [@] Uninstalling fullimage from $(DESTDIR)$(PREFIX)...) - $(Q)$(RM) $(foreach fw,$(INSTALLFW),$(DESTDIR)$(PREFIX)$(INSTALLFWRELPATH)$(notdir $(fw))) + $(Q)$(RM) $(DESTDIR)$(PREFIX)$(INSTALLFWRELPATH)$(INSTALLFWTAG) .PHONY: all clean help install uninstall help: diff --git a/doc/md/Development/Maintainers.md b/doc/md/Development/Maintainers.md index 9472cacb6..542512fd0 100644 --- a/doc/md/Development/Maintainers.md +++ b/doc/md/Development/Maintainers.md @@ -10,7 +10,7 @@ Makefile `DESTDIR` can be provided by environment variable, it can be a relative path and it will be prepended to `PREFIX`, so you can use e.g.: -`make install DESTDIR=build PREFIX=/usr UDEV_PREFIX=/lib/udev/rules.d` +`make -j install DESTDIR=build PREFIX=/usr UDEV_PREFIX=/lib/udev/rules.d` and it will be deployed as @@ -18,11 +18,22 @@ and it will be deployed as ./build/lib/udev/rules.d/77-pm3-usb-device-blacklist.rules ./build/usr/bin/proxmark3 ... ./build/usr/share/doc/proxmark3/... -./build/usr/share/proxmark3/... +./build/usr/share/proxmark3/firmware/fullimage.elf +etc. ``` That should be a good start for you to create your package :) +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: + +`make -j fullimage/install DESTDIR=build PREFIX=/usr PLATFORM=PM3OTHER PLATFORM_EXTRAS= FWTAG=other` + +and it will be added along the other firmware as: + +``` +./build/usr/share/proxmark3/firmware/fullimage-other.elf +``` + For verbose usage and see the actual commands being executed, add `V=1`. `CFLAGS` and `LDFLAGS` can be overriden by environment variables.