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