From e6cc67b07a8cf25a3b439febcdfdce37e64297ab Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Sat, 4 Apr 2009 18:24:21 +0000 Subject: build romtool in mainboard target directory. Signed-off-by: Stefan Reinauer Acked-by: Stefan Reinauer git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4067 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/romtool/Makefile | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'util/romtool/Makefile') diff --git a/util/romtool/Makefile b/util/romtool/Makefile index 44982674f3..3b2e3a56dc 100644 --- a/util/romtool/Makefile +++ b/util/romtool/Makefile @@ -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 -- cgit v1.2.3