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