coreboot-kgpe-d16/util/cbfstool/Makefile
Stefan Reinauer 89ba15a0c1 chromeos: Fix compilation of coreboot-utils package
The ChromeOS build system provides a set of CXXFLAGS, however those do
not contain -DCOMPACT. This breaks the compilation of cbfstool in
coreboot-utils.

This fix overrides CXXFLAGS so that coreboot-utils compiles again.

Change-Id: If9495bdd815fe2cdaeba5386afa953558742467b
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/1038
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-05-24 22:22:12 +02:00

49 lines
1,013 B
Makefile

obj ?= $(shell pwd)
HOSTCXX ?= g++
HOSTCC ?= gcc
CFLAGS ?= -g -Wall
CXXFLAGS +=-DCOMPACT $(CFLAGS)
LDFLAGS ?= -g
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:=$(addprefix $(obj)/,$(COMMON))
$(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 $@ $<
all: $(BINARY)
clean:
rm -f $(COMMON) $(BINARY)
tags:
ctags *.[ch]
$(obj)/cbfstool:$(COMMON)
$(HOSTCXX) $(LDFLAGS) -o $@ $^