From 14ad50edf6aeeff019cb3f446a8677c6eb98756c Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Sat, 4 Apr 2009 22:18:26 +0000 Subject: This fixes a race condition (revealed by my other check-in r4067) in the romtool by changing the Makefiles to be no longer recursive (once again, recursive make is to be considered harmful). Tried to (quickly) unify most of the Makefile code, but medium-term this is going to be worked on for Kconfig support anyways. Also fix a sign cast error in rom-mkpayload in case people want to compile this with -W -Werror Patch relative to coreboot-v2/util/romtool Signed-off-by: Stefan Reinauer and Acked-by: Stefan Reinauer in order to get the tree working decently asap git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4069 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/romtool/tools/Makefile | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'util/romtool/tools/Makefile') diff --git a/util/romtool/tools/Makefile b/util/romtool/tools/Makefile index e711f500ab..f5f0df8add 100644 --- a/util/romtool/tools/Makefile +++ b/util/romtool/tools/Makefile @@ -1,25 +1,24 @@ -obj ?= $(shell pwd) +tobj ?= $(shell pwd) +tsrc ?= $(shell pwd) -CC=gcc -CFLAGS=-Wall -W -Werror -g +TARGETS += $(tobj)/rom-mkstage $(tobj)/rom-mkpayload -all: rom-mkstage rom-mkpayload +tools: $(tobj)/rom-mkstage $(tobj)/rom-mkpayload -include lzma/Makefile +include $(tobj)/lzma/Makefile -COMMON= common.o compress.o $(LZMA_OBJ) +COMMON = common.o compress.o $(LZMA_OBJ) +$(tobj)/rom-mkstage: $(tobj)/rom-mkstage.o $(patsubst %,$(tobj)/%,$(COMMON)) + $(CXX) $(CFLAGS) -o $@ $^ -$(obj)/rom-mkstage: $(obj)/rom-mkstage.o $(patsubst %,$(obj)/%,$(COMMON)) - $(CXX) -g -o $@ $(obj)/rom-mkstage.o $(patsubst %,$(obj)/%,$(COMMON)) +$(tobj)/rom-mkpayload: $(tobj)/rom-mkpayload.o $(patsubst %,$(tobj)/%,$(COMMON)) + $(CXX) $(CFLAGS) -o $@ $^ -$(obj)/rom-mkpayload: $(obj)/rom-mkpayload.o $(patsubst %,$(obj)/%,$(COMMON)) - $(CXX) -o $@ $(obj)/rom-mkpayload.o $(patsubst %,$(obj)/%,$(COMMON)) +$(tobj)/%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< -$(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 +tools-clean: + rm -f $(tobj)/rom-mkpayload.o $(tobj)/rom-mkstage.o $(patsubst %,$(tobj)/%,$(COMMON)) + rm -f $(tobj)/rom-mkpayload $(tobj)/rom-mkstage -- cgit v1.2.3