cbfstool: Update LZMA encoder to LZMA SDK 9.12
This removes almost all C++ code (except the wrapper)
Change-Id: I0f84070e3b6dc57c98d49a53150a140479b3221f
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1799
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
diff --git a/util/cbfstool/Makefile b/util/cbfstool/Makefile
index 813ba1b..17b00a7 100644
--- a/util/cbfstool/Makefile
+++ b/util/cbfstool/Makefile
@@ -3,16 +3,15 @@
HOSTCXX ?= g++
HOSTCC ?= gcc
CFLAGS ?= -g -Wall
-CXXFLAGS +=-DCOMPACT $(CFLAGS)
-LDFLAGS ?= -g
+CFLAGS += -D_7ZIP_ST
BINARY:=$(obj)/cbfstool
-COMMON:=common.o compress.o minilzma.o
-COMMON+=LZMAEncoder.o LZInWindow.o
-COMMON+=RangeCoderBit.o StreamUtils.o
-COMMON+=OutBuffer.o Alloc.o CRC.o
-COMMON+=cbfs-mkstage.o cbfs-mkpayload.o cbfstool.o
+COMMON:=cbfstool.o common.o compress.o
+COMMON+=cbfs-mkstage.o cbfs-mkpayload.o
+# LZMA
+COMMON+=lzma/lzma.o
+COMMON+=lzma/C/LzFind.o lzma/C/LzmaDec.o lzma/C/LzmaEnc.o
COMMON:=$(addprefix $(obj)/,$(COMMON))
@@ -21,23 +20,8 @@
$(obj)/%.o: %.c
$(HOSTCC) $(CFLAGS) -c -o $@ $<
-$(obj)/%.o: lzma/%.cc
- $(HOSTCXX) $(CXXFLAGS) -c -o $@ $<
-
-$(obj)/%.o: lzma/C/7zip/Compress/LZMA/%.cpp
- $(HOSTCXX) $(CXXFLAGS) -c -o $@ $<
-
-$(obj)/%.o: lzma/C/7zip/Compress/LZ/%.cpp
- $(HOSTCXX) $(CXXFLAGS) -c -o $@ $<
-
-$(obj)/%.o: lzma/C/7zip/Compress/RangeCoder/%.cpp
- $(HOSTCXX) $(CXXFLAGS) -c -o $@ $<
-
-$(obj)/%.o: lzma/C/7zip/Common/%.cpp
- $(HOSTCXX) $(CXXFLAGS) -c -o $@ $<
-
-$(obj)/%.o: lzma/C/Common/%.cpp
- $(HOSTCXX) $(CXXFLAGS) -c -o $@ $<
+$(obj)/%.o: %.cc
+ $(HOSTCXX) $(CFLAGS) -c -o $@ $<
clean:
rm -f $(COMMON) $(BINARY)
@@ -46,14 +30,11 @@
ctags *.[ch]
$(obj)/cbfstool:$(COMMON)
- $(HOSTCXX) $(LDFLAGS) -o $@ $^
+ $(HOSTCXX) $(CFLAGS) -o $@ $^
dep:
@$(HOSTCC) $(CFLAGS) -MM *.c > .dependencies
- @$(HOSTCC) $(CFLAGS) -MM lzma/C/7zip/Decompress/*.c >> .dependencies
- @$(HOSTCXX) $(CXXFLAGS) -MM lzma/C/7zip/Compress/*/*.cpp >> .dependencies
- @$(HOSTCXX) $(CXXFLAGS) -MM lzma/C/7zip/Common/*.cpp >> .dependencies
- @$(HOSTCXX) $(CXXFLAGS) -MM lzma/C/Common/*.cpp >> .dependencies
- @$(HOSTCXX) $(CXXFLAGS) -MM lzma/*.cc >> .dependencies
+ @$(HOSTCC) $(CFLAGS) -MM lzma/*.cc >> .dependencies
+ @$(HOSTCC) $(CFLAGS) -MM lzma/C/*.c >> .dependencies
-include .dependencies