]>
Commit | Line | Data |
---|---|---|
1 | PATH=..\..\devkitARM\bin;%PATH%\r | |
2 | CC = arm-elf-gcc\r | |
3 | AS = arm-elf-as\r | |
4 | LD = arm-elf-ld\r | |
5 | OBJCOPY = arm-elf-objcopy\r | |
6 | \r | |
7 | OBJDIR = obj\r | |
8 | \r | |
9 | INCLUDE = -I../include\r | |
10 | \r | |
11 | INCLUDES = ../include/proxmark3.h ../include/at91sam7s128.h ../include/config_gpio.h ../include/usb_cmd.h apps.h\r | |
12 | LIB = "..\..\devkitARM\lib\gcc\arm-elf\4.1.0\interwork"\r | |
13 | \r | |
14 | # Add the "-DWITH_LCD" flag in CLFAGS to add support for LCD\r | |
15 | # and add OBJLCD to OBJ too\r | |
16 | CFLAGS = -O6 -c $(INCLUDE) -Wall\r | |
17 | \r | |
18 | OBJLCD = $(OBJDIR)/fonts.o \\r | |
19 | $(OBJDIR)/LCD.o\r | |
20 | \r | |
21 | OBJ = $(OBJDIR)/start.o \\r | |
22 | $(OBJDIR)/appmain.o \\r | |
23 | $(OBJDIR)/fpga.o \\r | |
24 | $(OBJDIR)/iso14443.o \\r | |
25 | $(OBJDIR)/iso14443a.o \\r | |
26 | $(OBJDIR)/iso15693.o \\r | |
27 | $(OBJDIR)/util.o\r | |
28 | \r | |
29 | OBJFPGA = \\r | |
30 | $(OBJDIR)/fpgaimg.o\r | |
31 | \r | |
32 | OBJCOMMON = \\r | |
33 | $(OBJDIR)/usb.o\r | |
34 | \r | |
35 | all: osimage.s19\r | |
36 | \r | |
37 | $(OBJDIR)/fpgaimage.s19: $(OBJDIR)/fpgaimg.o\r | |
38 | @echo obj/fpgaimage.s19\r | |
39 | @$(LD) -g -Tldscript-fpga -o $(OBJDIR)\fpgaimage.elf $(OBJDIR)/fpgaimg.o\r | |
40 | @$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)\fpgaimage.elf $(OBJDIR)\fpgaimage.s19\r | |
41 | \r | |
42 | $(OBJDIR)/osimage.s19: $(OBJ) $(OBJCOMMON)\r | |
43 | @echo obj/osimage.s19\r | |
44 | @$(LD) -g -Tldscript -o $(OBJDIR)\osimage.elf $(OBJ) $(OBJCOMMON) $(LIB)\libgcc.a\r | |
45 | @$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)\osimage.elf $(OBJDIR)\osimage.s19\r | |
46 | \r | |
47 | osimage.s19: $(OBJDIR)/osimage.s19 $(OBJDIR)/fpgaimage.s19\r | |
48 | @echo osimage.s19\r | |
49 | \r | |
50 | $(OBJ): $(@B).c $(INCLUDES)\r | |
51 | @echo $(@B).c\r | |
52 | @$(CC) $(CFLAGS) -mthumb -mthumb-interwork $(@B).c -o $(OBJDIR)/$(@B).o\r | |
53 | \r | |
54 | $(OBJCOMMON): ../common/$(@B).c $(INCLUDES)\r | |
55 | @echo $(@B).c\r | |
56 | @$(CC) $(CFLAGS) -mthumb -mthumb-interwork ../common/$(@B).c -o $(OBJDIR)/$(@B).o\r | |
57 | \r | |
58 | $(OBJFPGA): $(@B).c $(INCLUDES)\r | |
59 | @echo $(@B).c\r | |
60 | @$(CC) $(CFLAGS) -mthumb -mthumb-interwork $(@B).c -o $(OBJDIR)/$(@B).o\r | |
61 | \r | |
62 | clean:\r | |
63 | del /q obj\*.o\r | |
64 | del /q obj\*.elf\r | |
65 | del /q obj\*.s19\r |