]> cvs.zerfleddert.de Git - proxmark3-svn/blame - bootrom/Makefile.linux
fixed an intermitent pain in the ass to track down crash in the GUI client due to...
[proxmark3-svn] / bootrom / Makefile.linux
CommitLineData
aa4d9d9b 1CC = arm-elf-gcc
2AS = arm-elf-as
3LD = arm-elf-ld
4OBJCOPY = arm-elf-objcopy
5
6OBJDIR = obj
7
8INCLUDE = -I../include
9
10INCLUDES = ../include/proxmark3.h ../include/at91sam7s128.h ../include/config_gpio.h ../include/usb_cmd.h
11
12CFLAGS = -g -c $(INCLUDE) -Wall
13
14OBJJTAG = $(OBJDIR)/bootrom.o $(OBJDIR)/ram-reset.o $(OBJDIR)/usb.o
15
16OBJFLASH = $(OBJDIR)/flash-reset.o $(OBJDIR)/fromflash.o
17
18all: bootrom.s19 bootrom-forjtag-swapped.s19
19
20bootrom-merged.s19: bootrom.s19 bootrom-forjtag.s19
21 perl ../tools/merge-srec.pl bootrom.s19 bootrom-forjtag.s19 > bootrom-merged.s19
22
23bootrom-forjtag-swapped.s19: bootrom-merged.s19
24 perl ../tools/srecswap.pl bootrom-forjtag.s19 > bootrom-forjtag-swapped.s19
25
26bootrom.s19: $(OBJFLASH)
27 @echo bootrom.s19
28 $(LD) -g -Tldscript-flash --oformat elf32-littlearm -o $(OBJDIR)/bootrom.elf $(OBJFLASH)
29 $(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)/bootrom.elf bootrom.s19
30
31bootrom-forjtag.s19: $(OBJJTAG)
32 @echo bootrom-forjtag.s19
33 $(LD) -g -Tldscript-ram-jtag --oformat elf32-littlearm -o $(OBJDIR)/bootrom-forjtag.elf $(OBJJTAG)
34 $(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)/bootrom-forjtag.elf bootrom-forjtag.s19
35
36$(OBJDIR)/bootrom.o: bootrom.c $(INCLUDES)
37 @echo $@
38 $(CC) $(CFLAGS) -mthumb -mthumb-interwork $< -o $@
39
40$(OBJDIR)/fromflash.o: fromflash.c $(INCLUDES)
41 @echo $@
42 $(CC) $(CFLAGS) -mthumb -mthumb-interwork $< -o $@
43
44$(OBJDIR)/usb.o: ../common/usb.c $(INCLUDES)
45 @echo $@
46 $(CC) $(CFLAGS) -mthumb -mthumb-interwork $< -o $@
47
48$(OBJDIR)/ram-reset.o: ram-reset.s
49 @echo $@
50 $(CC) $(CFLAGS) -mthumb-interwork -o $@ $<
51
52$(OBJDIR)/flash-reset.o: flash-reset.s
53 @echo $@
54 $(CC) $(CFLAGS) -mthumb-interwork -o $@ $<
55
56# Those do not work in this Firmware distribution!
57flash: bootrom-merged.s19
58 ../linux/flasher bootrom bootrom-merged.s19
59
60jtag-flash: bootrom-merged.s19
61 ../../OpenOCD/openocd -c "halt; flash write_image bootrom-merged.s19 0x00100000; halt; reset; resume; poll; exit"
62
63clean:
64 rm -f $(OBJDIR)/*.o $(OBJDIR)/*.elf *.s19
65
Impressum, Datenschutz