proxmark3/recovery/Makefile

47 lines
1.5 KiB
Makefile
Raw Normal View History

include ../common_arm/Makefile.common
2019-08-31 03:55:13 +08:00
INSTALLFW = proxmark3_recovery.bin
ifneq (,$(FWTAG))
INSTALLFWTAG = $(notdir $(INSTALLFW:%.bin=%-$(FWTAG).bin))
else
INSTALLFWTAG = $(notdir $(INSTALLFW))
endif
2020-11-05 09:32:41 +08:00
FWMAXSIZE = $(shell echo $$(($(PLATFORM_SIZE)*1024)))
2019-08-31 03:55:13 +08:00
BINS = bootrom.bin fullimage.bin $(INSTALLFW)
all: $(BINS)
2020-11-11 04:02:57 +08:00
@FWSIZE=$$(wc -c < $(INSTALLFW));\
2020-11-05 09:32:41 +08:00
if [ $$FWSIZE -gt $(FWMAXSIZE) ]; then \
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \
echo "ERROR: Firmware image too large for your platform! $$FWSIZE > $(FWMAXSIZE)"; \
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \
exit 1; \
fi
bootrom.bin: ../bootrom/obj/bootrom.elf
$(info [=] GEN $@)
$(Q)$(CROSS_OBJCOPY) --gap-fill=0xff --pad-to 0x00102000 -O binary $^ $@
fullimage.bin: ../armsrc/obj/fullimage.elf
$(info [=] GEN $@)
$(Q)$(CROSS_OBJCOPY) --gap-fill=0xff -O binary $^ $@
proxmark3_recovery.bin: bootrom.bin fullimage.bin
$(info [=] GEN $@)
$(Q)cat bootrom.bin fullimage.bin > $@
2019-03-10 18:35:03 +08:00
clean:
2019-08-31 03:55:13 +08:00
$(Q)$(RM) $(BINS)
2019-08-31 03:44:40 +08:00
install: all
2019-08-31 03:55:13 +08:00
$(info [@] Installing recovery to $(DESTDIR)$(PREFIX)...)
$(Q)$(INSTALLSUDO) $(MKDIR) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLFWRELPATH)
$(Q)$(INSTALLSUDO) $(CP) $(INSTALLFW) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLFWRELPATH)$(PATHSEP)$(INSTALLFWTAG)
2019-08-31 03:44:40 +08:00
2019-08-31 03:55:13 +08:00
uninstall:
$(info [@] Uninstalling recovery from $(DESTDIR)$(PREFIX)...)
$(Q)$(INSTALLSUDO) $(RM) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLFWRELPATH)$(PATHSEP)$(INSTALLFWTAG)
2019-08-31 03:44:40 +08:00
2019-08-31 03:55:13 +08:00
.PHONY: all clean install uninstall