From: adam@algroup.co.uk Date: Sun, 9 May 2010 12:17:42 +0000 (+0000) Subject: create target for binary file archive (linux version) X-Git-Tag: v1.0.0~275 X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/bd8463861447640be1cbf93849e272031371a954 create target for binary file archive (linux version) --- diff --git a/Makefile b/Makefile index 3b01b886..4b1016c4 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ include common/Makefile.common +GZIP=gzip + all clean: %: bootrom/% armsrc/% client/% bootrom/%: FORCE @@ -41,5 +43,12 @@ flash-both: armsrc/obj/osimage.elf armsrc/obj/fpgaimage.elf $(FLASH_TOOL) flash-all: bootrom/obj/bootrom.elf armsrc/obj/osimage.elf armsrc/obj/fpgaimage.elf $(FLASH_TOOL) $(FLASH_TOOL) -b $(subst /,$(PATHSEP),$(filter-out $(FLASH_TOOL),$^)) +newtarbin: + $(DELETE) proxmark3-$(platform)-bin.tar proxmark3-$(platform)-bin.tar.gz + @touch proxmark3-$(platform)-bin.tar + +tarbin: newtarbin client/tarbin armsrc/tarbin bootrom/tarbin + $(GZIP) proxmark3-$(platform)-bin.tar + # Dummy target to test for GNU make availability _test: diff --git a/armsrc/Makefile b/armsrc/Makefile index 1c0088e2..bf13008a 100644 --- a/armsrc/Makefile +++ b/armsrc/Makefile @@ -44,7 +44,9 @@ APP_CFLAGS += -I. # Do not move this inclusion before the definition of {THUMB,ASM,ARM}SRC include ../common/Makefile.common -all: $(OBJDIR)/osimage.s19 $(OBJDIR)/fpgaimage.s19 +OBJS = $(OBJDIR)/osimage.s19 $(OBJDIR)/fpgaimage.s19 + +all: $(OBJS) $(OBJDIR)/fpga.o: fpga.bit $(OBJCOPY) -O elf32-littlearm -I binary -B arm --redefine-sym _binary____fpga_fpga_bit_start=_binary_fpga_bit_start --redefine-sym _binary____fpga_fpga_bit_end=_binary_fpga_bit_end --prefix-sections=fpga_bit $^ $@ @@ -58,6 +60,10 @@ $(OBJDIR)/fpgaimage.elf: $(OBJDIR)/fullimage.elf $(OBJDIR)/osimage.elf: $(OBJDIR)/fullimage.elf $(OBJCOPY) -F elf32-littlearm --remove-section .fpgaimage $^ $@ +tarbin: $(OBJS) + $(TAR) $(TARFLAGS) ../proxmark3-$(platform)-bin.tar $(OBJS:%=armsrc/%) $(OBJS:%.s19=armsrc/%.elf) + + clean: $(DELETE) $(OBJDIR)$(PATHSEP)*.o $(DELETE) $(OBJDIR)$(PATHSEP)*.elf diff --git a/bootrom/Makefile b/bootrom/Makefile index 0f661a8f..8029b6fc 100644 --- a/bootrom/Makefile +++ b/bootrom/Makefile @@ -24,7 +24,12 @@ APP_CFLAGS = -I. # Do not move this inclusion before the definition of {THUMB,ASM,ARM}SRC include ../common/Makefile.common -all: $(OBJDIR)/bootrom.s19 +OBJS = $(OBJDIR)/bootrom.s19 + +all: $(OBJS) + +tarbin: $(OBJS) + $(TAR) $(TARFLAGS) ../proxmark3-$(platform)-bin.tar $(OBJS:%=bootrom/%) $(OBJS:%.s19=bootrom/%.elf) $(OBJDIR)/bootrom.elf: $(VERSIONOBJ) $(ASMOBJ) $(ARMOBJ) $(THUMBOBJ) $(CC) $(LDFLAGS) -Wl,-T,ldscript-flash,-Map,$(patsubst %.elf,%.map,$@) -o $@ $^ $(LIBS) diff --git a/client/Makefile b/client/Makefile index 66986daf..368e2487 100644 --- a/client/Makefile +++ b/client/Makefile @@ -3,6 +3,8 @@ # at your option, any later version. See the LICENSE.txt file for the text of # the license. #----------------------------------------------------------------------------- +include ../common/Makefile.common + CC=gcc CXX=g++ #COMMON_FLAGS = -m32 @@ -14,8 +16,6 @@ LDLIBS = -L/opt/local/lib -L/usr/local/lib -lusb -lreadline -lpthread LDFLAGS = $(COMMON_FLAGS) CFLAGS = -std=gnu99 -I. -I../include -I../common -I/opt/local/include -Wall -Wno-unused-function $(COMMON_FLAGS) -g -O3 -platform = $(shell uname) - ifneq (,$(findstring MINGW,$(platform))) CXXFLAGS = -I$(QTDIR)/include -I$(QTDIR)/include/QtCore -I$(QTDIR)/include/QtGui QTLDLIBS = -L$(QTDIR)/lib -lQtCore4 -lQtGui4 @@ -95,6 +95,9 @@ proxguiqt.moc.cpp: proxguiqt.h clean: $(RM) $(CLEAN) +tarbin: $(BINS) + $(TAR) $(TARFLAGS) ../proxmark3-$(platform)-bin.tar $(BINS:%=client/%) + # must be run as root install_kext: Info.plist mkdir -p /System/Library/Extensions/Proxmark3.kext/Contents diff --git a/common/Makefile.common b/common/Makefile.common index 077fc282..0e3bdd1e 100644 --- a/common/Makefile.common +++ b/common/Makefile.common @@ -15,6 +15,9 @@ # Make sure that all is the default target # (The including Makefile still needs to define what 'all' is) + +platform = $(shell uname) + all: CROSS ?= arm-eabi- @@ -27,6 +30,9 @@ OBJDIR = obj INCLUDE = -I../include -I../common +TAR=tar +TARFLAGS = -C .. -rvf + # Windows' echo echos its input verbatim, on Posix there is some # amount of shell command line parsing going on. echo "" on # Windows yields literal "", on Linux yields an empty line