]>
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)/lfops.o \\r | |
25 | $(OBJDIR)/iso14443.o \\r | |
26 | $(OBJDIR)/iso14443a.o \\r | |
27 | $(OBJDIR)/iso15693.o \\r | |
28 | $(OBJDIR)/util.o\r | |
29 | \r | |
30 | OBJFPGA = \\r | |
31 | $(OBJDIR)/fpgaimg.o\r | |
32 | \r | |
33 | OBJCOMMON = \\r | |
34 | $(OBJDIR)/usb.o\r | |
35 | \r | |
36 | all: osimage.s19\r | |
37 | \r | |
38 | $(OBJDIR)/fpgaimage.s19: $(OBJDIR)/fpgaimg.o\r | |
39 | @echo obj/fpgaimage.s19\r | |
40 | @$(LD) -g -Tldscript-fpga -o $(OBJDIR)\fpgaimage.elf -Map=obj/fpgaimage.map $(OBJDIR)/fpgaimg.o\r | |
41 | @$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)\fpgaimage.elf $(OBJDIR)\fpgaimage.s19\r | |
42 | \r | |
43 | $(OBJDIR)/osimage.s19: $(OBJ) $(OBJCOMMON)\r | |
44 | @echo obj/osimage.s19\r | |
45 | @$(LD) -g -Tldscript -o $(OBJDIR)\osimage.elf $(OBJ) $(OBJCOMMON) -Map=obj/osimage.map $(LIB)\libgcc.a\r | |
46 | @$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)\osimage.elf $(OBJDIR)\osimage.s19\r | |
47 | \r | |
48 | osimage.s19: $(OBJDIR)/osimage.s19 $(OBJDIR)/fpgaimage.s19\r | |
49 | @echo osimage.s19\r | |
50 | \r | |
51 | $(OBJ): $(@B).c $(INCLUDES)\r | |
52 | @echo $(@B).c\r | |
53 | @$(CC) $(CFLAGS) -mthumb -mthumb-interwork $(@B).c -o $(OBJDIR)/$(@B).o\r | |
54 | \r | |
55 | $(OBJCOMMON): ../common/$(@B).c $(INCLUDES)\r | |
56 | @echo $(@B).c\r | |
57 | @$(CC) $(CFLAGS) -mthumb -mthumb-interwork ../common/$(@B).c -o $(OBJDIR)/$(@B).o\r | |
58 | \r | |
59 | $(OBJFPGA): $(@B).c $(INCLUDES)\r | |
60 | @echo $(@B).c\r | |
61 | @$(CC) $(CFLAGS) -mthumb -mthumb-interwork $(@B).c -o $(OBJDIR)/$(@B).o\r | |
62 | \r | |
63 | clean:\r | |
64 | del /q obj\*.o\r | |
65 | del /q obj\*.elf\r | |
66 | del /q obj\*.s19\r |