]> cvs.zerfleddert.de Git - proxmark3-svn/blob - armsrc/Makefile
Initial commit for the firmware. Used the 20090306_ela version as baseline.
[proxmark3-svn] / armsrc / 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 apps.h
11 LIB = "..\..\devkitARM\lib\gcc\arm-elf\4.1.0\interwork"
12
13 CFLAGS = -O6 -c $(INCLUDE) -Wall
14
15 OBJ = $(OBJDIR)/start.o \
16 $(OBJDIR)/appmain.o \
17 $(OBJDIR)/fpga.o \
18 $(OBJDIR)/iso14443.o \
19 $(OBJDIR)/iso14443a.o \
20 $(OBJDIR)/iso15693.o \
21 $(OBJDIR)/util.o \
22 $(OBJDIR)/fonts.o \
23 $(OBJDIR)/LCD.o
24
25 OBJFPGA = \
26 $(OBJDIR)/fpgaimg.o
27
28 OBJCOMMON = \
29 $(OBJDIR)/usb.o
30
31 all: osimage.s19
32
33 $(OBJDIR)/fpgaimage.s19: $(OBJDIR)/fpgaimg.o
34 @echo obj/fpgaimage.s19
35 @$(LD) -g -Tldscript-fpga -o $(OBJDIR)\fpgaimage.elf $(OBJDIR)/fpgaimg.o
36 @$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)\fpgaimage.elf $(OBJDIR)\fpgaimage.s19
37
38 $(OBJDIR)/osimage.s19: $(OBJ) $(OBJCOMMON)
39 @echo obj/osimage.s19
40 @$(LD) -g -Tldscript -o $(OBJDIR)\osimage.elf $(OBJ) $(OBJCOMMON) $(LIB)\libgcc.a
41 @$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)\osimage.elf $(OBJDIR)\osimage.s19
42
43 osimage.s19: $(OBJDIR)/osimage.s19 $(OBJDIR)/fpgaimage.s19
44 @echo osimage.s19
45
46 $(OBJ): $(@B).c $(INCLUDES)
47 @echo $(@B).c
48 @$(CC) $(CFLAGS) -mthumb -mthumb-interwork $(@B).c -o $(OBJDIR)/$(@B).o
49
50 $(OBJCOMMON): ../common/$(@B).c $(INCLUDES)
51 @echo $(@B).c
52 @$(CC) $(CFLAGS) -mthumb -mthumb-interwork ../common/$(@B).c -o $(OBJDIR)/$(@B).o
53
54 $(OBJFPGA): $(@B).c $(INCLUDES)
55 @echo $(@B).c
56 @$(CC) $(CFLAGS) -mthumb -mthumb-interwork $(@B).c -o $(OBJDIR)/$(@B).o
57
58 clean:
59 del /q obj\*.o
60 del /q obj\*.elf
61 del /q obj\*.s19
Impressum, Datenschutz