]>
Commit | Line | Data |
---|---|---|
b1d0de0a | 1 | # This makefile needs to be edited to reflect the location |
2 | # of your own arm-elf-gcc installation (LIB variable) | |
3 | ||
4 | CC = arm-elf-gcc | |
5 | AS = arm-elf-as | |
6 | LD = arm-elf-ld | |
7 | OBJCOPY = arm-elf-objcopy | |
8 | ||
9 | INCLUDE = -I../include | |
10 | ||
11 | INCLUDES = ../include/proxmark3.h ../include/at91sam7s128.h ../include/config_gpio.h ../include/usb_cmd.h apps.h | |
12 | LIB = /usr/local/new/gnuarm-4.3.0/lib/gcc/arm-elf/4.3.0/interwork | |
13 | ||
14 | CFLAGS_COMMON = -O6 -c $(INCLUDE) -Wall -mthumb-interwork | |
15 | CFLAGS = $(CFLAGS_COMMON) -mthumb | |
16 | ||
17 | ||
18 | OBJDIR = obj | |
19 | OBJ = start.o \ | |
20 | appmain.o \ | |
21 | fpga.o \ | |
22 | iso15693.o \ | |
23 | iso14443.o \ | |
24 | util.o\ | |
25 | LCD.o\ | |
26 | fonts.o | |
27 | ||
28 | OBJFAST = iso14443a.o | |
29 | ||
30 | OBJFPGA = fpgaimg.o | |
31 | ||
32 | OBJCOMMON = usb.o | |
33 | ||
34 | ||
35 | all: osimage.s19 fpgaimage.s19 fullimage.s19 | |
36 | ||
37 | fpgaimage.s19: $(OBJFPGA) | |
38 | @echo fpgaimage.s19 | |
39 | $(LD) -g -Tldscript-fpga -o fpgaimage.elf $(patsubst %.o, obj/%.o, $^) | |
40 | $(OBJCOPY) -Osrec --srec-forceS3 fpgaimage.elf fpgaimage.s19 | |
41 | ||
42 | osimage.s19: $(OBJ) $(OBJFAST) $(OBJCOMMON) | |
43 | @echo osimage.s19 | |
44 | $(LD) -g -Tldscript -o osimage.elf $(patsubst %.o, obj/%.o, $^) $(LIB)/libgcc.a | |
45 | $(OBJCOPY) -Osrec --srec-forceS3 osimage.elf osimage.s19 | |
46 | ||
47 | fullimage.s19: $(OBJ) $(OBJFAST) $(OBJCOMMON) $(OBJFAST) $(OBJFPGA) | |
48 | @echo fullimage.s19 | |
49 | $(LD) -g -Tldscript-full -o fullimage.elf $(patsubst %.o, obj/%.o, $^) $(LIB)/libgcc.a | |
50 | $(OBJCOPY) -Osrec --srec-forceS3 fullimage.elf fullimage.s19 | |
51 | ||
52 | $(OBJ): %.o : %.c | |
53 | $(CC) $(CFLAGS) $< -o $(OBJDIR)/$@ | |
54 | ||
55 | $(OBJFPGA): %.o : %.c | |
56 | $(CC) $(CFLAGS) $< -o $(OBJDIR)/$@ | |
57 | ||
58 | ||
59 | $(OBJFAST): %.o : %.c | |
60 | $(CC) $(CFLAGS_COMMON) $< -o $(OBJDIR)/$@ | |
61 | ||
62 | $(OBJCOMMON): ../common/usb.c | |
63 | $(CC) $(CFLAGS) ../common/usb.c -o $(OBJDIR)/usb.o | |
64 | ||
65 | flash-fpga: fpgaimage.s19 | |
66 | ../linux/flasher fpga fpgaimage.s19 | |
67 | ||
68 | flash: osimage.s19 | |
69 | ../linux/flasher os osimage.s19 | |
70 | ||
71 | jtag-flash-full: fullimage.s19 | |
72 | ../../OpenOCD/openocd -c "halt; flash write_image fullimage.s19 0x00100000; halt; reset; resume; poll; exit" | |
73 | ||
74 | jtag-flash-fpga: fpgaimage.s19 | |
75 | ../../OpenOCD/openocd -c "halt; flash write_image fpgaimage.s19 0x00100000; halt; reset; resume; poll; exit" | |
76 | ||
77 | jtag-flash: osimage.s19 | |
78 | ../../OpenOCD/openocd -c "halt; flash write_image osimage.s19 0x00100000; halt; reset; resume; poll; exit" | |
79 | ||
80 | clean: | |
81 | rm -f $(OBJDIR)/*.o *.elf *.s19 | |
82 | ||
83 | .PHONY: all clean |