aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2007-11-11 02:51:17 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2007-11-11 02:51:17 +0000
commitfaf07963cb03f98d52ca1f7fde7482a3cb309bcc (patch)
tree77b5f598c4492fde2093dab3bca77b69e03c6654 /Makefile
parent28c5af54c661e73e5596918fa67a22b5e87c2022 (diff)
downloadqemu-faf07963cb03f98d52ca1f7fde7482a3cb309bcc.zip
qemu-faf07963cb03f98d52ca1f7fde7482a3cb309bcc.tar.gz
qemu-faf07963cb03f98d52ca1f7fde7482a3cb309bcc.tar.bz2
Split block API from vl.h.
Remove QEMU_TOOL. Replace with QEMU_IMG and NEED_CPU_H. Avoid linking qemu-img against whole system emulatior. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3578 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 16 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index d0ec057..73f9e3d 100644
--- a/Makefile
+++ b/Makefile
@@ -13,7 +13,6 @@ BASE_LDFLAGS += $(OS_LDFLAGS) $(ARCH_LDFLAGS)
CPPFLAGS += -I. -I$(SRC_PATH) -MMD -MP
CPPFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-CPPFLAGS += -DQEMU_TOOL
LIBS=
ifdef CONFIG_STATIC
BASE_LDFLAGS += -static
@@ -33,15 +32,23 @@ subdir-%: dyngen$(EXESUF) libqemu_common.a
recurse-all: $(patsubst %,subdir-%, $(TARGET_DIRS))
+#######################################################################
+# BLOCK_OBJS is code used by both qemu system emulation and qemu-img
+
+BLOCK_OBJS=cutils.o
+BLOCK_OBJS+=block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o
+BLOCK_OBJS+=block-dmg.o block-bochs.o block-vpc.o block-vvfat.o
+BLOCK_OBJS+=block-qcow2.o block-parallels.o
+
######################################################################
-# libqemu_common.a: target indepedent part of system emulation. The
+# libqemu_common.a: Target indepedent part of system emulation. The
# long term path is to suppress *all* target specific code in case of
# system emulation, i.e. a single QEMU executable should support all
# CPUs and machines.
-OBJS+=cutils.o readline.o console.o
-#OBJS+=block.o block-raw.o
-OBJS+=block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o block-dmg.o block-bochs.o block-vpc.o block-vvfat.o block-qcow2.o block-parallels.o
+OBJS=$(BLOCK_OBJS)
+OBJS+=readline.o console.o
+OBJS+=block.o
ifdef CONFIG_WIN32
OBJS+=tap-win32.o
@@ -105,9 +112,12 @@ libqemu_common.a: $(OBJS)
######################################################################
-qemu-img$(EXESUF): qemu-img.o block.o block-raw.o libqemu_common.a
+qemu-img$(EXESUF): qemu-img.o qemu-img-block.o qemu-img-block-raw.o $(BLOCK_OBJS)
$(CC) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ -lz $(LIBS)
+qemu-img-%.o: %.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -DQEMU_IMG $(BASE_CFLAGS) -c -o $@ $<
+
%.o: %.c
$(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<