Add possibility to make install more firmware variants

This commit is contained in:
Philippe Teuwen 2019-08-31 00:26:35 +02:00
parent ddd32bcb4b
commit 6949a780fc
3 changed files with 23 additions and 4 deletions

View file

@ -130,6 +130,8 @@ fullimage: armsrc/all
fullimage/clean: armsrc/clean fullimage/clean: armsrc/clean
fullimage/install: armsrc/install
recovery: recovery/all recovery: recovery/all
mfkey: mfkey/all mfkey: mfkey/all

View file

@ -135,6 +135,12 @@ include ../common_arm/Makefile.common
COMMON_FLAGS = -Os COMMON_FLAGS = -Os
INSTALLFW = $(OBJDIR)/fullimage.elf INSTALLFW = $(OBJDIR)/fullimage.elf
ifneq (,$(FWTAG))
INSTALLFWTAG = $(notdir $(INSTALLFW:%.elf=%-$(FWTAG).elf))
else
INSTALLFWTAG = $(notdir $(INSTALLFW))
endif
OBJS = $(OBJDIR)/fullimage.s19 OBJS = $(OBJDIR)/fullimage.s19
FPGA_COMPRESSOR = ../tools/fpga_compress/fpga_compress FPGA_COMPRESSOR = ../tools/fpga_compress/fpga_compress
@ -217,11 +223,11 @@ clean:
install: all install: all
$(info [@] Installing fullimage to $(DESTDIR)$(PREFIX)...) $(info [@] Installing fullimage to $(DESTDIR)$(PREFIX)...)
$(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(INSTALLFWRELPATH) $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)$(INSTALLFWRELPATH)
$(Q)$(CP) $(INSTALLFW) $(DESTDIR)$(PREFIX)$(INSTALLFWRELPATH) $(Q)$(CP) $(INSTALLFW) $(DESTDIR)$(PREFIX)$(INSTALLFWRELPATH)$(INSTALLFWTAG)
uninstall: uninstall:
$(info [@] Uninstalling fullimage from $(DESTDIR)$(PREFIX)...) $(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 .PHONY: all clean help install uninstall
help: help:

View file

@ -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.: `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 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/lib/udev/rules.d/77-pm3-usb-device-blacklist.rules
./build/usr/bin/proxmark3 ... ./build/usr/bin/proxmark3 ...
./build/usr/share/doc/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 :) 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=<mytag>`), 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`. For verbose usage and see the actual commands being executed, add `V=1`.
`CFLAGS` and `LDFLAGS` can be overriden by environment variables. `CFLAGS` and `LDFLAGS` can be overriden by environment variables.