]> git.zerfleddert.de Git - proxmark3-svn/blame - Makefile
Merge pull request #938 from pwpiwi/fix_printf_scanf
[proxmark3-svn] / Makefile
CommitLineData
fb9acd45 1GZIP=gzip
2# Windows' echo echos its input verbatim, on Posix there is some
3# amount of shell command line parsing going on. echo "" on
4# Windows yields literal "", on Linux yields an empty line
5ifeq ($(shell echo ""),)
6# This is probably a proper system, so we can use uname
7DELETE=rm -rf
8FLASH_TOOL=client/flasher
9platform=$(shell uname)
10ifneq (,$(findstring MINGW,$(platform)))
11FLASH_PORT=com3
12PATHSEP=\\#
13else
03f29e03 14FLASH_PORT=/dev/ttyACM0
fb9acd45 15PATHSEP=/
16endif
17else
18# Assume that we are running on native Windows
19DELETE=del /q
20FLASH_TOOL=client/flasher.exe
21platform=Windows
22FLASH_PORT=com3
23PATHSEP=\\#
24endif
bd846386 25
fb9acd45 26all clean: %: client/% bootrom/% armsrc/% recovery/% mfkey/%
db335b3d 27
64b81198 28bootrom/%: FORCE
fb9acd45 29 $(MAKE) -C bootrom $(patsubst bootrom/%, %, $@)
64b81198 30armsrc/%: FORCE
fb9acd45 31 $(MAKE) -C armsrc $(patsubst armsrc/%, %, $@)
d5be6f7c 32client/%: FORCE
fb9acd45 33 $(MAKE) -C client $(patsubst client/%, %, $@)
a79e330d 34recovery/%: FORCE
fb9acd45 35 $(MAKE) -C recovery $(patsubst recovery/%, %, $@)
36mfkey/%: FORCE
37 $(MAKE) -C tools/mfkey $(patsubst mfkey/%, %, $@)
64b81198 38FORCE: # Dummy target to force remake in the subdirectories, even if files exist (this Makefile doesn't know about the prerequisites)
39
f3919878 40.PHONY: all clean help _test flash-bootrom flash-os flash-all FORCE
64b81198 41
db335b3d 42help:
43 @echo Multi-OS Makefile, you are running on $(DETECTED_OS)
44 @echo Possible targets:
64b81198 45 @echo + all - Make bootrom, armsrc and the OS-specific host directory
33bf54cf 46 @echo + client - Make only the OS-specific host directory
64b81198 47 @echo + flash-bootrom - Make bootrom and flash it
16f54ead 48 @echo + flash-os - Make armsrc and flash os \(includes fpga\)
f3919878 49 @echo + flash-all - Make bootrom and armsrc and flash bootrom and os image
64b81198 50 @echo + clean - Clean in bootrom, armsrc and the OS-specific host directory
51
33bf54cf 52client: client/all
53
fb9acd45 54mfkey: mfkey/all
55
70b1a685 56flash-bootrom: bootrom/obj/bootrom.elf $(FLASH_TOOL)
03f29e03 57 $(FLASH_TOOL) $(FLASH_PORT) -b $(subst /,$(PATHSEP),$<)
64b81198 58
fb228974 59flash-os: armsrc/obj/fullimage.elf $(FLASH_TOOL)
03f29e03 60 $(FLASH_TOOL) $(FLASH_PORT) $(subst /,$(PATHSEP),$<)
c2686a49 61
fb228974 62flash-all: bootrom/obj/bootrom.elf armsrc/obj/fullimage.elf $(FLASH_TOOL)
03f29e03 63 $(FLASH_TOOL) $(FLASH_PORT) -b $(subst /,$(PATHSEP),$(filter-out $(FLASH_TOOL),$^))
52b3d184 64
bd846386 65newtarbin:
66 $(DELETE) proxmark3-$(platform)-bin.tar proxmark3-$(platform)-bin.tar.gz
67 @touch proxmark3-$(platform)-bin.tar
68
69tarbin: newtarbin client/tarbin armsrc/tarbin bootrom/tarbin
70 $(GZIP) proxmark3-$(platform)-bin.tar
71
52b3d184 72# Dummy target to test for GNU make availability
73_test:
Impressum, Datenschutz