]> git.zerfleddert.de Git - proxmark3-svn/blame - bootrom/Makefile
Initial commit for the firmware. Used the 20090306_ela version as baseline.
[proxmark3-svn] / bootrom / Makefile
CommitLineData
6658905f 1CC = arm-elf-gcc\r
2AS = arm-elf-as\r
3LD = arm-elf-ld\r
4OBJCOPY = arm-elf-objcopy\r
5\r
6OBJDIR = obj\r
7\r
8INCLUDE = -I../include\r
9\r
10INCLUDES = ../include/proxmark3.h ../include/at91sam7s128.h ../include/config_gpio.h ../include/usb_cmd.h\r
11\r
12CFLAGS = -g -c $(INCLUDE) -Wall\r
13\r
14OBJJTAG = $(OBJDIR)/bootrom.o $(OBJDIR)/ram-reset.o $(OBJDIR)/usb.o\r
15\r
16OBJFLASH = $(OBJDIR)/flash-reset.o $(OBJDIR)/fromflash.o\r
17\r
18all: bootrom.s19\r
19\r
20bootrom.s19: $(OBJDIR)/bootrom.s19 $(OBJDIR)/bootrom-forjtag.s19\r
21 @echo bootrom.s19\r
22 @perl ..\tools\merge-srec.pl $(OBJDIR)\bootrom.s19 $(OBJDIR)\bootrom-forjtag.s19 > $(OBJDIR)\bootrom-merged.s19\r
23 @perl ..\tools\srecswap.pl $(OBJDIR)\bootrom-forjtag.s19 > $(OBJDIR)\bootrom-forjtag-swapped.s19\r
24\r
25$(OBJDIR)/bootrom.s19: $(OBJFLASH)\r
26 @echo obj/bootrom.s19\r
27 @$(LD) -g -Tldscript-flash --oformat elf32-littlearm -o $(OBJDIR)/bootrom.elf $(OBJFLASH)\r
28 @$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)/bootrom.elf $(OBJDIR)/bootrom.s19\r
29\r
30$(OBJDIR)/bootrom-forjtag.s19: $(OBJJTAG)\r
31 @echo obj/bootrom-forjtag.s19\r
32 @$(LD) -g -Tldscript-ram-jtag --oformat elf32-littlearm -o $(OBJDIR)/bootrom-forjtag.elf $(OBJJTAG)\r
33 @$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)/bootrom-forjtag.elf $(OBJDIR)/bootrom-forjtag.s19\r
34\r
35$(OBJDIR)/bootrom.o: bootrom.c $(INCLUDES)\r
36 @echo $(@B).c\r
37 @$(CC) $(CFLAGS) -mthumb -mthumb-interwork bootrom.c -o $(OBJDIR)/bootrom.o\r
38\r
39$(OBJDIR)/fromflash.o: fromflash.c $(INCLUDES)\r
40 @echo $(@B).c\r
41 @$(CC) $(CFLAGS) -mthumb -mthumb-interwork fromflash.c -o $(OBJDIR)/fromflash.o\r
42\r
43$(OBJDIR)/usb.o: ../common/usb.c $(INCLUDES)\r
44 @echo $(@B).c\r
45 @$(CC) $(CFLAGS) -mthumb -mthumb-interwork ../common/usb.c -o $(OBJDIR)/usb.o\r
46\r
47$(OBJDIR)/ram-reset.o: ram-reset.s\r
48 @echo $(@B).s\r
49 @$(CC) $(CFLAGS) -mthumb-interwork -o $(OBJDIR)/ram-reset.o ram-reset.s\r
50\r
51$(OBJDIR)/flash-reset.o: flash-reset.s\r
52 @echo $(@B).s\r
53 @$(CC) $(CFLAGS) -mthumb-interwork -o $(OBJDIR)/flash-reset.o flash-reset.s\r
54\r
55clean:\r
56 del /q obj\*.o\r
57 del /q obj\*.elf\r
58 del /q obj\*.s19\r
Impressum, Datenschutz