1 include ..
/common_arm
/Makefile.common
3 INSTALLFW
= proxmark3_recovery.bin
5 INSTALLFWTAG
= $(notdir $(INSTALLFW
:%.bin
=%-$(FWTAG
).bin
))
7 INSTALLFWTAG
= $(notdir $(INSTALLFW
))
9 FWMAXSIZE
= $(shell echo
$$(($(PLATFORM_SIZE
)*1024)))
11 BINS
= bootrom.bin fullimage.bin
$(INSTALLFW
)
14 @FWSIZE
=$$(wc
-c
< $(INSTALLFW
));\
15 if
[ $$FWSIZE -gt
$(FWMAXSIZE
) ]; then \
16 echo
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \
17 echo
"ERROR: Firmware image too large for your platform! $$FWSIZE > $(FWMAXSIZE)"; \
18 echo
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \
21 echo
"==================================================================="; \
22 echo
"Firmware size: $$FWSIZE bytes ($$((FWSIZE/1024))kb) = $$((FWSIZE*100/$(FWMAXSIZE)))% of $$(($(FWMAXSIZE)/1024))kb"; \
23 echo
"==================================================================="
25 bootrom.bin
: ..
/bootrom
/obj
/bootrom.elf
27 $(Q
)$(CROSS_OBJCOPY
) --gap-fill
=0xff --pad-to
0x00102000 -O binary
$^
$@
29 fullimage.bin
: ..
/armsrc
/obj
/fullimage.elf
31 $(Q
)$(CROSS_OBJCOPY
) --gap-fill
=0xff -O binary
$^
$@
33 proxmark3_recovery.bin
: bootrom.bin fullimage.bin
35 $(Q
)cat bootrom.bin fullimage.bin
> $@
41 $(info [@
] Installing recovery to
$(DESTDIR
)$(PREFIX
)...
)
42 $(Q
)$(INSTALLSUDO
) $(MKDIR
) $(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLFWRELPATH
)
43 $(Q
)$(INSTALLSUDO
) $(CP
) $(INSTALLFW
) $(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLFWRELPATH
)$(PATHSEP
)$(INSTALLFWTAG
)
46 $(info [@
] Uninstalling recovery from
$(DESTDIR
)$(PREFIX
)...
)
47 $(Q
)$(INSTALLSUDO
) $(RM
) $(DESTDIR
)$(PREFIX
)$(PATHSEP
)$(INSTALLFWRELPATH
)$(PATHSEP
)$(INSTALLFWTAG
)
49 .PHONY
: all clean install uninstall