Reduced the size of BigBuf to make more room for stack/vars
[proxmark3-svn] / bootrom / Makefile
1 CC = arm-elf-gcc
2 AS = arm-elf-as
3 LD = arm-elf-ld
4 OBJCOPY = arm-elf-objcopy
5
6 OBJDIR = obj
7
8 INCLUDE = -I../include
9
10 INCLUDES = ../include/proxmark3.h ../include/at91sam7s128.h ../include/config_gpio.h ../include/usb_cmd.h
11
12 CFLAGS = -g -c $(INCLUDE) -Wall
13
14 OBJJTAG = $(OBJDIR)/bootrom.o $(OBJDIR)/ram-reset.o $(OBJDIR)/usb.o
15
16 OBJFLASH = $(OBJDIR)/flash-reset.o $(OBJDIR)/fromflash.o
17
18 all: bootrom.s19
19
20 bootrom.s19: $(OBJDIR)/bootrom.s19 $(OBJDIR)/bootrom-forjtag.s19
21 @echo bootrom.s19
22 @perl ..\tools\merge-srec.pl $(OBJDIR)\bootrom.s19 $(OBJDIR)\bootrom-forjtag.s19 > $(OBJDIR)\bootrom-merged.s19
23 @perl ..\tools\srecswap.pl $(OBJDIR)\bootrom-forjtag.s19 > $(OBJDIR)\bootrom-forjtag-swapped.s19
24
25 $(OBJDIR)/bootrom.s19: $(OBJFLASH)
26 @echo obj/bootrom.s19
27 @$(LD) -g -Tldscript-flash --oformat elf32-littlearm -Map=obj/bootrom.map -o $(OBJDIR)/bootrom.elf $(OBJFLASH)
28 @$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)/bootrom.elf $(OBJDIR)/bootrom.s19
29
30 $(OBJDIR)/bootrom-forjtag.s19: $(OBJJTAG)
31 @echo obj/bootrom-forjtag.s19
32 @$(LD) -g -Tldscript-ram-jtag --oformat elf32-littlearm -Map=obj/bootrom-forjtag.map -o $(OBJDIR)/bootrom-forjtag.elf $(OBJJTAG)
33 @$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)/bootrom-forjtag.elf $(OBJDIR)/bootrom-forjtag.s19
34
35 $(OBJDIR)/bootrom.o: bootrom.c $(INCLUDES)
36 @echo $(@B).c
37 @$(CC) $(CFLAGS) -mthumb -mthumb-interwork bootrom.c -o $(OBJDIR)/bootrom.o
38
39 $(OBJDIR)/fromflash.o: fromflash.c $(INCLUDES)
40 @echo $(@B).c
41 @$(CC) $(CFLAGS) -mthumb -mthumb-interwork fromflash.c -o $(OBJDIR)/fromflash.o
42
43 $(OBJDIR)/usb.o: ../common/usb.c $(INCLUDES)
44 @echo $(@B).c
45 @$(CC) $(CFLAGS) -mthumb -mthumb-interwork ../common/usb.c -o $(OBJDIR)/usb.o
46
47 $(OBJDIR)/ram-reset.o: ram-reset.s
48 @echo $(@B).s
49 @$(CC) $(CFLAGS) -mthumb-interwork -o $(OBJDIR)/ram-reset.o ram-reset.s
50
51 $(OBJDIR)/flash-reset.o: flash-reset.s
52 @echo $(@B).s
53 @$(CC) $(CFLAGS) -mthumb-interwork -o $(OBJDIR)/flash-reset.o flash-reset.s
54
55 clean:
56 del /q obj\*.o
57 del /q obj\*.elf
58 del /q obj\*.s19
Impressum, Datenschutz