Merge pull request #92 from marshmellow42/master
[legacy-proxmark3.git] / Makefile
blobb558da2d74a5dfcdbadd47d3bb37a89ae3eb7b47
1 include common/Makefile.common
3 GZIP=gzip
4 FLASH_PORT=/dev/ttyACM0
6 all clean: %: bootrom/% armsrc/% client/% recovery/%
8 bootrom/%: FORCE
9 $(MAKE) -C bootrom $(patsubst bootrom/%,%,$@)
10 armsrc/%: FORCE
11 $(MAKE) -C armsrc $(patsubst armsrc/%,%,$@)
12 client/%: FORCE
13 $(MAKE) -C client $(patsubst client/%,%,$@)
14 recovery/%: FORCE
15 $(MAKE) -C recovery $(patsubst recovery/%,%,$@)
16 FORCE: # Dummy target to force remake in the subdirectories, even if files exist (this Makefile doesn't know about the prerequisites)
19 .PHONY: all clean help _test flash-bootrom flash-os flash-fpga flash-both flash-all FORCE
20 help:
21 @echo Multi-OS Makefile, you are running on $(DETECTED_OS)
22 @echo Possible targets:
23 @echo + all - Make bootrom, armsrc and the OS-specific host directory
24 @echo + client - Make only the OS-specific host directory
25 @echo + flash-bootrom - Make bootrom and flash it
26 @echo + flash-os - Make armsrc and flash os (includes fpga)
27 @echo + flash-fpga - (Deprecated:) Make armsrc and flash fpga
28 @echo + flash-both - Make armsrc and flash os and fpga image
29 @echo + flash-all - Make bootrom and armsrc and flash bootrom, os and fpga image
30 @echo + clean - Clean in bootrom, armsrc and the OS-specific host directory
32 client: client/all
34 flash-bootrom: bootrom/obj/bootrom.elf $(FLASH_TOOL)
35 $(FLASH_TOOL) $(FLASH_PORT) -b $(subst /,$(PATHSEP),$<)
37 flash-os: armsrc/obj/osimage.elf $(FLASH_TOOL)
38 $(FLASH_TOOL) $(FLASH_PORT) $(subst /,$(PATHSEP),$<)
40 #flash-fpga: armsrc/obj/fpgaimage.elf $(FLASH_TOOL)
41 # $(FLASH_TOOL) $(FLASH_PORT) $(subst /,$(PATHSEP),$<)
43 flash-both: armsrc/obj/osimage.elf $(FLASH_TOOL)
44 $(FLASH_TOOL) $(FLASH_PORT) $(subst /,$(PATHSEP),$(filter-out $(FLASH_TOOL),$^))
46 flash-all: bootrom/obj/bootrom.elf armsrc/obj/osimage.elf $(FLASH_TOOL)
47 $(FLASH_TOOL) $(FLASH_PORT) -b $(subst /,$(PATHSEP),$(filter-out $(FLASH_TOOL),$^))
49 newtarbin:
50 $(DELETE) proxmark3-$(platform)-bin.tar proxmark3-$(platform)-bin.tar.gz
51 @touch proxmark3-$(platform)-bin.tar
53 tarbin: newtarbin client/tarbin armsrc/tarbin bootrom/tarbin
54 $(GZIP) proxmark3-$(platform)-bin.tar
56 # Dummy target to test for GNU make availability
57 _test: