diff options
author | Stefan Reinauer <stepan@coresystems.de> | 2009-04-04 18:24:21 +0000 |
---|---|---|
committer | Stefan Reinauer <stepan@openbios.org> | 2009-04-04 18:24:21 +0000 |
commit | e6cc67b07a8cf25a3b439febcdfdce37e64297ab (patch) | |
tree | 9e3025066d18c5f4c9e9a48f20197c6bc1173c77 /util/romtool/Makefile | |
parent | 8e304e66165bc98c9e226e38623741212dbd4aa8 (diff) |
build romtool in mainboard target directory.
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4067 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/romtool/Makefile')
-rw-r--r-- | util/romtool/Makefile | 39 |
1 files changed, 25 insertions, 14 deletions
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 |