From baac49baf7a44835b984a3bc8b131115b7d83831 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Sat, 16 Jun 2007 17:07:24 +0000 Subject: [PATCH] in order to integrate compression into lar, it needs some makefile splits to keep the c++ compiler happy (lzma is c++ code and thus must be linked by a c++ compiler). The Makefiles are changed so lar is build with HOSTCC but linked with HOSTCXX (so the c++ library is picked up) Signed-off-by: PatrickGeorgi Acked-by: Stefan Reinauer git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@357 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- util/Makefile | 5 +++-- util/lar/Makefile | 22 +++++++++++++++------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/util/Makefile b/util/Makefile index 312eedb98b..4d614ac46d 100644 --- a/util/Makefile +++ b/util/Makefile @@ -19,10 +19,9 @@ ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ## -# This stuff is always needed. +# main utilities include util/dtc/Makefile include util/kconfig/Makefile -include util/lar/Makefile include util/options/Makefile # Parts used by LinuxBIOS. @@ -32,3 +31,5 @@ include util/x86emu/Makefile include util/lzma/Makefile include util/nrv2b/Makefile +# LinuxBIOS archiver +include util/lar/Makefile diff --git a/util/lar/Makefile b/util/lar/Makefile index 37e114a7d0..ef416ad7fb 100644 --- a/util/lar/Makefile +++ b/util/lar/Makefile @@ -18,25 +18,33 @@ ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA ## -LZMA_OBJ := $(obj)/util/lzma/LZMAEncoder.o $(obj)/util/lzma/LZInWindow.o -LZMA_OBJ += $(obj)/util/lzma/RangeCoderBit.o $(obj)/util/lzma/StreamUtils.o -LZMA_OBJ += $(obj)/util/lzma/OutBuffer.o $(obj)/util/lzma/Alloc.o -LZMA_OBJ += $(obj)/util/lzma/CRC.o +LAROBJ := lar.o create.o extract.o list.o lib.o bootblock.o -SOURCE := lar.c create.c extract.c list.c lib.c bootblock.c +LARDIR := lardir ifeq ($(CONFIG_COMPRESSION_LZMA),y) COMPRESSOR := $(LZMA_OBJ) $(obj)/util/lzma/lzma-compress.o +LARDIR += lzmadir endif ifeq ($(CONFIG_COMPRESSION_NRV2B),y) COMPRESSOR += $(obj)/util/nrv2b/nrv2b-compress.o +LARDIR += nrv2bdir endif -$(obj)/util/lar/lar: $(patsubst %,$(src)/util/lar/%,$(SOURCE)) $(COMPRESSOR) +LAROBJ_ABS := $(patsubst %,$(obj)/util/lar/%,$(LAROBJ)) + +lardir: + $(Q)printf " BUILD LAR\n" $(Q)mkdir -p $(obj)/util/lar + +$(obj)/util/lar/lar: $(CDIR) $(LAROBJ_ABS) $(COMPRESSOR) $(Q)printf " HOSTCXX $(subst $(shell pwd)/,,$(@))\n" - $(Q)$(HOSTCXX) $(HOSTCXXFLAGS) -o $@ $^ + $(Q)$(HOSTCXX) $(HOSTCXXFLAGS) -o $@ $(ABS_OBJ) $(COMPRESSOR) + +$(obj)/util/lar/%.o: $(src)/util/lar/%.c + $(Q)printf " HOSTCC $(subst $(shell pwd)/,,$(@))\n" + $(Q)$(HOSTCC) $(HOSTCFLAGS) -c $< -o $@ # -----------------------------------------------------------------------------