qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 3/4] Update makefile to build roms


From: Anthony Liguori
Subject: [Qemu-devel] [PATCH 3/4] Update makefile to build roms
Date: Sun, 17 May 2009 10:29:00 -0500

We build the roms in a sub directory of the target build directory.  This is
anticipating a single source base (like uboot) that gets built differently for
multiple target architectures (PPC, SH4, etc.).

Signed-off-by: Anthony Liguori <address@hidden>
---
 Makefile        |    7 ++++++-
 Makefile.target |   18 ++++++++++++++++++
 configure       |    8 ++++++++
 3 files changed, 32 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index f303aff..8677f38 100644
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,7 @@ config-host.mak:
 endif
 
 .PHONY: all clean cscope distclean dvi html info install install-doc \
-       recurse-all speed tar tarbin test
+       recurse-all speed tar tarbin test roms
 
 VPATH=$(SRC_PATH):$(SRC_PATH)/hw
 
@@ -231,6 +231,11 @@ qemu-io$(EXESUF):  qemu-io.o qemu-tool.o tool-osdep.o 
cmd.o $(BLOCK_OBJS)
 
 qemu-img$(EXESUF) qemu-nbd$(EXESUF) qemu-io$(EXESUF): LIBS += -lz
 
+roms:
+       @for d in $(TARGET_DIRS); do \
+       $(MAKE) -C $$d $@ || exit 1 ; \
+        done
+
 clean:
 # avoid old build problems by removing potentially incorrect old files
        rm -f config.mak config.h op-i386.h opc-i386.h gen-op-i386.h op-arm.h 
opc-arm.h gen-op-arm.h
diff --git a/Makefile.target b/Makefile.target
index dd1c442..567618b 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -712,6 +712,12 @@ LDFLAGS+=-p
 main.o: CFLAGS+=-p
 endif
 
+#  Per architecture ROMS
+ROMS=
+ifeq ($(TARGET_BASE_ARCH),i386)
+ROMS+=gplbios vgabios
+endif
+
 vl.o: qemu-options.h
 
 $(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) 
$(VDE_LIBS)
@@ -731,9 +737,21 @@ endif
 qemu-options.h: $(SRC_PATH)/qemu-options.hx
        $(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@,"  GEN   
$(TARGET_DIR)$@")
 
+.PHONY: roms
+
+roms:
+       @if test "$(ROMS)" ; then \
+         for subdir in $(ROMS); do \
+           $(MAKE) -C roms/$${subdir} VPATH=$(SRC_PATH)/roms/$${subdir} ;\
+         done; \
+       fi
+
 clean:
        rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o qemu-options.h gdbstub-xml.c
        rm -f *.d */*.d tcg/*.o
+       for subdir in $(ROMS); do \
+           $(MAKE) -C $${subdir} clean \
+       done
 
 install: all
 ifneq ($(PROGS),)
diff --git a/configure b/configure
index 4111e7c..29a13ca 100755
--- a/configure
+++ b/configure
@@ -1791,6 +1791,14 @@ if test "$target" = "arm-linux-user" -o "$target" = 
"armeb-linux-user" -o "$targ
   mkdir -p $target_dir/nwfpe
 fi
 
+if test "$target" = "i386-softmmu" -o "$target" = "x86_64-softmmu" ; then
+    for rom in gplbios vgabios ; do
+       mkdir -p $target_dir/roms/$rom
+       rm -f $target_dir/roms/$rom/Makefile
+       ln -s $source_path/roms/$rom/Makefile $target_dir/roms/$rom/Makefile
+    done
+fi
+
 #
 # don't use ln -sf as not all "ln -sf" over write the file/link
 #
-- 
1.6.2.5





reply via email to

[Prev in Thread] Current Thread [Next in Thread]