]> git.zerfleddert.de Git - proxmark3-svn/blob - armsrc/Makefile
b7b4d71007d24aad47b5c937a1a41f1ba6bfc905
[proxmark3-svn] / armsrc / Makefile
1 PATH=..\..\devkitARM\bin;%PATH%
2 CC = arm-elf-gcc
3 AS = arm-elf-as
4 LD = arm-elf-ld
5 OBJCOPY = arm-elf-objcopy
6
7 OBJDIR = obj
8
9 INCLUDE = -I../include
10
11 INCLUDES = ../include/proxmark3.h ../include/at91sam7s128.h ../include/config_gpio.h ../include/usb_cmd.h apps.h
12 LIB = "..\..\devkitARM\lib\gcc\arm-elf\4.1.0\interwork"
13
14 # Add the "-DWITH_LCD" flag in CLFAGS to add support for LCD
15 # and add OBJLCD to OBJ too
16 CFLAGS = -O6 -c $(INCLUDE) -Wall
17
18 OBJLCD = $(OBJDIR)/fonts.o \
19 $(OBJDIR)/LCD.o
20
21 OBJ = $(OBJDIR)/start.o \
22 $(OBJDIR)/appmain.o \
23 $(OBJDIR)/fpga.o \
24 $(OBJDIR)/iso14443.o \
25 $(OBJDIR)/iso14443a.o \
26 $(OBJDIR)/iso15693.o \
27 $(OBJDIR)/util.o
28
29 OBJFPGA = \
30 $(OBJDIR)/fpgaimg.o
31
32 OBJCOMMON = \
33 $(OBJDIR)/usb.o
34
35 all: osimage.s19
36
37 $(OBJDIR)/fpgaimage.s19: $(OBJDIR)/fpgaimg.o
38 @echo obj/fpgaimage.s19
39 @$(LD) -g -Tldscript-fpga -o $(OBJDIR)\fpgaimage.elf $(OBJDIR)/fpgaimg.o
40 @$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)\fpgaimage.elf $(OBJDIR)\fpgaimage.s19
41
42 $(OBJDIR)/osimage.s19: $(OBJ) $(OBJCOMMON)
43 @echo obj/osimage.s19
44 @$(LD) -g -Tldscript -o $(OBJDIR)\osimage.elf $(OBJ) $(OBJCOMMON) $(LIB)\libgcc.a
45 @$(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)\osimage.elf $(OBJDIR)\osimage.s19
46
47 osimage.s19: $(OBJDIR)/osimage.s19 $(OBJDIR)/fpgaimage.s19
48 @echo osimage.s19
49
50 $(OBJ): $(@B).c $(INCLUDES)
51 @echo $(@B).c
52 @$(CC) $(CFLAGS) -mthumb -mthumb-interwork $(@B).c -o $(OBJDIR)/$(@B).o
53
54 $(OBJCOMMON): ../common/$(@B).c $(INCLUDES)
55 @echo $(@B).c
56 @$(CC) $(CFLAGS) -mthumb -mthumb-interwork ../common/$(@B).c -o $(OBJDIR)/$(@B).o
57
58 $(OBJFPGA): $(@B).c $(INCLUDES)
59 @echo $(@B).c
60 @$(CC) $(CFLAGS) -mthumb -mthumb-interwork $(@B).c -o $(OBJDIR)/$(@B).o
61
62 clean:
63 del /q obj\*.o
64 del /q obj\*.elf
65 del /q obj\*.s19
Impressum, Datenschutz