]> git.zerfleddert.de Git - proxmark3-svn/blame_incremental - armsrc/Makefile.linux
update arm toolchain installer for linux and make it a little more user friendly
[proxmark3-svn] / armsrc / Makefile.linux
... / ...
CommitLineData
1# This makefile needs to be edited to reflect the location
2# of your own arm-elf-gcc toolchain (ARMLIB variable)
3
4CC = arm-elf-gcc
5AS = arm-elf-as
6LD = arm-elf-ld
7OBJCOPY = arm-elf-objcopy
8
9# Indicate where your gnuarm toolchain libgcc.a interworking library is located
10# or set $ARMLIB in your environment:
11#ARMLIB = /usr/local/lib/gcc/arm-elf/4.3.3/interwork
12
13
14# Add -DWITH_LCD to EXTRA_CFLAGS if you want support for LCD
15# in your firmware (add OBJLCD to OBJ too!)
16#EXTRA_CFLAGS = -DWITH_LCD
17EXTRA_CFLAGS =
18
19### You should not need to edit below this line
20
21INCLUDE = -I../include
22INCLUDES = ../include/proxmark3.h ../include/at91sam7s128.h ../include/config_gpio.h ../include/usb_cmd.h apps.h
23CFLAGS_COMMON = -O6 -c $(INCLUDE) -Wall -mthumb-interwork
24CFLAGS = $(CFLAGS_COMMON) $(EXTRA_CFLAGS) -mthumb
25
26
27OBJDIR = obj
28
29OBJLCD = $(OBJDIR)/LCD.o\
30 $(OBJDIR)/fonts.o
31
32OBJ = $(OBJDIR)/start.o \
33 $(OBJDIR)/appmain.o \
34 $(OBJDIR)/fpga.o \
35 $(OBJDIR)/iso15693.o \
36 $(OBJDIR)/util.o
37
38# To be compiled in ARM mode, not thumb mode: larger but faster
39# Alleviates the 'blew circular buffer' issues somehow...
40OBJFAST = $(OBJDIR)/iso14443.o \
41 $(OBJDIR)/iso14443a.o
42
43OBJFPGA = $(OBJDIR)/fpgaimg.o
44
45OBJCOMMON = $(OBJDIR)/usb.o
46
47all: osimage.s19 fpgaimage.s19 fullimage.s19
48
49fpgaimage.s19: $(OBJFPGA)
50 @echo fpgaimage.s19
51 $(LD) -g -Tldscript-fpga -o $(OBJDIR)/fpgaimage.elf $^
52 $(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)/fpgaimage.elf fpgaimage.s19
53
54osimage.s19: $(OBJ) $(OBJFAST) $(OBJCOMMON)
55 @echo osimage.s19
56 $(LD) -g -Tldscript -o $(OBJDIR)/osimage.elf $^ $(ARMLIB)/libgcc.a
57 $(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)/osimage.elf osimage.s19
58
59fullimage.s19: $(OBJ) $(OBJFAST) $(OBJCOMMON) $(OBJFAST) $(OBJFPGA)
60 @echo fullimage.s19
61 $(LD) -g -Tldscript-full -o $(OBJDIR)/fullimage.elf $^ $(ARMLIB)/libgcc.a
62 $(OBJCOPY) -Osrec --srec-forceS3 $(OBJDIR)/fullimage.elf fullimage.s19
63
64# Directives to put the *.o in the OBJDIR directory:
65$(OBJ): $(OBJDIR)/%.o : %.c
66 $(CC) $(CFLAGS) $< -o $@
67
68$(OBJFPGA): $(OBJDIR)/%.o : %.c
69 $(CC) $(CFLAGS) $< -o $@
70
71$(OBJFAST): $(OBJDIR)/%.o : %.c
72 $(CC) $(CFLAGS_COMMON) $< -o $@
73
74$(OBJCOMMON): $(OBJDIR)/%.o : ../common/%.c
75 $(CC) $(CFLAGS) $< -o $@
76
77# Those do not work on the current firmware !
78flash-fpga: fpgaimage.s19
79 ../linux/flasher fpga fpgaimage.s19
80
81flash: osimage.s19
82 ../linux/flasher os osimage.s19
83
84jtag-flash-full: fullimage.s19
85 ../../OpenOCD/openocd -c "halt; flash write_image fullimage.s19 0x00100000; halt; reset; resume; poll; exit"
86
87jtag-flash-fpga: fpgaimage.s19
88 ../../OpenOCD/openocd -c "halt; flash write_image fpgaimage.s19 0x00100000; halt; reset; resume; poll; exit"
89
90jtag-flash: osimage.s19
91 ../../OpenOCD/openocd -c "halt; flash write_image osimage.s19 0x00100000; halt; reset; resume; poll; exit"
92
93clean:
94 rm -f $(OBJDIR)/*.o $(OBJDIR)/*.elf *.s19
95
96.PHONY: all clean
Impressum, Datenschutz