]> cvs.zerfleddert.de Git - proxmark3-svn/blob - bootrom/Makefile
652e0ae2587a7fe2a4434fe4a960704f79a0b468
[proxmark3-svn] / bootrom / Makefile
1 # Makefile for bootrom, see ../common/Makefile.common for common settings
2 include ../common/Makefile.common
3
4 OBJJTAG = $(OBJDIR)/bootrom.o $(OBJDIR)/ram-reset.o $(OBJDIR)/usb.o
5 OBJFLASH = $(OBJDIR)/flash-reset.o $(OBJDIR)/fromflash.o
6
7 THUMBSRC = usb.c fromflash.c bootrom.c
8 ASMSRC = ram-reset.s flash-reset.s
9
10 THUMBOBJ = $(patsubst %.c,$(OBJDIR)/%.o,$(THUMBSRC))
11 ASMOBJ = $(patsubst %.s,$(OBJDIR)/%.o,$(ASMSRC))
12
13 all: bootrom-merged.s19
14
15 bootrom-merged.s19: $(OBJDIR)/bootrom.s19 $(OBJDIR)/bootrom-forjtag.s19
16 perl ../tools/merge-srec.pl $(OBJDIR)/bootrom.s19 $(OBJDIR)/bootrom-forjtag.s19 > bootrom-merged.s19
17
18 $(OBJDIR)/bootrom.elf: $(OBJFLASH)
19 $(LD) -g -Tldscript-flash --oformat elf32-littlearm -Map=$(patsubst %.elf,%.map,$@) -o $@ $^
20
21 $(OBJDIR)/bootrom-forjtag.elf: $(OBJJTAG)
22 $(LD) -g -Tldscript-ram-jtag --oformat elf32-littlearm -Map=$(patsubst %.elf,%.map,$@) -o $@ $^
23
24 $(OBJDIR)/%.s19: $(OBJDIR)/%.elf
25 $(OBJCOPY) -Osrec --srec-forceS3 $^ $@
26
27 $(THUMBOBJ): $(OBJDIR)/%.o: %.c $(INCLUDES)
28 $(CC) $(CFLAGS) -mthumb -mthumb-interwork -o $@ $<
29
30 $(ASMOBJ): $(OBJDIR)/%.o: %.s
31 $(CC) $(CFLAGS) -mthumb-interwork -o $@ $<
32
33 clean:
34 $(DELETE) $(OBJDIR)$(PATHSEP)*.o
35 $(DELETE) $(OBJDIR)$(PATHSEP)*.elf
36 $(DELETE) $(OBJDIR)$(PATHSEP)*.s19
37 $(DELETE) $(OBJDIR)$(PATHSEP)*.map
38 $(DELETE) bootrom-merged.s19
39
40 .PHONY: all clean help
41 help:
42 @echo Multi-OS Makefile, you are running on $(DETECTED_OS)
43 @echo Possible targets:
44 @echo + all - Make bootrom-merged.s19, the main bootrom
45 @echo + clean - Clean $(OBJDIR)
Impressum, Datenschutz