]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - armsrc/Makefile
also delete *.bin and fpga_compressor when "make clean".
[proxmark3-svn] / armsrc / Makefile
index b1ce4e4d707e66a2a3844cbb6d7012c1c468f07d..78d67934b1c2c9bd84915ef46ccdf69c083ca84b 100644 (file)
@@ -28,7 +28,7 @@ FPGA_BITSTREAMS = fpga_lf.bit fpga_hf.bit
 #the zlib source files required for decompressing the fpga config at run time
 SRC_ZLIB = inflate.c inffast.c inftrees.c adler32.c zutil.c
 #additional defines required to compile zlib
-ZLIB_CFLAGS = -DZ_SOLO -DZ_PREFIX -DNO_GZIP
+ZLIB_CFLAGS = -DZ_SOLO -DZ_PREFIX -DNO_GZIP -DZLIB_PM3_TUNED
 APP_CFLAGS += $(ZLIB_CFLAGS)
 # zlib includes:
 APP_CFLAGS += -I../zlib
@@ -65,7 +65,7 @@ ARMSRC = fpgaloader.c \
 # Do not move this inclusion before the definition of {THUMB,ASM,ARM}SRC
 include ../common/Makefile.common
 
-OBJS = $(OBJDIR)/osimage.s19 
+OBJS = $(OBJDIR)/fullimage.s19 
 FPGA_COMPRESSOR = ../client/fpga_compress
 
 all: $(OBJS)
@@ -76,9 +76,30 @@ $(OBJDIR)/fpga_all.o: $(OBJDIR)/fpga_all.bit.z
 $(OBJDIR)/fpga_all.bit.z: $(FPGA_BITSTREAMS) $(FPGA_COMPRESSOR)
        $(FPGA_COMPRESSOR) $(filter %.bit,$^) $@  
 
-$(OBJDIR)/fullimage.elf: $(VERSIONOBJ) $(OBJDIR)/fpga_all.o $(THUMBOBJ) $(ARMOBJ)
+$(FPGA_COMPRESSOR):
+               make -C ../client $(notdir $(FPGA_COMPRESSOR))
+               
+$(OBJDIR)/fullimage.stage1.elf: $(VERSIONOBJ) $(OBJDIR)/fpga_all.o $(THUMBOBJ) $(ARMOBJ)
        $(CC) $(LDFLAGS) -Wl,-T,ldscript,-Map,$(patsubst %.elf,%.map,$@) -o $@ $^ $(LIBS)
 
+$(OBJDIR)/fullimage.nodata.bin: $(OBJDIR)/fullimage.stage1.elf
+       $(OBJCOPY) -O binary -I elf32-littlearm --remove-section .data $^ $@
+       
+$(OBJDIR)/fullimage.nodata.o: $(OBJDIR)/fullimage.nodata.bin
+       $(OBJCOPY) -O elf32-littlearm -I binary -B arm --rename-section .data=stage1_image $^ $@
+
+$(OBJDIR)/fullimage.data.bin: $(OBJDIR)/fullimage.stage1.elf
+       $(OBJCOPY) -O binary -I elf32-littlearm --only-section .data $^ $@
+
+$(OBJDIR)/fullimage.data.bin.z: $(OBJDIR)/fullimage.data.bin $(FPGA_COMPRESSOR)
+       $(FPGA_COMPRESSOR) $(filter %.bin,$^) $@  
+       
+$(OBJDIR)/fullimage.data.o: $(OBJDIR)/fullimage.data.bin.z
+       $(OBJCOPY) -O elf32-littlearm -I binary -B arm --rename-section .data=compressed_data $^ $@
+
+$(OBJDIR)/fullimage.elf: $(OBJDIR)/fullimage.nodata.o $(OBJDIR)/fullimage.data.o
+       $(CC) $(LDFLAGS) -Wl,-T,ldscript,-Map,$(patsubst %.elf,%.map,$@) -o $@ $^
+       
 tarbin: $(OBJS)
        $(TAR) $(TARFLAGS) ../proxmark3-$(platform)-bin.tar $(OBJS:%=armsrc/%) $(OBJS:%.s19=armsrc/%.elf)
 
@@ -89,6 +110,7 @@ clean:
        $(DELETE) $(OBJDIR)$(PATHSEP)*.map
        $(DELETE) $(OBJDIR)$(PATHSEP)*.d
        $(DELETE) $(OBJDIR)$(PATHSEP)*.z
+       $(DELETE) $(OBJDIR)$(PATHSEP)*.bin
        $(DELETE) version.c
 
 .PHONY: all clean help
Impressum, Datenschutz