mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-14 02:26:59 -07:00
Compress the .data section as well (saves another 4KBytes and comes for free)
zlib tuning: prevent fpga_compress from generating fixed code blocks armsrc/Makefile: replace osimage with fullimage
This commit is contained in:
parent
28b9faccea
commit
0fa01ec7da
7 changed files with 103 additions and 22 deletions
|
@ -15,7 +15,7 @@ OBJDIR = obj
|
|||
LDLIBS = -L/opt/local/lib -L/usr/local/lib -lreadline -lpthread -lm
|
||||
LUALIB = ../liblua/liblua.a
|
||||
LDFLAGS = $(COMMON_FLAGS)
|
||||
CFLAGS = -std=c99 -I. -I../include -I../common -I../zlib -I/opt/local/include -I../liblua -Wall $(COMMON_FLAGS) -DZ_SOLO -DZ_PREFIX -DNO_GZIP -g -O4
|
||||
CFLAGS = -std=c99 -I. -I../include -I../common -I../zlib -I/opt/local/include -I../liblua -Wall $(COMMON_FLAGS) -g -O4
|
||||
LUAPLATFORM = generic
|
||||
|
||||
ifneq (,$(findstring MINGW,$(platform)))
|
||||
|
@ -43,7 +43,6 @@ else
|
|||
LUAPLATFORM = linux
|
||||
endif
|
||||
|
||||
|
||||
ifneq ($(QTLDLIBS),)
|
||||
QTGUI = $(OBJDIR)/proxgui.o $(OBJDIR)/proxguiqt.o $(OBJDIR)/proxguiqt.moc.o
|
||||
CFLAGS += -DHAVE_GUI
|
||||
|
@ -105,6 +104,8 @@ CMDSRCS = nonce2key/crapto1.c\
|
|||
protocols.c\
|
||||
|
||||
ZLIBSRCS = deflate.c adler32.c trees.c zutil.c
|
||||
ZLIB_FLAGS = -DZ_SOLO -DZ_PREFIX -DNO_GZIP -DZLIB_PM3_TUNED
|
||||
|
||||
|
||||
COREOBJS = $(CORESRCS:%.c=$(OBJDIR)/%.o)
|
||||
CMDOBJS = $(CMDSRCS:%.c=$(OBJDIR)/%.o)
|
||||
|
@ -133,10 +134,10 @@ flasher: $(OBJDIR)/flash.o $(OBJDIR)/flasher.o $(COREOBJS)
|
|||
$(CXX) $(CXXFLAGS) $^ $(LDLIBS) -o $@
|
||||
|
||||
fpga_compress: $(OBJDIR)/fpga_compress.o $(ZLIBOBJS)
|
||||
$(CXX) $(CXXFLAGS) $^ $(LDLIBS) -o $@
|
||||
$(CXX) $(CXXFLAGS) $(ZLIB_FLAGS) $^ $(LDLIBS) -o $@
|
||||
|
||||
$(OBJDIR)/%.o: %.c
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
$(CC) $(CFLAGS) $(ZLIB_FLAGS) -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o: %.cpp
|
||||
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
||||
|
|
|
@ -85,7 +85,11 @@ int zlib_compress(FILE *infile[], uint8_t num_infiles, FILE *outfile)
|
|||
for(uint16_t j = 0; j < num_infiles; j++) {
|
||||
for(uint16_t k = 0; k < FPGA_INTERLEAVE_SIZE; k++) {
|
||||
c = fgetc(infile[j]);
|
||||
if (!feof(infile[j])) fpga_config[i++] = c; else fpga_config[i++] = '\0';
|
||||
if (!feof(infile[j])) {
|
||||
fpga_config[i++] = c;
|
||||
} else if (num_infiles > 1) {
|
||||
fpga_config[i++] = '\0';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue