]>
Commit | Line | Data |
---|---|---|
1 | CC = arm-elf-gcc\r | |
2 | AS = arm-elf-as\r | |
3 | LD = arm-elf-ld\r | |
4 | OBJCOPY = arm-elf-objcopy\r | |
5 | \r | |
6 | OBJDIR = obj\r | |
7 | \r | |
8 | INCLUDE = -I../include\r | |
9 | \r | |
10 | INCLUDES = ../include/proxmark3.h ../include/at91sam7s128.h ../include/config_gpio.h ../include/usb_cmd.h\r | |
11 | \r | |
12 | CFLAGS = -g -c $(INCLUDE) -Wall\r | |
13 | \r | |
14 | OBJJTAG = $(OBJDIR)/bootrom.o $(OBJDIR)/ram-reset.o $(OBJDIR)/usb.o\r | |
15 | \r | |
16 | OBJFLASH = $(OBJDIR)/flash-reset.o $(OBJDIR)/fromflash.o\r | |
17 | \r | |
18 | all: bootrom.s19\r | |
19 | \r | |
20 | bootrom.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 | |
55 | clean:\r | |
56 | del /q obj\*.o\r | |
57 | del /q obj\*.elf\r | |
58 | del /q obj\*.s19\r |