]> cvs.zerfleddert.de Git - proxmark3-svn/blob - armsrc/Makefile
574e4f0813c2265b182022e5c82dbd0744d47e6b
[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 # Add the "-DWITH_LCD" flag in CLFAGS to add support for LCD
14 # and add OBJLCD to OBJ too
15 CFLAGS = -O6 -c $(INCLUDE) -Wall
16
17 OBJLCD = $(OBJDIR)/fonts.o \
18 $(OBJDIR)/LCD.o
19
20 OBJ = $(OBJDIR)/start.o \
21 $(OBJDIR)/appmain.o \
22 $(OBJDIR)/fpga.o \
23 $(OBJDIR)/iso14443.o \
24 $(OBJDIR)/iso14443a.o \
25 $(OBJDIR)/iso15693.o \
26 $(OBJDIR)/util.o
27
28 OBJFPGA = \
29 $(OBJDIR)/fpgaimg.o
30
31 OBJCOMMON = \
32 $(OBJDIR)/usb.o
33
34 all: osimage.s19
35
36 $(OBJDIR)/fpgaimage.s19: $(OBJDIR)/fpgaimg.o
37 @echo obj/fpgaimage.s19
38 @$(LD) -g -Tldscript-fpga -o $(OBJDIR)\fpgaimage.elf $(OBJDIR)/fpgaimg.o
39 @$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)\fpgaimage.elf $(OBJDIR)\fpgaimage.s19
40
41 $(OBJDIR)/osimage.s19: $(OBJ) $(OBJCOMMON)
42 @echo obj/osimage.s19
43 @$(LD) -g -Tldscript -o $(OBJDIR)\osimage.elf $(OBJ) $(OBJCOMMON) $(LIB)\libgcc.a
44 @$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)\osimage.elf $(OBJDIR)\osimage.s19
45
46 osimage.s19: $(OBJDIR)/osimage.s19 $(OBJDIR)/fpgaimage.s19
47 @echo osimage.s19
48
49 $(OBJ): $(@B).c $(INCLUDES)
50 @echo $(@B).c
51 @$(CC) $(CFLAGS) -mthumb -mthumb-interwork $(@B).c -o $(OBJDIR)/$(@B).o
52
53 $(OBJCOMMON): ../common/$(@B).c $(INCLUDES)
54 @echo $(@B).c
55 @$(CC) $(CFLAGS) -mthumb -mthumb-interwork ../common/$(@B).c -o $(OBJDIR)/$(@B).o
56
57 $(OBJFPGA): $(@B).c $(INCLUDES)
58 @echo $(@B).c
59 @$(CC) $(CFLAGS) -mthumb -mthumb-interwork $(@B).c -o $(OBJDIR)/$(@B).o
60
61 clean:
62 del /q obj\*.o
63 del /q obj\*.elf
64 del /q obj\*.s19
Impressum, Datenschutz