1 # This makefile needs to be edited to reflect the location
2 # of your own arm-elf-gcc installation (LIB variable)
7 OBJCOPY = arm-elf-objcopy
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
14 CFLAGS_COMMON = -O6 -c $(INCLUDE) -Wall -mthumb-interwork
15 CFLAGS = $(CFLAGS_COMMON) -mthumb
35 all: osimage.s19 fpgaimage.s19 fullimage.s19
37 fpgaimage.s19: $(OBJFPGA)
39 $(LD) -g -Tldscript-fpga -o fpgaimage.elf $(patsubst %.o, obj/%.o, $^)
40 $(OBJCOPY) -Osrec --srec-forceS3 fpgaimage.elf fpgaimage.s19
42 osimage.s19: $(OBJ) $(OBJFAST) $(OBJCOMMON)
44 $(LD) -g -Tldscript -o osimage.elf $(patsubst %.o, obj/%.o, $^) $(LIB)/libgcc.a
45 $(OBJCOPY) -Osrec --srec-forceS3 osimage.elf osimage.s19
47 fullimage.s19: $(OBJ) $(OBJFAST) $(OBJCOMMON) $(OBJFAST) $(OBJFPGA)
49 $(LD) -g -Tldscript-full -o fullimage.elf $(patsubst %.o, obj/%.o, $^) $(LIB)/libgcc.a
50 $(OBJCOPY) -Osrec --srec-forceS3 fullimage.elf fullimage.s19
53 $(CC) $(CFLAGS) $< -o $(OBJDIR)/$@
56 $(CC) $(CFLAGS) $< -o $(OBJDIR)/$@
60 $(CC) $(CFLAGS_COMMON) $< -o $(OBJDIR)/$@
62 $(OBJCOMMON): ../common/usb.c
63 $(CC) $(CFLAGS) ../common/usb.c -o $(OBJDIR)/usb.o
65 flash-fpga: fpgaimage.s19
66 ../linux/flasher fpga fpgaimage.s19
69 ../linux/flasher os osimage.s19
71 jtag-flash-full: fullimage.s19
72 ../../OpenOCD/openocd -c "halt; flash write_image fullimage.s19 0x00100000; halt; reset; resume; poll; exit"
74 jtag-flash-fpga: fpgaimage.s19
75 ../../OpenOCD/openocd -c "halt; flash write_image fpgaimage.s19 0x00100000; halt; reset; resume; poll; exit"
77 jtag-flash: osimage.s19
78 ../../OpenOCD/openocd -c "halt; flash write_image osimage.s19 0x00100000; halt; reset; resume; poll; exit"
81 rm -f $(OBJDIR)/*.o *.elf *.s19