[coreboot] [v2] r4067 - in trunk/coreboot-v2/util: newconfig romtool romtool/tools romtool/tools/lzma

svn at coreboot.org svn at coreboot.org
Sat Apr 4 20:24:21 CEST 2009


Author: stepan
Date: 2009-04-04 20:24:21 +0200 (Sat, 04 Apr 2009)
New Revision: 4067

Modified:
   trunk/coreboot-v2/util/newconfig/config.g
   trunk/coreboot-v2/util/romtool/Makefile
   trunk/coreboot-v2/util/romtool/tools/Makefile
   trunk/coreboot-v2/util/romtool/tools/lzma/Makefile
Log:
build romtool in mainboard target directory.

Signed-off-by: Stefan Reinauer <stepan at coresystems.de>
Acked-by: Stefan Reinauer <stepan at coresystems.de>


Modified: trunk/coreboot-v2/util/newconfig/config.g
===================================================================
--- trunk/coreboot-v2/util/newconfig/config.g	2009-04-04 18:16:11 UTC (rev 4066)
+++ trunk/coreboot-v2/util/newconfig/config.g	2009-04-04 18:24:21 UTC (rev 4067)
@@ -2231,8 +2231,7 @@
 	file.write("\n\n")	
 
 	# romtool rules
-	file.write("\nromtool:\n\t$(MAKE) -C $(TOP)/util/romtool\n\tmkdir -p tools\n")
-	file.write("\tcp $(TOP)/util/romtool/tools/rom-mkpayload $(TOP)/util/romtool/tools/rom-mkstage tools\n\tcp $(TOP)/util/romtool/romtool romtool\n")
+	file.write("\nromtool:\n\tmkdir -p tools/lzma\n\t$(MAKE) -C $(TOP)/util/romtool obj=$(shell pwd)\n\n")
 
 	file.write("include Makefile.settings\n\n")
 	for i, o in romimages.items():

Modified: trunk/coreboot-v2/util/romtool/Makefile
===================================================================
--- trunk/coreboot-v2/util/romtool/Makefile	2009-04-04 18:16:11 UTC (rev 4066)
+++ trunk/coreboot-v2/util/romtool/Makefile	2009-04-04 18:24:21 UTC (rev 4067)
@@ -1,27 +1,38 @@
+#
+#
+#
+
+obj ?= $(shell pwd)
+
 COMMANDS=create.o bootblock.o delete.o add.o print.o resize.o
-OBJ= $(COMMANDS) romtool.o util.o fs.o
+OBJ=$(COMMANDS) romtool.o util.o fs.o
+
+CC=gcc
+CFLAGS=-g -Wall -W #-Werror
+
 H=romtool.h
-DESTDIR=/usr/local/bin
+DESTDIR ?= /usr/local/bin
 
-all: romtool tools/rom-mkpayload tools/rom-mkstage
+all: $(obj)/romtool $(obj)/tools/rom-mkpayload $(obj)/tools/rom-mkstage
 
-romtool: $(OBJ) 
-	$(CC) -o $@ $(OBJ)
+$(obj)/romtool: $(patsubst %,$(obj)/%,$(OBJ))
+	$(CC) -o $@ $(patsubst %,$(obj)/%,$(OBJ))
 
-tools/rom-mkpayload tools/rom-mkstage:
-	$(MAKE) -C tools/ $(patsubst tools/%, %, $@)
+$(obj)/tools/rom-mkpayload $(obj)/tools/rom-mkstage:
+	$(MAKE) -C tools/ obj=$(obj)/tools $(patsubst tools/%, %, $@)
 
-%.o: %.c
-	$(CC) -g -Wall -Werror -c -o $@ $<
+$(obj)/%.o: %.c
+	$(CC) $(CFLAGS) -c -o $@ $<
 
-install: romtool tools/rom-mkpayload tools/rom-mkstage
+install: $(obj)/romtool $(obj)/tools/rom-mkpayload $(obj)/tools/rom-mkstage
 	@ install -d $(DESTDIR)
-	@ install -m 0755 romtool $(DESTDIR)/romtool
-	@ install -m 0755 tools/rom-mkstage $(DESTDIR)/rom-mkstage
-	@ install -m 0755 tools/rom-mkpayload $(DESTDIR)/rom-mkpayload
+	@ install -m 0755 $(obj)/romtool $(DESTDIR)/romtool
+	@ install -m 0755 $(obj)/tools/rom-mkstage $(DESTDIR)/rom-mkstage
+	@ install -m 0755 $(obj)/tools/rom-mkpayload $(DESTDIR)/rom-mkpayload
 
 tags: 
 	ctags *.[ch] */*.[ch]
+
 clean:
 	$(MAKE) -C tools/ clean
-	rm -f *.o romtool
+	rm -f $(patsubst %,$(obj)/%,$(OBJ)) $(obj)/romtool

Modified: trunk/coreboot-v2/util/romtool/tools/Makefile
===================================================================
--- trunk/coreboot-v2/util/romtool/tools/Makefile	2009-04-04 18:16:11 UTC (rev 4066)
+++ trunk/coreboot-v2/util/romtool/tools/Makefile	2009-04-04 18:24:21 UTC (rev 4067)
@@ -1,27 +1,25 @@
+obj ?= $(shell pwd)
+
 CC=gcc
-CFLAGS=-Wall -Werror -g
+CFLAGS=-Wall -W -Werror -g
 
-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
+all: rom-mkstage rom-mkpayload
 
+include lzma/Makefile
+
 COMMON= common.o compress.o $(LZMA_OBJ)
 
-all: rom-mkstage rom-mkpayload
 
-rom-mkstage: rom-mkstage.o $(COMMON)
-	$(CXX) -g -o $@ rom-mkstage.o $(COMMON)
+$(obj)/rom-mkstage: $(obj)/rom-mkstage.o $(patsubst %,$(obj)/%,$(COMMON))
+	$(CXX) -g -o $@ $(obj)/rom-mkstage.o $(patsubst %,$(obj)/%,$(COMMON))
 
-rom-mkpayload: rom-mkpayload.o $(COMMON)
-	$(CXX) -o $@ rom-mkpayload.o $(COMMON)
+$(obj)/rom-mkpayload: $(obj)/rom-mkpayload.o $(patsubst %,$(obj)/%,$(COMMON))
+	$(CXX) -o $@ $(obj)/rom-mkpayload.o $(patsubst %,$(obj)/%,$(COMMON))
 
-include lzma/Makefile
-
-%.o: %.c
+$(obj)/%.o: %.c
 	$(CC) -Wall -Werror -g -c -o $@ $<
 
 clean:
 	@ rm -f rom-mkpayload.o rom-mkstage.o $(COMMON)
 	@ rm -f rom-mkpayload rom-mkstage
+

Modified: trunk/coreboot-v2/util/romtool/tools/lzma/Makefile
===================================================================
--- trunk/coreboot-v2/util/romtool/tools/lzma/Makefile	2009-04-04 18:16:11 UTC (rev 4066)
+++ trunk/coreboot-v2/util/romtool/tools/lzma/Makefile	2009-04-04 18:24:21 UTC (rev 4067)
@@ -24,27 +24,27 @@
 LZMA_OBJ += lzma/CRC.o
 LZMA_OBJ += lzma/lzma-compress.o
 
-lzma/lzma-compress.o: lzma/minilzma.cc
+$(obj)/lzma/lzma-compress.o: lzma/minilzma.cc
 	g++ -o $@ -c -DCOMPACT $<
 
-lzma/%.o: lzma/C/7zip/Compress/LZMA/%.cpp
+$(obj)/lzma/%.o: lzma/C/7zip/Compress/LZMA/%.cpp
 	g++ -o $@ -c $<
 
-lzma/%.o: lzma/C/7zip/Compress/LZ/%.cpp
+$(obj)/lzma/%.o: lzma/C/7zip/Compress/LZ/%.cpp
 	g++ -o $@ -c $<
 
-lzma/%.o: lzma/C/7zip/Compress/RangeCoder/%.cpp
+$(obj)/lzma/%.o: lzma/C/7zip/Compress/RangeCoder/%.cpp
 	g++ -o $@ -c $<
 
-lzma/%.o: lzma/C/7zip/Decompress/%.cpp
+$(obj)/lzma/%.o: lzma/C/7zip/Decompress/%.cpp
 	g++ -o $@ -c $<
 
-lzma/%.o: lzma/C/7zip/Common/%.cpp
+$(obj)/lzma/%.o: lzma/C/7zip/Common/%.cpp
 	g++ -o $@ -c $<
 
-lzma/%.o: lzma/C/Common/%.cpp
+$(obj)/lzma/%.o: lzma/C/Common/%.cpp
 	g++ -o $@ -c $<
 
-lzma/%.o: lzma/%.cc
+$(obj)/lzma/%.o: lzma/%.cc
 	g++ -o $@ -c $<
 





More information about the coreboot mailing list