]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
Added a gnu make compatible Makefile to armsrc for compiling on Linux
authoredouard@lafargue.name <edouard@lafargue.name@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Tue, 21 Apr 2009 17:24:42 +0000 (17:24 +0000)
committeredouard@lafargue.name <edouard@lafargue.name@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Tue, 21 Apr 2009 17:24:42 +0000 (17:24 +0000)
armsrc/Makefile.linux [new file with mode: 0644]
armsrc/ldscript-full [new file with mode: 0644]

diff --git a/armsrc/Makefile.linux b/armsrc/Makefile.linux
new file mode 100644 (file)
index 0000000..0f2d0d4
--- /dev/null
@@ -0,0 +1,83 @@
+# This makefile needs to be edited to reflect the location
+# of your own arm-elf-gcc installation (LIB variable)
+
+CC     = arm-elf-gcc
+AS     = arm-elf-as
+LD     = arm-elf-ld
+OBJCOPY = arm-elf-objcopy
+
+INCLUDE = -I../include
+
+INCLUDES = ../include/proxmark3.h ../include/at91sam7s128.h ../include/config_gpio.h ../include/usb_cmd.h apps.h
+LIB = /usr/local/new/gnuarm-4.3.0/lib/gcc/arm-elf/4.3.0/interwork
+
+CFLAGS_COMMON = -O6 -c $(INCLUDE) -Wall  -mthumb-interwork
+CFLAGS = $(CFLAGS_COMMON) -mthumb
+
+
+OBJDIR = obj
+OBJ =  start.o \
+               appmain.o \
+               fpga.o \
+               iso15693.o \
+               iso14443.o \
+               util.o\
+               LCD.o\
+               fonts.o
+
+OBJFAST =      iso14443a.o
+
+OBJFPGA =      fpgaimg.o
+
+OBJCOMMON =    usb.o
+
+
+all: osimage.s19 fpgaimage.s19 fullimage.s19
+
+fpgaimage.s19: $(OBJFPGA)
+       @echo fpgaimage.s19
+       $(LD) -g -Tldscript-fpga -o fpgaimage.elf $(patsubst %.o, obj/%.o, $^)
+       $(OBJCOPY) -Osrec --srec-forceS3 fpgaimage.elf fpgaimage.s19
+
+osimage.s19: $(OBJ) $(OBJFAST) $(OBJCOMMON)
+       @echo osimage.s19
+       $(LD) -g -Tldscript -o osimage.elf $(patsubst %.o, obj/%.o, $^) $(LIB)/libgcc.a
+       $(OBJCOPY) -Osrec --srec-forceS3 osimage.elf osimage.s19
+
+fullimage.s19: $(OBJ) $(OBJFAST) $(OBJCOMMON) $(OBJFAST) $(OBJFPGA)
+       @echo fullimage.s19
+       $(LD) -g -Tldscript-full -o fullimage.elf $(patsubst %.o, obj/%.o, $^)  $(LIB)/libgcc.a
+       $(OBJCOPY) -Osrec --srec-forceS3 fullimage.elf fullimage.s19
+
+$(OBJ): %.o : %.c
+       $(CC) $(CFLAGS) $< -o $(OBJDIR)/$@
+
+$(OBJFPGA): %.o : %.c
+       $(CC) $(CFLAGS) $< -o $(OBJDIR)/$@
+
+
+$(OBJFAST): %.o : %.c
+       $(CC) $(CFLAGS_COMMON) $< -o $(OBJDIR)/$@
+       
+$(OBJCOMMON): ../common/usb.c
+       $(CC) $(CFLAGS) ../common/usb.c -o $(OBJDIR)/usb.o
+
+flash-fpga: fpgaimage.s19
+       ../linux/flasher fpga fpgaimage.s19
+
+flash: osimage.s19
+       ../linux/flasher os osimage.s19
+
+jtag-flash-full: fullimage.s19
+       ../../OpenOCD/openocd -c "halt; flash write_image fullimage.s19 0x00100000; halt; reset; resume; poll; exit"
+
+jtag-flash-fpga: fpgaimage.s19
+       ../../OpenOCD/openocd -c "halt; flash write_image fpgaimage.s19 0x00100000; halt; reset; resume; poll; exit"
+
+jtag-flash: osimage.s19
+       ../../OpenOCD/openocd -c "halt; flash write_image osimage.s19 0x00100000; halt; reset; resume; poll; exit"
+
+clean:
+       rm -f $(OBJDIR)/*.o *.elf *.s19
+
+.PHONY: all clean
diff --git a/armsrc/ldscript-full b/armsrc/ldscript-full
new file mode 100644 (file)
index 0000000..712b485
--- /dev/null
@@ -0,0 +1,14 @@
+SECTIONS\r
+{\r
+       . = 0x00002000;\r
+       .fpga : { obj/fpgaimg.o(.rodata) }\r
+       . = 0x00010000;\r
+       .start : { obj/start.o(.text) }\r
+       .text : { *(.text) }\r
+       .rodata : { *(.rodata) }\r
+       . = 0x00200000;\r
+       .data : { *(.data) }\r
+       __bss_start__ = .;\r
+       .bss : { *(.bss) }\r
+       __bss_end__ = .;\r
+}\r
Impressum, Datenschutz