summaryrefslogtreecommitdiff
path: root/util/cbfstool
diff options
context:
space:
mode:
authorPatrick Georgi <patrick.georgi@coresystems.de>2009-08-12 15:00:51 +0000
committerRonald G. Minnich <rminnich@gmail.com>2009-08-12 15:00:51 +0000
commit0588d19abef62dad63a7794a37bdd6a71c526d9e (patch)
tree1c507caa1ffed6ceb73d3e13fc9b766a713d16e2 /util/cbfstool
parent38cd29ebd7282333650cf11ed50c7f2fd4031e80 (diff)
downloadcoreboot-0588d19abef62dad63a7794a37bdd6a71c526d9e.tar.xz
Kconfig!
Works on Kontron, qemu, and serengeti. Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> tested on abuild only. Acked-by: Ronald G. Minnich <rminnich@gmail.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4534 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/cbfstool')
-rw-r--r--util/cbfstool/Makefile.inc39
-rw-r--r--util/cbfstool/tools/Makefile.inc23
-rw-r--r--util/cbfstool/tools/lzma/Makefile.inc60
3 files changed, 122 insertions, 0 deletions
diff --git a/util/cbfstool/Makefile.inc b/util/cbfstool/Makefile.inc
new file mode 100644
index 0000000000..3350646a4a
--- /dev/null
+++ b/util/cbfstool/Makefile.inc
@@ -0,0 +1,39 @@
+#
+#
+#
+
+ifdef POST_EVALUATION
+
+cbfsobj :=
+# commands
+cbfsobj += create.o
+cbfsobj += bootblock.o
+cbfsobj += delete.o
+cbfsobj += extract.o
+cbfsobj += add.o
+cbfsobj += print.o
+cbfsobj += resize.o
+# main tool
+cbfsobj += cbfstool.o
+cbfsobj += util.o
+cbfsobj += fs.o
+
+cbfsinc := cbfstool.h cbfs.h
+
+$(obj)/util/cbfstool:
+ $(Q)mkdir -p $@
+ $(Q)mkdir -p $@/tools/lzma
+
+$(obj)/util/cbfstool/%.o: $(top)/util/cbfstool/%.c
+ $(Q)printf " HOSTCC $(subst $(obj)/,,$(@))\n"
+ $(Q)$(HOSTCC) $(HOSTCFLAGS) -c -o $@ $<
+
+$(obj)/util/cbfstool/cbfstool: $(obj)/util/cbfstool $(obj)/util/cbfstool/tools/cbfs-mkpayload $(obj)/util/cbfstool/tools/cbfs-mkstage $(addprefix $(obj)/util/cbfstool/,$(cbfsobj))
+ $(Q)printf " HOSTCC $(subst $(obj)/,,$(@)) (link)\n"
+ $(Q)$(HOSTCC) -o $@ $(addprefix $(obj)/util/cbfstool/,$(cbfsobj))
+
+endif
+
+include $(top)/util/cbfstool/tools/Makefile.inc
+
+
diff --git a/util/cbfstool/tools/Makefile.inc b/util/cbfstool/tools/Makefile.inc
new file mode 100644
index 0000000000..4aed0c4888
--- /dev/null
+++ b/util/cbfstool/tools/Makefile.inc
@@ -0,0 +1,23 @@
+
+tobj ?= $(obj)/util/cbfstool/tools
+tsrc ?= $(top)/util/cbfstool/tools
+
+include $(tsrc)/lzma/Makefile.inc
+
+COMMON = common.o compress.o $(LZMA_OBJ)
+
+ifdef POST_EVALUATION
+
+$(tobj)/cbfs-mkstage: $(tobj)/cbfs-mkstage.o $(patsubst %,$(tobj)/%,$(COMMON))
+ $(Q)printf " HOSTCXX $(subst $(obj)/,,$(@)) (link)\n"
+ $(Q)$(HOSTCXX) $(HOSTCXXFLAGS) -o $@ $^
+
+$(tobj)/cbfs-mkpayload: $(tobj)/cbfs-mkpayload.o $(patsubst %,$(tobj)/%,$(COMMON))
+ $(Q)printf " HOSTCXX $(subst $(obj)/,,$(@)) (link)\n"
+ $(Q)$(HOSTCXX) $(HOSTCFLAGS) -o $@ $^
+
+$(tobj)/%.o: $(tsrc)/%.c
+ $(Q)printf " HOSTCC $(subst $(obj)/,,$(@))\n"
+ $(Q)$(HOSTCC) $(HOSTCFLAGS) -c -o $@ $<
+
+endif
diff --git a/util/cbfstool/tools/lzma/Makefile.inc b/util/cbfstool/tools/lzma/Makefile.inc
new file mode 100644
index 0000000000..1a0d276487
--- /dev/null
+++ b/util/cbfstool/tools/lzma/Makefile.inc
@@ -0,0 +1,60 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2007 coresystems GmbH
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+##
+
+LZMA_OBJ := lzma/LZMAEncoder.o lzma/LZInWindow.o
+LZMA_OBJ += lzma/RangeCoderBit.o lzma/StreamUtils.o
+LZMA_OBJ += lzma/OutBuffer.o lzma/Alloc.o
+LZMA_OBJ += lzma/CRC.o
+LZMA_OBJ += lzma/lzma-compress.o
+
+ifdef POST_EVALUATION
+$(tobj)/lzma/lzma-compress.o: $(tsrc)/lzma/minilzma.cc
+ $(Q)printf " HOSTCXX $(subst $(obj)/,,$(@))\n"
+ $(Q)$(HOSTCXX) $(HOSTCXXFLAGS) -o $@ -c -DCOMPACT $<
+
+$(tobj)/lzma/%.o: $(tsrc)/lzma/C/7zip/Compress/LZMA/%.cpp
+ $(Q)printf " HOSTCXX $(subst $(obj)/,,$(@))\n"
+ $(Q)$(HOSTCXX) $(HOSTCXXFLAGS) -o $@ -c $<
+
+$(tobj)/lzma/%.o: $(tsrc)/lzma/C/7zip/Compress/LZ/%.cpp
+ $(Q)printf " HOSTCXX $(subst $(obj)/,,$(@))\n"
+ $(Q)$(HOSTCXX) $(HOSTCXXFLAGS) -o $@ -c $<
+
+$(tobj)/lzma/%.o: $(tsrc)/lzma/C/7zip/Compress/RangeCoder/%.cpp
+ $(Q)printf " HOSTCXX $(subst $(obj)/,,$(@))\n"
+ $(Q)$(HOSTCXX) $(HOSTCXXFLAGS) -o $@ -c $<
+
+$(tobj)/lzma/%.o: $(tsrc)/lzma/C/7zip/Decompress/%.cpp
+ $(Q)printf " HOSTCXX $(subst $(obj)/,,$(@))\n"
+ $(Q)$(HOSTCXX) $(HOSTCXXFLAGS) -o $@ -c $<
+
+$(tobj)/lzma/%.o: $(tsrc)/lzma/C/7zip/Common/%.cpp
+ $(Q)printf " HOSTCXX $(subst $(obj)/,,$(@))\n"
+ $(Q)$(HOSTCXX) $(HOSTCXXFLAGS) -o $@ -c $<
+
+$(tobj)/lzma/%.o: $(tsrc)/lzma/C/Common/%.cpp
+ $(Q)printf " HOSTCXX $(subst $(obj)/,,$(@))\n"
+ $(Q)$(HOSTCXX) $(HOSTCXXFLAGS) -o $@ -c $<
+
+$(tobj)/lzma/%.o: $(tsrc)/lzma/%.cc
+ $(Q)printf " HOSTCXX $(subst $(obj)/,,$(@))\n"
+ $(Q)$(HOSTCXX) $(HOSTCXXFLAGS) -o $@ -c $<
+
+endif