summaryrefslogtreecommitdiff
path: root/util/cbfstool/Makefile
diff options
context:
space:
mode:
authorPatrick Georgi <patrick.georgi@coresystems.de>2009-09-14 13:29:27 +0000
committerPatrick Georgi <patrick.georgi@coresystems.de>2009-09-14 13:29:27 +0000
commitb7b56dd8fbe123958e196f396dab5ff3000b68dd (patch)
tree19972cda7bd87504eeea26ed90535e4aa7585da4 /util/cbfstool/Makefile
parentc8d4a05f8f5df06bd98f8ee7d5ef46e61986e6b0 (diff)
New cbfstool. Works without mmap or fork/exec and
supports fixed location files. Some parts are salvaged from the pre-commit version (esp. stage and payload creation), others are completely rewritten (eg. the main loop that handles file addition) Also adapt newconfig (we don't need cbfs/tools anymore) and fix some minor issues in the cbfstool-README. Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4630 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/cbfstool/Makefile')
-rw-r--r--util/cbfstool/Makefile63
1 files changed, 36 insertions, 27 deletions
diff --git a/util/cbfstool/Makefile b/util/cbfstool/Makefile
index 50f97961bc..51b6bad9c1 100644
--- a/util/cbfstool/Makefile
+++ b/util/cbfstool/Makefile
@@ -1,42 +1,51 @@
-#
-#
-#
-
obj ?= $(shell pwd)
-COMMANDS=create.o bootblock.o delete.o extract.o add.o print.o resize.o
-OBJ=$(COMMANDS) cbfstool.o util.o fs.o
-INC=cbfstool.h cbfs.h
-
-HOSTCC ?= gcc
HOSTCXX ?= g++
+HOSTCC ?= gcc
+
+BINARY:=$(obj)/cbfstool
-CFLAGS=-g -Wall -W -Werror
+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
-DESTDIR ?= /usr/local/bin
+COMMON:=$(addprefix $(obj)/,$(COMMON))
-all: $(obj)/cbfstool $(obj)/tools/cbfs-mkpayload $(obj)/tools/cbfs-mkstage
+$(obj)/%.o: %.c
+ $(HOSTCC) $(CFLAGS) -c -o $@ $<
-$(obj)/cbfstool: $(patsubst %,$(obj)/%,$(OBJ))
- $(HOSTCC) -o $@ $(patsubst %,$(obj)/%,$(OBJ))
+$(obj)/%.o: lzma/%.cc
+ $(HOSTCXX) $(CXXFLAGS) -c -o $@ $<
-tobj = $(obj)/tools
-tsrc = $(shell pwd)/tools
+$(obj)/%.o: lzma/C/7zip/Compress/LZMA/%.cpp
+ $(HOSTCXX) $(CXXFLAGS) -c -o $@ $<
-include $(tsrc)/Makefile
+$(obj)/%.o: lzma/C/7zip/Compress/LZ/%.cpp
+ $(HOSTCXX) $(CXXFLAGS) -c -o $@ $<
-$(obj)/%.o: %.c $(INC)
- $(HOSTCC) $(CFLAGS) -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)
-install: $(obj)/cbfstool $(obj)/tools/cbfs-mkpayload $(obj)/tools/cbfs-mkstage
- @ install -d $(DESTDIR)
- @ install -m 0755 $(obj)/cbfstool $(DESTDIR)/cbfstool
- @ install -m 0755 $(obj)/tools/cbfs-mkstage $(DESTDIR)/cbfs-mkstage
- @ install -m 0755 $(obj)/tools/cbfs-mkpayload $(DESTDIR)/cbfs-mkpayload
+clean:
+ rm -f $(COMMON) $(BINARY)
tags:
- ctags *.[ch] */*.[ch]
+ ctags *.[ch]
-clean: tools-clean
- rm -f $(patsubst %,$(obj)/%,$(OBJ)) $(obj)/cbfstool
+CXXFLAGS=-DCOMPACT -m32
+CFLAGS=-m32
+LDFLAGS=-m32
+$(obj)/cbfstool:$(COMMON)
+ $(HOSTCXX) $(LDFLAGS) -o $@ $^
+ strip $@