* [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse
@ 2012-06-03 12:25 Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 01/24] remove trace-nested-y Paolo Bonzini
` (27 more replies)
0 siblings, 28 replies; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 12:25 UTC (permalink / raw)
To: qemu-devel
One source of complexity in the QEMU source is that we have a very
shallow tree for a source code of over 750,000 lines of code. In
fact, one third of these lines alone is in one directory, hw/.
As a prerequisite to cleaning up the structure, but as a worthwhile
step on its own, this patchset cleans up the build system so that
separate directories have their own Makefile snippet. As in the Linux
kernel build system, the overall build system is generally flat (in
the case of QEMU, with one recursive invocation per emulation target).
Subdirectories do not include complete Makefiles, instead they only host
the declarations for a few variables (common-obj-y, universal-obj-y,
obj-y, etc.). Definitions for all the directories are merged with a
little GNU Make magic (not much, only 20 lines).
Two nice side effects are:
- we can match the source tree and the object tree (for example the
per-target device models will be in XYZ-softmmu/hw, not in
XYZ-softmmu; those that are compiled once will be in hw/ rather
than in the root).
- because the resolution of nested makefiles tracks the nested
directory, there is no need to use VPATH to find sources in
the hw/ and target-*/ directory.
- there is a lot less Makefile programming (conditionals, addprefix,
etc.), replaced by only 20 lines in rules.mak and 1 in Makefile.objs.
The series is entirely bisectable, and mostly consists of boring patches.
If the concept is accepted, I would like to get it in as soon as possible.
I have a few other cleanups on top (I stopped once I undid the diffstat
of this series :)), but they can be covered later.
Thoughts, approvals, rejections?
Paolo
Paolo Bonzini (24):
remove trace-nested-y
do not sprinkle around GENERATED_HEADERS dependencies
add rules for nesting
move *-user/ objects to nested Makefile
move obj-TARGET-y variables to nested Makefile
move libobj-y variable to nested Makefile
move other target-*/ objects to nested Makefiles
move rules for nesting to Makefile.objs
use nested Makefile rules for qom/ objects
move block/ objects to nested Makefile
move net/ objects to nested Makefile
move fsdev/ objects to nested Makefile
move ui/ objects to nested Makefile
move audio/ objects to nested Makefile
move slirp/ objects to nested Makefile
move qapi/ objects to nested Makefile
move qga/ objects to nested Makefile
move target-independent hw/ objects to nested Makefiles
convert libhw to nested Makefiles
move per-target hw/ objects to nested Makefiles
move device tree to per-target Makefile
libcacard Makefile cleanups
limit usage of vpath
compile oslib-obj-y once
Makefile | 30 ++-
Makefile.hw | 7 +-
Makefile.objs | 316 ++++---------------------
Makefile.target | 325 ++++----------------------
audio/Makefile | 15 ++
block/Makefile | 11 +
bsd-user/Makefile | 3 +
configure | 70 +++---
fsdev/Makefile | 6 +
hw/9pfs/Makefile | 9 +
hw/Makefile | 162 +++++++++++++
hw/alpha/Makefile | 4 +
hw/arm/Makefile | 40 ++++
hw/cris/Makefile | 13 ++
hw/i386/Makefile | 13 ++
hw/ide/Makefile | 10 +
hw/lm32/Makefile | 23 ++
hw/m68k/Makefile | 4 +
hw/microblaze/Makefile | 14 ++
hw/mips/Makefile | 6 +
hw/ppc/Makefile | 32 +++
hw/s390x/Makefile | 3 +
hw/sh4/Makefile | 5 +
hw/sparc/Makefile | 8 +
hw/sparc64/Makefile | 4 +
hw/usb/Makefile | 13 ++
hw/xtensa/Makefile | 5 +
libcacard/Makefile | 17 +-
linux-user/Makefile | 7 +
linux-user/arm/nwfpe/Makefile | 3 +
net/Makefile | 13 ++
qapi/Makefile | 3 +
qga/Makefile | 4 +
qom/Makefile | 6 +-
rules.mak | 21 ++
slirp/Makefile | 4 +
target-alpha/Makefile | 3 +
target-arm/Makefile | 4 +
arm-semi.c => target-arm/arm-semi.c | 0
target-cris/Makefile | 2 +
target-i386/Makefile | 6 +
ioport-user.c => target-i386/ioport-user.c | 0
target-lm32/Makefile | 2 +
target-m68k/Makefile | 3 +
m68k-semi.c => target-m68k/m68k-semi.c | 0
target-microblaze/Makefile | 2 +
target-mips/Makefile | 2 +
target-ppc/Makefile | 3 +
target-s390x/Makefile | 3 +
target-sh4/Makefile | 2 +
target-sparc/Makefile | 6 +
target-unicore32/Makefile | 2 +
target-xtensa/Makefile | 6 +
xtensa-semi.c => target-xtensa/xtensa-semi.c | 0
tests/Makefile | 1 -
ui/Makefile | 18 ++
56 files changed, 674 insertions(+), 620 deletions(-)
create mode 100644 audio/Makefile
create mode 100644 block/Makefile
create mode 100644 bsd-user/Makefile
create mode 100644 fsdev/Makefile
create mode 100644 hw/9pfs/Makefile
create mode 100644 hw/Makefile
create mode 100644 hw/alpha/Makefile
create mode 100644 hw/arm/Makefile
create mode 100644 hw/cris/Makefile
create mode 100644 hw/i386/Makefile
create mode 100644 hw/ide/Makefile
create mode 100644 hw/lm32/Makefile
create mode 100644 hw/m68k/Makefile
create mode 100644 hw/microblaze/Makefile
create mode 100644 hw/mips/Makefile
create mode 100644 hw/ppc/Makefile
create mode 100644 hw/s390x/Makefile
create mode 100644 hw/sh4/Makefile
create mode 100644 hw/sparc/Makefile
create mode 100644 hw/sparc64/Makefile
create mode 100644 hw/usb/Makefile
create mode 100644 hw/xtensa/Makefile
create mode 100644 linux-user/Makefile
create mode 100644 linux-user/arm/nwfpe/Makefile
create mode 100644 net/Makefile
create mode 100644 qapi/Makefile
create mode 100644 qga/Makefile
create mode 100644 slirp/Makefile
create mode 100644 target-alpha/Makefile
create mode 100644 target-arm/Makefile
rename arm-semi.c => target-arm/arm-semi.c (100%)
create mode 100644 target-cris/Makefile
create mode 100644 target-i386/Makefile
rename ioport-user.c => target-i386/ioport-user.c (100%)
create mode 100644 target-lm32/Makefile
create mode 100644 target-m68k/Makefile
rename m68k-semi.c => target-m68k/m68k-semi.c (100%)
create mode 100644 target-microblaze/Makefile
create mode 100644 target-mips/Makefile
create mode 100644 target-ppc/Makefile
create mode 100644 target-s390x/Makefile
create mode 100644 target-sh4/Makefile
create mode 100644 target-sparc/Makefile
create mode 100644 target-unicore32/Makefile
create mode 100644 target-xtensa/Makefile
rename xtensa-semi.c => target-xtensa/xtensa-semi.c (100%)
create mode 100644 ui/Makefile
--
1.7.10.1
^ permalink raw reply [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH 01/24] remove trace-nested-y
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
@ 2012-06-03 12:25 ` Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 02/24] do not sprinkle around GENERATED_HEADERS dependencies Paolo Bonzini
` (26 subsequent siblings)
27 siblings, 0 replies; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 12:25 UTC (permalink / raw)
To: qemu-devel
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile.objs | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/Makefile.objs b/Makefile.objs
index 70c5c79..1daa92c 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -425,16 +425,11 @@ ifneq ($(TRACE_BACKEND),dtrace)
trace-obj-y = trace.o
endif
-trace-nested-$(CONFIG_TRACE_DEFAULT) += default.o
-
-trace-nested-$(CONFIG_TRACE_SIMPLE) += simple.o
+trace-obj-$(CONFIG_TRACE_DEFAULT) += trace/default.o
+trace-obj-$(CONFIG_TRACE_SIMPLE) += trace/simple.o
trace-obj-$(CONFIG_TRACE_SIMPLE) += qemu-timer-common.o
-
-trace-nested-$(CONFIG_TRACE_STDERR) += stderr.o
-
-trace-nested-y += control.o
-
-trace-obj-y += $(addprefix trace/, $(trace-nested-y))
+trace-obj-$(CONFIG_TRACE_STDERR) += trace/stderr.o
+trace-obj-y += trace/control.o
$(trace-obj-y): $(GENERATED_HEADERS)
--
1.7.10.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH 02/24] do not sprinkle around GENERATED_HEADERS dependencies
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 01/24] remove trace-nested-y Paolo Bonzini
@ 2012-06-03 12:25 ` Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 03/24] add rules for nesting Paolo Bonzini
` (25 subsequent siblings)
27 siblings, 0 replies; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 12:25 UTC (permalink / raw)
To: qemu-devel
Keeping GENERATED_HEADERS dependencies up-to-date everywhere is complex.
We can simply make the Makefile depend on them, and they will be built
before all other targets.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile | 18 +++++++++---------
Makefile.target | 14 ++++----------
tests/Makefile | 1 -
3 files changed, 13 insertions(+), 20 deletions(-)
diff --git a/Makefile b/Makefile
index 9b7a85e..c0ab97a 100644
--- a/Makefile
+++ b/Makefile
@@ -91,19 +91,18 @@ qemu-options.def: $(SRC_PATH)/qemu-options.hx
SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
-subdir-%: $(GENERATED_HEADERS)
+subdir-%:
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
ifneq ($(wildcard config-host.mak),)
include $(SRC_PATH)/Makefile.objs
endif
-$(universal-obj-y) $(common-obj-y): $(GENERATED_HEADERS)
subdir-libcacard: $(oslib-obj-y) $(trace-obj-y) qemu-timer-common.o
$(filter %-softmmu,$(SUBDIR_RULES)): $(universal-obj-y) $(trace-obj-y) $(common-obj-y) subdir-libdis
-$(filter %-user,$(SUBDIR_RULES)): $(GENERATED_HEADERS) $(universal-obj-y) $(trace-obj-y) subdir-libdis-user subdir-libuser
+$(filter %-user,$(SUBDIR_RULES)): $(universal-obj-y) $(trace-obj-y) subdir-libdis-user subdir-libuser
ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
romsubdir-%:
@@ -142,7 +141,7 @@ libcacard.la:
install-libcacard:
@echo "libtool is missing, please install and rerun configure"; exit 1
else
-libcacard.la: $(GENERATED_HEADERS) $(oslib-obj-y) qemu-timer-common.o $(addsuffix .lo, $(basename $(trace-obj-y)))
+libcacard.la: $(oslib-obj-y) qemu-timer-common.o $(addsuffix .lo, $(basename $(trace-obj-y)))
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" libcacard.la,)
install-libcacard: libcacard.la
@@ -151,7 +150,6 @@ endif
######################################################################
qemu-img.o: qemu-img-cmds.h
-qemu-img.o qemu-tool.o qemu-nbd.o qemu-io.o cmd.o qemu-ga.o: $(GENERATED_HEADERS)
tools-obj-y = $(oslib-obj-y) $(trace-obj-y) qemu-tool.o qemu-timer.o \
qemu-timer-common.o main-loop.o notify.o iohandler.o cutils.o async.o
@@ -162,7 +160,6 @@ qemu-nbd$(EXESUF): qemu-nbd.o $(tools-obj-y) $(block-obj-y)
qemu-io$(EXESUF): qemu-io.o cmd.o $(tools-obj-y) $(block-obj-y)
qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o
-qemu-bridge-helper.o: $(GENERATED_HEADERS)
fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o oslib-posix.o $(trace-obj-y)
fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
@@ -170,7 +167,6 @@ fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $@")
-$(qapi-obj-y): $(GENERATED_HEADERS)
qapi-dir := $(BUILD_DIR)/qapi-generated
qemu-ga$(EXESUF): LIBS = $(LIBS_QGA)
qemu-ga$(EXESUF): QEMU_CFLAGS += -I $(qapi-dir)
@@ -203,8 +199,8 @@ $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py
QGALIB_OBJ=$(addprefix $(qapi-dir)/, qga-qapi-types.o qga-qapi-visit.o qga-qmp-marshal.o)
QGALIB_GEN=$(addprefix $(qapi-dir)/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
-$(QGALIB_OBJ): $(QGALIB_GEN) $(GENERATED_HEADERS)
-$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) $(GENERATED_HEADERS)
+$(QGALIB_OBJ): $(QGALIB_GEN)
+$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN)
qemu-ga$(EXESUF): qemu-ga.o $(qga-obj-y) $(tools-obj-y) $(qapi-obj-y) $(qobject-obj-y) $(version-obj-y) $(QGALIB_OBJ)
@@ -399,5 +395,9 @@ tar:
cd /tmp && tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS --exclude .git --exclude .svn
rm -rf /tmp/$(FILE)
+# Add a dependency on the generated files, so that they are always
+# rebuilt before other object files
+Makefile: $(GENERATED_HEADERS)
+
# Include automatically generated dependency files
-include $(wildcard *.d audio/*.d slirp/*.d block/*.d net/*.d ui/*.d qapi/*.d qga/*.d)
diff --git a/Makefile.target b/Makefile.target
index 1582904..95a82be 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -1,6 +1,5 @@
# -*- Mode: makefile -*-
-GENERATED_HEADERS = config-target.h
CONFIG_NO_PCI = $(if $(subst n,,$(CONFIG_PCI)),n,y)
CONFIG_NO_KVM = $(if $(subst n,,$(CONFIG_KVM)),n,y)
CONFIG_NO_XEN = $(if $(subst n,,$(CONFIG_XEN)),n,y)
@@ -105,8 +104,6 @@ libobj-$(CONFIG_TCI_DIS) += tci-dis.o
tci-dis.o: QEMU_CFLAGS += -I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/tci
-$(libobj-y): $(GENERATED_HEADERS)
-
# HELPER_CFLAGS is used for all the legacy code compiled with static register
# variables
ifneq ($(TARGET_BASE_ARCH), sparc)
@@ -143,8 +140,6 @@ obj-arm-y += arm-semi.o
obj-m68k-y += m68k-sim.o m68k-semi.o
-$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS)
-
obj-y += $(addprefix ../, $(universal-obj-y))
obj-y += $(addprefix ../libuser/, $(user-obj-y))
obj-y += $(addprefix ../libdis-user/, $(libdis-y))
@@ -166,8 +161,6 @@ obj-y = main.o bsdload.o elfload.o mmap.o signal.o strace.o syscall.o \
obj-i386-y += ioport-user.o
-$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS)
-
obj-y += $(addprefix ../, $(universal-obj-y))
obj-y += $(addprefix ../libuser/, $(user-obj-y))
obj-y += $(addprefix ../libdis-user/, $(libdis-y))
@@ -389,9 +382,7 @@ obj-xtensa-y += core-fsf.o
main.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
-monitor.o: hmp-commands.h qmp-commands-old.h
-
-$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS)
+GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h
obj-y += $(addprefix ../, $(universal-obj-y))
obj-y += $(addprefix ../, $(common-obj-y))
@@ -452,5 +443,8 @@ ifdef CONFIG_TRACE_SYSTEMTAP
$(INSTALL_DATA) $(QEMU_PROG).stp "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset"
endif
+GENERATED_HEADERS += config-target.h
+Makefile: $(GENERATED_HEADERS)
+
# Include automatically generated dependency files
-include $(wildcard *.d */*.d)
diff --git a/tests/Makefile b/tests/Makefile
index ab7f667..2e754c3 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -37,7 +37,6 @@ test-qapi-obj-y = $(qobject-obj-y) $(qapi-obj-y) $(tools-obj-y)
test-qapi-obj-y += tests/test-qapi-visit.o tests/test-qapi-types.o
test-qapi-obj-y += module.o
-$(test-obj-y): $(GENERATED_HEADERS)
$(test-obj-y): QEMU_INCLUDES += -Itests
tests/check-qint$(EXESUF): tests/check-qint.o qint.o $(tools-obj-y)
--
1.7.10.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH 03/24] add rules for nesting
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 01/24] remove trace-nested-y Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 02/24] do not sprinkle around GENERATED_HEADERS dependencies Paolo Bonzini
@ 2012-06-03 12:25 ` Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 04/24] move *-user/ objects to nested Makefile Paolo Bonzini
` (24 subsequent siblings)
27 siblings, 0 replies; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 12:25 UTC (permalink / raw)
To: qemu-devel
This adds the 'magic' rules that take care of subdirectories.
The subdirectory makefiles in the source tree are not complete; they
only define some variables (listed in nested-vars) according to the
configuration.
The magic rules descend into subdirectory makefiles and gather the
evaluated values of those variables. The values from all subdirectories
are joined together, each prefixed with the subdirectory name, and used
by the "real" makefiles.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
rules.mak | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/rules.mak b/rules.mak
index efef6f2..3126c8c 100644
--- a/rules.mak
+++ b/rules.mak
@@ -73,3 +73,24 @@ TRACETOOL=$(PYTHON) $(SRC_PATH)/scripts/tracetool.py
# will delete the target of a rule if commands exit with a nonzero exit status
.DELETE_ON_ERROR:
+
+# magic to descend into other directories
+
+save-var = $(eval $2 = $(value $1))$(eval $1 :=)
+restore-var = $(eval $1 = $(value $2))$(eval $2 :=)
+
+define unnest-var-1
+$(eval nested-dirs := $(patsubst %, $3%, $(filter %/, $2)))
+$(eval all-files += $(patsubst %, $3%, $(filter-out %/, $2)))
+$(foreach nested-dir,$(nested-dirs),
+ $(foreach var,$(nested-vars),$(call save-var,$(var),save-$(nested-dir)-$(var)))
+ $(eval include $(SRC_PATH)/$(nested-dir)Makefile)
+ $(call unnest-var-1,$1,$($1),$(nested-dir))
+ $(foreach var,$(nested-vars),$(call restore-var,$(var),save-$(nested-dir)-$(var))))
+endef
+
+define unnest-var
+$(eval all-files :=)
+$(call unnest-var-1,$1,$($1),)
+$(eval $1 := $$(all-files))
+endef
--
1.7.10.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH 04/24] move *-user/ objects to nested Makefile
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
` (2 preceding siblings ...)
2012-06-03 12:25 ` [Qemu-devel] [PATCH 03/24] add rules for nesting Paolo Bonzini
@ 2012-06-03 12:25 ` Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 05/24] move obj-TARGET-y variables " Paolo Bonzini
` (23 subsequent siblings)
27 siblings, 0 replies; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 12:25 UTC (permalink / raw)
To: qemu-devel
Conversion to nested Makefile snippets starts at the user-mode emulators.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile.target | 32 ++++++++++----------------------
bsd-user/Makefile | 3 +++
configure | 8 +++++++-
linux-user/Makefile | 7 +++++++
linux-user/arm/nwfpe/Makefile | 3 +++
5 files changed, 30 insertions(+), 23 deletions(-)
create mode 100644 bsd-user/Makefile
create mode 100644 linux-user/Makefile
create mode 100644 linux-user/arm/nwfpe/Makefile
diff --git a/Makefile.target b/Makefile.target
index 95a82be..dce5761 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -113,32 +113,20 @@ user-exec.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
# Note: this is a workaround. The real fix is to avoid compiling
# cpu_signal_handler() in user-exec.c.
-signal.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
+%/signal.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
#########################################################
# Linux user emulator target
ifdef CONFIG_LINUX_USER
-$(call set-vpath, $(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR))
-
QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) -I$(SRC_PATH)/linux-user
-obj-y = main.o syscall.o strace.o mmap.o signal.o thunk.o \
- elfload.o linuxload.o uaccess.o gdbstub.o cpu-uname.o \
- user-exec.o $(oslib-obj-y)
-
-obj-$(TARGET_HAS_BFLT) += flatload.o
-
-obj-$(TARGET_I386) += vm86.o
+obj-y += linux-user/
+obj-y += gdbstub.o thunk.o user-exec.o $(oslib-obj-y)
obj-i386-y += ioport-user.o
-
-nwfpe-obj-y = fpa11.o fpa11_cpdo.o fpa11_cpdt.o fpa11_cprt.o fpopcode.o
-nwfpe-obj-y += single_cpdo.o double_cpdo.o extended_cpdo.o
-obj-arm-y += $(addprefix nwfpe/, $(nwfpe-obj-y))
-obj-arm-y += arm-semi.o
-
-obj-m68k-y += m68k-sim.o m68k-semi.o
+obj-$(TARGET_ARM) += arm-semi.o
+obj-$(TARGET_M68K) += m68k-semi.o
obj-y += $(addprefix ../, $(universal-obj-y))
obj-y += $(addprefix ../libuser/, $(user-obj-y))
@@ -152,13 +140,10 @@ endif #CONFIG_LINUX_USER
ifdef CONFIG_BSD_USER
-$(call set-vpath, $(SRC_PATH)/bsd-user)
-
QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
-obj-y = main.o bsdload.o elfload.o mmap.o signal.o strace.o syscall.o \
- gdbstub.o uaccess.o user-exec.o
-
+obj-y += bsd-user/
+obj-y += gdbstub.o user-exec.o
obj-i386-y += ioport-user.o
obj-y += $(addprefix ../, $(universal-obj-y))
@@ -403,6 +388,9 @@ endif # CONFIG_LINUX_USER
obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o
+nested-vars = obj-y
+dummy := $(foreach var, $(nested-vars), $(call unnest-var,$(var)))
+
ifdef QEMU_PROGW
# The linker builds a windows executable. Make also a console executable.
$(QEMU_PROGW): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y)
diff --git a/bsd-user/Makefile b/bsd-user/Makefile
new file mode 100644
index 0000000..44b2f7d
--- /dev/null
+++ b/bsd-user/Makefile
@@ -0,0 +1,3 @@
+obj-y = main.o bsdload.o elfload.o mmap.o signal.o strace.o syscall.o \
+ uaccess.o
+
diff --git a/configure b/configure
index b55a792..4898ffb 100755
--- a/configure
+++ b/configure
@@ -3501,8 +3501,14 @@ mkdir -p $target_dir/ide
mkdir -p $target_dir/usb
mkdir -p $target_dir/9pfs
mkdir -p $target_dir/kvm
+if test "$target_linux_user" = yes; then
+ mkdir -p $target_dir/linux-user
+fi
+if test "$target_bsd_user" = yes; then
+ mkdir -p $target_dir/bsd-user
+fi
if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
- mkdir -p $target_dir/nwfpe
+ mkdir -p $target_dir/linux-user/arm/nwfpe
fi
symlink "$source_path/Makefile.target" "$target_dir/Makefile"
diff --git a/linux-user/Makefile b/linux-user/Makefile
new file mode 100644
index 0000000..5899d72
--- /dev/null
+++ b/linux-user/Makefile
@@ -0,0 +1,7 @@
+obj-y = main.o syscall.o strace.o mmap.o signal.o \
+ elfload.o linuxload.o uaccess.o cpu-uname.o
+
+obj-$(TARGET_HAS_BFLT) += flatload.o
+obj-$(TARGET_I386) += vm86.o
+obj-$(TARGET_ARM) += arm/nwfpe/
+obj-$(TARGET_M68K) += m68k-sim.o
diff --git a/linux-user/arm/nwfpe/Makefile b/linux-user/arm/nwfpe/Makefile
new file mode 100644
index 0000000..0186a0e
--- /dev/null
+++ b/linux-user/arm/nwfpe/Makefile
@@ -0,0 +1,3 @@
+obj-y = fpa11.o fpa11_cpdo.o fpa11_cpdt.o fpa11_cprt.o fpopcode.o
+obj-y += single_cpdo.o double_cpdo.o extended_cpdo.o
+
--
1.7.10.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH 05/24] move obj-TARGET-y variables to nested Makefile
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
` (3 preceding siblings ...)
2012-06-03 12:25 ` [Qemu-devel] [PATCH 04/24] move *-user/ objects to nested Makefile Paolo Bonzini
@ 2012-06-03 12:25 ` Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 06/24] move libobj-y variable " Paolo Bonzini
` (22 subsequent siblings)
27 siblings, 0 replies; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 12:25 UTC (permalink / raw)
To: qemu-devel
The contents of obj-TARGET-y are moved to either target-TARGET/Makefile
or hw/TARGET/Makefile. In the future, a lot of source code could also
move from hw to hw/TARGET.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile.target | 186 ++------------------------
configure | 48 ++++---
hw/alpha/Makefile | 4 +
hw/arm/Makefile | 39 ++++++
hw/cris/Makefile | 13 ++
hw/i386/Makefile | 13 ++
hw/lm32/Makefile | 23 ++++
hw/m68k/Makefile | 4 +
hw/microblaze/Makefile | 13 ++
hw/mips/Makefile | 6 +
hw/ppc/Makefile | 31 +++++
hw/s390x/Makefile | 3 +
hw/sh4/Makefile | 5 +
hw/sparc/Makefile | 8 ++
hw/sparc64/Makefile | 4 +
hw/xtensa/Makefile | 5 +
target-alpha/Makefile | 1 +
target-arm/Makefile | 1 +
arm-semi.c => target-arm/arm-semi.c | 0
target-cris/Makefile | 1 +
target-i386/Makefile | 4 +
ioport-user.c => target-i386/ioport-user.c | 0
target-lm32/Makefile | 1 +
target-m68k/Makefile | 1 +
m68k-semi.c => target-m68k/m68k-semi.c | 0
target-microblaze/Makefile | 1 +
target-mips/Makefile | 1 +
target-ppc/Makefile | 1 +
target-s390x/Makefile | 1 +
target-sh4/Makefile | 1 +
target-sparc/Makefile | 1 +
target-unicore32/Makefile | 1 +
target-xtensa/Makefile | 4 +
xtensa-semi.c => target-xtensa/xtensa-semi.c | 0
34 files changed, 230 insertions(+), 195 deletions(-)
create mode 100644 hw/alpha/Makefile
create mode 100644 hw/arm/Makefile
create mode 100644 hw/cris/Makefile
create mode 100644 hw/i386/Makefile
create mode 100644 hw/lm32/Makefile
create mode 100644 hw/m68k/Makefile
create mode 100644 hw/microblaze/Makefile
create mode 100644 hw/mips/Makefile
create mode 100644 hw/ppc/Makefile
create mode 100644 hw/s390x/Makefile
create mode 100644 hw/sh4/Makefile
create mode 100644 hw/sparc/Makefile
create mode 100644 hw/sparc64/Makefile
create mode 100644 hw/xtensa/Makefile
create mode 100644 target-alpha/Makefile
create mode 100644 target-arm/Makefile
rename arm-semi.c => target-arm/arm-semi.c (100%)
create mode 100644 target-cris/Makefile
create mode 100644 target-i386/Makefile
rename ioport-user.c => target-i386/ioport-user.c (100%)
create mode 100644 target-lm32/Makefile
create mode 100644 target-m68k/Makefile
rename m68k-semi.c => target-m68k/m68k-semi.c (100%)
create mode 100644 target-microblaze/Makefile
create mode 100644 target-mips/Makefile
create mode 100644 target-ppc/Makefile
create mode 100644 target-s390x/Makefile
create mode 100644 target-sh4/Makefile
create mode 100644 target-sparc/Makefile
create mode 100644 target-unicore32/Makefile
create mode 100644 target-xtensa/Makefile
rename xtensa-semi.c => target-xtensa/xtensa-semi.c (100%)
diff --git a/Makefile.target b/Makefile.target
index dce5761..f64419d 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -102,6 +102,8 @@ libobj-$(TARGET_ALPHA) += int_helper.o fpu_helper.o sys_helper.o mem_helper.o
libobj-y += disas.o
libobj-$(CONFIG_TCI_DIS) += tci-dis.o
+obj-y += target-$(TARGET_BASE_ARCH)/
+
tci-dis.o: QEMU_CFLAGS += -I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/tci
# HELPER_CFLAGS is used for all the legacy code compiled with static register
@@ -124,9 +126,6 @@ QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) -I$(SRC_PATH)/linux-user
obj-y += linux-user/
obj-y += gdbstub.o thunk.o user-exec.o $(oslib-obj-y)
-obj-i386-y += ioport-user.o
-obj-$(TARGET_ARM) += arm-semi.o
-obj-$(TARGET_M68K) += m68k-semi.o
obj-y += $(addprefix ../, $(universal-obj-y))
obj-y += $(addprefix ../libuser/, $(user-obj-y))
@@ -144,7 +143,6 @@ QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
obj-y += bsd-user/
obj-y += gdbstub.o user-exec.o
-obj-i386-y += ioport-user.o
obj-y += $(addprefix ../, $(universal-obj-y))
obj-y += $(addprefix ../libuser/, $(user-obj-y))
@@ -157,7 +155,7 @@ endif #CONFIG_BSD_USER
# System emulator target
ifdef CONFIG_SOFTMMU
-obj-y = arch_init.o cpus.o monitor.o machine.o gdbstub.o balloon.o ioport.o
+obj-y += arch_init.o cpus.o monitor.o machine.o gdbstub.o balloon.o ioport.o
# virtio has to be here due to weird dependency between PCI and virtio-net.
# need to fix this properly
obj-$(CONFIG_NO_PCI) += pci-stub.o
@@ -172,8 +170,6 @@ obj-$(CONFIG_VGA) += vga.o
obj-y += memory.o savevm.o cputlb.o
LIBS+=-lz
-obj-i386-$(CONFIG_KVM) += hyperv.o
-
QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
QEMU_CFLAGS += $(VNC_SASL_CFLAGS)
QEMU_CFLAGS += $(VNC_JPEG_CFLAGS)
@@ -183,8 +179,6 @@ QEMU_CFLAGS += $(VNC_PNG_CFLAGS)
obj-$(CONFIG_XEN) += xen-all.o xen_machine_pv.o xen_domainbuild.o xen-mapcache.o
obj-$(CONFIG_NO_XEN) += xen-stub.o
-obj-i386-$(CONFIG_XEN) += xen_platform.o xen_apic.o
-
# Inter-VM PCI shared memory
CONFIG_IVSHMEM =
ifeq ($(CONFIG_KVM), y)
@@ -198,172 +192,18 @@ obj-$(CONFIG_IVSHMEM) += ivshmem.o
obj-y += device-hotplug.o
# Hardware support
-obj-i386-y += mc146818rtc.o pc.o
-obj-i386-y += apic_common.o apic.o kvmvapic.o
-obj-i386-y += sga.o ioapic_common.o ioapic.o piix_pci.o
-obj-i386-y += vmport.o
-obj-i386-y += pci-hotplug.o smbios.o wdt_ib700.o
-obj-i386-y += debugcon.o multiboot.o
-obj-i386-y += pc_piix.o
-obj-i386-y += pc_sysfw.o
-obj-i386-$(CONFIG_KVM) += kvm/clock.o kvm/apic.o kvm/i8259.o kvm/ioapic.o kvm/i8254.o
-obj-i386-$(CONFIG_SPICE) += qxl.o qxl-logger.o qxl-render.o
-
-# shared objects
-obj-ppc-y = ppc.o ppc_booke.o
-# PREP target
-obj-ppc-y += mc146818rtc.o
-obj-ppc-y += ppc_prep.o
-# OldWorld PowerMac
-obj-ppc-y += ppc_oldworld.o
-# NewWorld PowerMac
-obj-ppc-y += ppc_newworld.o
-# IBM pSeries (sPAPR)
-obj-ppc-$(CONFIG_PSERIES) += spapr.o spapr_hcall.o spapr_rtas.o spapr_vio.o
-obj-ppc-$(CONFIG_PSERIES) += xics.o spapr_vty.o spapr_llan.o spapr_vscsi.o
-obj-ppc-$(CONFIG_PSERIES) += spapr_pci.o device-hotplug.o pci-hotplug.o
-# PowerPC 4xx boards
-obj-ppc-y += ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
-obj-ppc-y += ppc440_bamboo.o
-# PowerPC E500 boards
-obj-ppc-y += ppce500_mpc8544ds.o mpc8544_guts.o ppce500_spin.o
-# PowerPC 440 Xilinx ML507 reference board.
-obj-ppc-y += virtex_ml507.o
-obj-ppc-$(CONFIG_KVM) += kvm_ppc.o
-obj-ppc-$(CONFIG_FDT) += device_tree.o
-# PowerPC OpenPIC
-obj-ppc-y += openpic.o
-
-# Xilinx PPC peripherals
-obj-ppc-y += xilinx_intc.o
-obj-ppc-y += xilinx_timer.o
-obj-ppc-y += xilinx_uartlite.o
-obj-ppc-y += xilinx_ethlite.o
-
-# LM32 boards
-obj-lm32-y += lm32_boards.o
-obj-lm32-y += milkymist.o
-
-# LM32 peripherals
-obj-lm32-y += lm32_pic.o
-obj-lm32-y += lm32_juart.o
-obj-lm32-y += lm32_timer.o
-obj-lm32-y += lm32_uart.o
-obj-lm32-y += lm32_sys.o
-obj-lm32-y += milkymist-ac97.o
-obj-lm32-y += milkymist-hpdmc.o
-obj-lm32-y += milkymist-memcard.o
-obj-lm32-y += milkymist-minimac2.o
-obj-lm32-y += milkymist-pfpu.o
-obj-lm32-y += milkymist-softusb.o
-obj-lm32-y += milkymist-sysctl.o
-obj-lm32-$(CONFIG_OPENGL) += milkymist-tmu2.o
-obj-lm32-y += milkymist-uart.o
-obj-lm32-y += milkymist-vgafb.o
-obj-lm32-y += framebuffer.o
-
-obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
-obj-mips-y += mips_addr.o mips_timer.o mips_int.o
-obj-mips-y += gt64xxx.o mc146818rtc.o
-obj-mips-$(CONFIG_FULONG) += bonito.o vt82c686.o mips_fulong2e.o
-
-obj-microblaze-y = petalogix_s3adsp1800_mmu.o
-obj-microblaze-y += petalogix_ml605_mmu.o
-obj-microblaze-y += microblaze_boot.o
-
-obj-microblaze-y += microblaze_pic_cpu.o
-obj-microblaze-y += xilinx_intc.o
-obj-microblaze-y += xilinx_timer.o
-obj-microblaze-y += xilinx_uartlite.o
-obj-microblaze-y += xilinx_ethlite.o
-obj-microblaze-y += xilinx_axidma.o
-obj-microblaze-y += xilinx_axienet.o
-
-obj-microblaze-$(CONFIG_FDT) += device_tree.o
-
-# Boards
-obj-cris-y = cris_pic_cpu.o
-obj-cris-y += cris-boot.o
-obj-cris-y += axis_dev88.o
-
-# IO blocks
-obj-cris-y += etraxfs_dma.o
-obj-cris-y += etraxfs_pic.o
-obj-cris-y += etraxfs_eth.o
-obj-cris-y += etraxfs_timer.o
-obj-cris-y += etraxfs_ser.o
-
ifeq ($(TARGET_ARCH), sparc64)
-obj-sparc-y = sun4u.o apb_pci.o
-obj-sparc-y += mc146818rtc.o
+obj-y += hw/sparc64/
else
-obj-sparc-y = sun4m.o lance.o tcx.o sun4m_iommu.o slavio_intctl.o
-obj-sparc-y += slavio_timer.o slavio_misc.o sparc32_dma.o
-obj-sparc-y += cs4231.o eccmemctl.o sbi.o sun4c_intctl.o leon3.o
-
-# GRLIB
-obj-sparc-y += grlib_gptimer.o grlib_irqmp.o grlib_apbuart.o
+obj-y += hw/$(TARGET_BASE_ARCH)/
endif
-obj-arm-y = integratorcp.o versatilepb.o arm_pic.o arm_timer.o
-obj-arm-y += arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
-obj-arm-y += versatile_pci.o
-obj-arm-y += versatile_i2c.o
-obj-arm-y += cadence_uart.o
-obj-arm-y += cadence_ttc.o
-obj-arm-y += cadence_gem.o
-obj-arm-y += xilinx_zynq.o zynq_slcr.o
-obj-arm-y += arm_gic.o
-obj-arm-y += realview_gic.o realview.o arm_sysctl.o arm11mpcore.o a9mpcore.o
-obj-arm-y += exynos4210_gic.o exynos4210_combiner.o exynos4210.o
-obj-arm-y += exynos4_boards.o exynos4210_uart.o exynos4210_pwm.o
-obj-arm-y += exynos4210_pmu.o exynos4210_mct.o exynos4210_fimd.o
-obj-arm-y += arm_l2x0.o
-obj-arm-y += arm_mptimer.o a15mpcore.o
-obj-arm-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
-obj-arm-y += highbank.o
-obj-arm-y += pl061.o
-obj-arm-y += xgmac.o
-obj-arm-y += arm-semi.o
-obj-arm-y += pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
-obj-arm-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
-obj-arm-y += gumstix.o
-obj-arm-y += zaurus.o ide/microdrive.o spitz.o tosa.o tc6393xb.o
-obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o \
- omap_gpio.o omap_intc.o omap_uart.o
-obj-arm-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o omap_synctimer.o \
- omap_gpmc.o omap_sdrc.o omap_spi.o omap_tap.o omap_l4.o
-obj-arm-y += omap_sx1.o palm.o tsc210x.o
-obj-arm-y += nseries.o blizzard.o onenand.o cbus.o tusb6010.o usb/hcd-musb.o
-obj-arm-y += mst_fpga.o mainstone.o
-obj-arm-y += z2.o
-obj-arm-y += musicpal.o bitbang_i2c.o marvell_88w8618_audio.o
-obj-arm-y += framebuffer.o
-obj-arm-y += vexpress.o
-obj-arm-y += strongarm.o
-obj-arm-y += collie.o
-obj-arm-y += pl041.o lm4549.o
-obj-arm-$(CONFIG_FDT) += device_tree.o
-
-obj-sh4-y = shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
-obj-sh4-y += sh_timer.o sh_serial.o sh_intc.o sh_pci.o sm501.o
-obj-sh4-y += ide/mmio.o
-
-obj-m68k-y = an5206.o mcf5206.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
-obj-m68k-y += m68k-semi.o dummy_m68k.o
-
-obj-s390x-y = s390-virtio-bus.o s390-virtio.o
-
-obj-alpha-y = mc146818rtc.o
-obj-alpha-y += alpha_pci.o alpha_dp264.o alpha_typhoon.o
-
-obj-xtensa-y += xtensa_pic.o
-obj-xtensa-y += xtensa_sim.o
-obj-xtensa-y += xtensa_lx60.o
-obj-xtensa-y += xtensa-semi.o
-obj-xtensa-y += core-dc232b.o
-obj-xtensa-y += core-dc233c.o
-obj-xtensa-y += core-fsf.o
+# Device tree
+ifeq ($(CONFIG_FDT), y)
+obj-$(TARGET_ARM) += device_tree.o
+obj-$(TARGET_MICROBLAZE) += device_tree.o
+obj-$(TARGET_PPC) += device_tree.o
+endif
main.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
@@ -393,12 +233,12 @@ dummy := $(foreach var, $(nested-vars), $(call unnest-var,$(var)))
ifdef QEMU_PROGW
# The linker builds a windows executable. Make also a console executable.
-$(QEMU_PROGW): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y)
+$(QEMU_PROGW): $(obj-y)
$(call LINK,$^)
$(QEMU_PROG): $(QEMU_PROGW)
$(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROGW) $(QEMU_PROG)," GEN $(TARGET_DIR)$(QEMU_PROG)")
else
-$(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y)
+$(QEMU_PROG): $(obj-y)
$(call LINK,$^)
endif
diff --git a/configure b/configure
index 4898ffb..48d78e1 100755
--- a/configure
+++ b/configure
@@ -3495,24 +3495,6 @@ case "$target" in
esac
mkdir -p $target_dir
-mkdir -p $target_dir/fpu
-mkdir -p $target_dir/tcg
-mkdir -p $target_dir/ide
-mkdir -p $target_dir/usb
-mkdir -p $target_dir/9pfs
-mkdir -p $target_dir/kvm
-if test "$target_linux_user" = yes; then
- mkdir -p $target_dir/linux-user
-fi
-if test "$target_bsd_user" = yes; then
- mkdir -p $target_dir/bsd-user
-fi
-if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
- mkdir -p $target_dir/linux-user/arm/nwfpe
-fi
-symlink "$source_path/Makefile.target" "$target_dir/Makefile"
-
-
echo "# Automatically generated by configure - do not modify" > $config_target_mak
bflt="no"
@@ -3663,6 +3645,32 @@ case "$target_arch2" in
exit 1
;;
esac
+# TARGET_BASE_ARCH needs to be defined after TARGET_ARCH
+if [ "$TARGET_BASE_ARCH" = "" ]; then
+ TARGET_BASE_ARCH=$TARGET_ARCH
+fi
+
+mkdir -p $target_dir/fpu
+mkdir -p $target_dir/tcg
+mkdir -p $target_dir/9pfs
+mkdir -p $target_dir/hw
+mkdir -p $target_dir/hw/ide
+mkdir -p $target_dir/hw/usb
+mkdir -p $target_dir/hw/kvm
+mkdir -p $target_dir/hw/$TARGET_ARCH
+mkdir -p $target_dir/hw/$TARGET_BASE_ARCH
+mkdir -p $target_dir/target-$TARGET_BASE_ARCH
+if test "$target_linux_user" = yes; then
+ mkdir -p $target_dir/linux-user
+fi
+if test "$target_bsd_user" = yes; then
+ mkdir -p $target_dir/bsd-user
+fi
+if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
+ mkdir -p $target_dir/linux-user/arm/nwfpe
+fi
+symlink "$source_path/Makefile.target" "$target_dir/Makefile"
+
case "$target_arch2" in
alpha | sparc*)
@@ -3678,10 +3686,6 @@ echo "TARGET_ARCH=$TARGET_ARCH" >> $config_target_mak
target_arch_name="`echo $TARGET_ARCH | LC_ALL=C tr '[a-z]' '[A-Z]'`"
echo "TARGET_$target_arch_name=y" >> $config_target_mak
echo "TARGET_ARCH2=$target_arch2" >> $config_target_mak
-# TARGET_BASE_ARCH needs to be defined after TARGET_ARCH
-if [ "$TARGET_BASE_ARCH" = "" ]; then
- TARGET_BASE_ARCH=$TARGET_ARCH
-fi
echo "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_target_mak
if [ "$TARGET_ABI_DIR" = "" ]; then
TARGET_ABI_DIR=$TARGET_ARCH
diff --git a/hw/alpha/Makefile b/hw/alpha/Makefile
new file mode 100644
index 0000000..af1c07f
--- /dev/null
+++ b/hw/alpha/Makefile
@@ -0,0 +1,4 @@
+obj-y = mc146818rtc.o
+obj-y += alpha_pci.o alpha_dp264.o alpha_typhoon.o
+
+obj-y := $(addprefix ../,$(obj-y))
diff --git a/hw/arm/Makefile b/hw/arm/Makefile
new file mode 100644
index 0000000..92b4f1e
--- /dev/null
+++ b/hw/arm/Makefile
@@ -0,0 +1,39 @@
+obj-y = integratorcp.o versatilepb.o arm_pic.o arm_timer.o
+obj-y += arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
+obj-y += versatile_pci.o
+obj-y += versatile_i2c.o
+obj-y += cadence_uart.o
+obj-y += cadence_ttc.o
+obj-y += cadence_gem.o
+obj-y += xilinx_zynq.o zynq_slcr.o
+obj-y += arm_gic.o
+obj-y += realview_gic.o realview.o arm_sysctl.o arm11mpcore.o a9mpcore.o
+obj-y += exynos4210_gic.o exynos4210_combiner.o exynos4210.o
+obj-y += exynos4_boards.o exynos4210_uart.o exynos4210_pwm.o
+obj-y += exynos4210_pmu.o exynos4210_mct.o exynos4210_fimd.o
+obj-y += arm_l2x0.o
+obj-y += arm_mptimer.o a15mpcore.o
+obj-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
+obj-y += highbank.o
+obj-y += pl061.o
+obj-y += xgmac.o
+obj-y += pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
+obj-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
+obj-y += gumstix.o
+obj-y += zaurus.o ide/microdrive.o spitz.o tosa.o tc6393xb.o
+obj-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o \
+ omap_gpio.o omap_intc.o omap_uart.o
+obj-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o omap_synctimer.o \
+ omap_gpmc.o omap_sdrc.o omap_spi.o omap_tap.o omap_l4.o
+obj-y += omap_sx1.o palm.o tsc210x.o
+obj-y += nseries.o blizzard.o onenand.o cbus.o tusb6010.o usb/hcd-musb.o
+obj-y += mst_fpga.o mainstone.o
+obj-y += z2.o
+obj-y += musicpal.o bitbang_i2c.o marvell_88w8618_audio.o
+obj-y += framebuffer.o
+obj-y += vexpress.o
+obj-y += strongarm.o
+obj-y += collie.o
+obj-y += pl041.o lm4549.o
+
+obj-y := $(addprefix ../,$(obj-y))
diff --git a/hw/cris/Makefile b/hw/cris/Makefile
new file mode 100644
index 0000000..aa9298a
--- /dev/null
+++ b/hw/cris/Makefile
@@ -0,0 +1,13 @@
+# Boards
+obj-y = cris_pic_cpu.o
+obj-y += cris-boot.o
+obj-y += axis_dev88.o
+
+# IO blocks
+obj-y += etraxfs_dma.o
+obj-y += etraxfs_pic.o
+obj-y += etraxfs_eth.o
+obj-y += etraxfs_timer.o
+obj-y += etraxfs_ser.o
+
+obj-y := $(addprefix ../,$(obj-y))
diff --git a/hw/i386/Makefile b/hw/i386/Makefile
new file mode 100644
index 0000000..d43f1df
--- /dev/null
+++ b/hw/i386/Makefile
@@ -0,0 +1,13 @@
+obj-y += mc146818rtc.o pc.o
+obj-y += apic_common.o apic.o kvmvapic.o
+obj-y += sga.o ioapic_common.o ioapic.o piix_pci.o
+obj-y += vmport.o
+obj-y += pci-hotplug.o smbios.o wdt_ib700.o
+obj-y += debugcon.o multiboot.o
+obj-y += pc_piix.o
+obj-y += pc_sysfw.o
+obj-$(CONFIG_XEN) += xen_platform.o xen_apic.o
+obj-$(CONFIG_KVM) += kvm/clock.o kvm/apic.o kvm/i8259.o kvm/ioapic.o kvm/i8254.o
+obj-$(CONFIG_SPICE) += qxl.o qxl-logger.o qxl-render.o
+
+obj-y := $(addprefix ../,$(obj-y))
diff --git a/hw/lm32/Makefile b/hw/lm32/Makefile
new file mode 100644
index 0000000..4e1843c
--- /dev/null
+++ b/hw/lm32/Makefile
@@ -0,0 +1,23 @@
+# LM32 boards
+obj-y += lm32_boards.o
+obj-y += milkymist.o
+
+# LM32 peripherals
+obj-y += lm32_pic.o
+obj-y += lm32_juart.o
+obj-y += lm32_timer.o
+obj-y += lm32_uart.o
+obj-y += lm32_sys.o
+obj-y += milkymist-ac97.o
+obj-y += milkymist-hpdmc.o
+obj-y += milkymist-memcard.o
+obj-y += milkymist-minimac2.o
+obj-y += milkymist-pfpu.o
+obj-y += milkymist-softusb.o
+obj-y += milkymist-sysctl.o
+obj-$(CONFIG_OPENGL) += milkymist-tmu2.o
+obj-y += milkymist-uart.o
+obj-y += milkymist-vgafb.o
+obj-y += framebuffer.o
+
+obj-y := $(addprefix ../,$(obj-y))
diff --git a/hw/m68k/Makefile b/hw/m68k/Makefile
new file mode 100644
index 0000000..93b6d25
--- /dev/null
+++ b/hw/m68k/Makefile
@@ -0,0 +1,4 @@
+obj-y = an5206.o mcf5206.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
+obj-y += dummy_m68k.o
+
+obj-y := $(addprefix ../,$(obj-y))
diff --git a/hw/microblaze/Makefile b/hw/microblaze/Makefile
new file mode 100644
index 0000000..4172442
--- /dev/null
+++ b/hw/microblaze/Makefile
@@ -0,0 +1,13 @@
+obj-y = petalogix_s3adsp1800_mmu.o
+obj-y += petalogix_ml605_mmu.o
+obj-y += microblaze_boot.o
+
+obj-y += microblaze_pic_cpu.o
+obj-y += xilinx_intc.o
+obj-y += xilinx_timer.o
+obj-y += xilinx_uartlite.o
+obj-y += xilinx_ethlite.o
+obj-y += xilinx_axidma.o
+obj-y += xilinx_axienet.o
+
+obj-y := $(addprefix ../,$(obj-y))
diff --git a/hw/mips/Makefile b/hw/mips/Makefile
new file mode 100644
index 0000000..29a5d0d
--- /dev/null
+++ b/hw/mips/Makefile
@@ -0,0 +1,6 @@
+obj-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
+obj-y += mips_addr.o mips_timer.o mips_int.o
+obj-y += gt64xxx.o mc146818rtc.o
+obj-$(CONFIG_FULONG) += bonito.o vt82c686.o mips_fulong2e.o
+
+obj-y := $(addprefix ../,$(obj-y))
diff --git a/hw/ppc/Makefile b/hw/ppc/Makefile
new file mode 100644
index 0000000..8fb7633
--- /dev/null
+++ b/hw/ppc/Makefile
@@ -0,0 +1,31 @@
+# shared objects
+obj-y = ppc.o ppc_booke.o
+# PREP target
+obj-y += mc146818rtc.o
+obj-y += ppc_prep.o
+# OldWorld PowerMac
+obj-y += ppc_oldworld.o
+# NewWorld PowerMac
+obj-y += ppc_newworld.o
+# IBM pSeries (sPAPR)
+obj-$(CONFIG_PSERIES) += spapr.o spapr_hcall.o spapr_rtas.o spapr_vio.o
+obj-$(CONFIG_PSERIES) += xics.o spapr_vty.o spapr_llan.o spapr_vscsi.o
+obj-$(CONFIG_PSERIES) += spapr_pci.o device-hotplug.o pci-hotplug.o
+# PowerPC 4xx boards
+obj-y += ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
+obj-y += ppc440_bamboo.o
+# PowerPC E500 boards
+obj-y += ppce500_mpc8544ds.o mpc8544_guts.o ppce500_spin.o
+# PowerPC 440 Xilinx ML507 reference board.
+obj-y += virtex_ml507.o
+obj-$(CONFIG_KVM) += kvm_ppc.o
+# PowerPC OpenPIC
+obj-y += openpic.o
+
+# Xilinx PPC peripherals
+obj-y += xilinx_intc.o
+obj-y += xilinx_timer.o
+obj-y += xilinx_uartlite.o
+obj-y += xilinx_ethlite.o
+
+obj-y := $(addprefix ../,$(obj-y))
diff --git a/hw/s390x/Makefile b/hw/s390x/Makefile
new file mode 100644
index 0000000..dcdcac8
--- /dev/null
+++ b/hw/s390x/Makefile
@@ -0,0 +1,3 @@
+obj-y = s390-virtio-bus.o s390-virtio.o
+
+obj-y := $(addprefix ../,$(obj-y))
diff --git a/hw/sh4/Makefile b/hw/sh4/Makefile
new file mode 100644
index 0000000..68c5921
--- /dev/null
+++ b/hw/sh4/Makefile
@@ -0,0 +1,5 @@
+obj-y = shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
+obj-y += sh_timer.o sh_serial.o sh_intc.o sh_pci.o sm501.o
+obj-y += ide/mmio.o
+
+obj-y := $(addprefix ../,$(obj-y))
diff --git a/hw/sparc/Makefile b/hw/sparc/Makefile
new file mode 100644
index 0000000..a39a511
--- /dev/null
+++ b/hw/sparc/Makefile
@@ -0,0 +1,8 @@
+obj-y = sun4m.o lance.o tcx.o sun4m_iommu.o slavio_intctl.o
+obj-y += slavio_timer.o slavio_misc.o sparc32_dma.o
+obj-y += cs4231.o eccmemctl.o sbi.o sun4c_intctl.o leon3.o
+
+# GRLIB
+obj-y += grlib_gptimer.o grlib_irqmp.o grlib_apbuart.o
+
+obj-y := $(addprefix ../,$(obj-y))
diff --git a/hw/sparc64/Makefile b/hw/sparc64/Makefile
new file mode 100644
index 0000000..8c65fc4
--- /dev/null
+++ b/hw/sparc64/Makefile
@@ -0,0 +1,4 @@
+obj-y = sun4u.o apb_pci.o
+obj-y += mc146818rtc.o
+
+obj-y := $(addprefix ../,$(obj-y))
diff --git a/hw/xtensa/Makefile b/hw/xtensa/Makefile
new file mode 100644
index 0000000..79698e9
--- /dev/null
+++ b/hw/xtensa/Makefile
@@ -0,0 +1,5 @@
+obj-y += xtensa_pic.o
+obj-y += xtensa_sim.o
+obj-y += xtensa_lx60.o
+
+obj-y := $(addprefix ../,$(obj-y))
diff --git a/target-alpha/Makefile b/target-alpha/Makefile
new file mode 100644
index 0000000..c574c9e
--- /dev/null
+++ b/target-alpha/Makefile
@@ -0,0 +1 @@
+# still empty
diff --git a/target-arm/Makefile b/target-arm/Makefile
new file mode 100644
index 0000000..f5bb920
--- /dev/null
+++ b/target-arm/Makefile
@@ -0,0 +1 @@
+obj-y += arm-semi.o
diff --git a/arm-semi.c b/target-arm/arm-semi.c
similarity index 100%
rename from arm-semi.c
rename to target-arm/arm-semi.c
diff --git a/target-cris/Makefile b/target-cris/Makefile
new file mode 100644
index 0000000..c574c9e
--- /dev/null
+++ b/target-cris/Makefile
@@ -0,0 +1 @@
+# still empty
diff --git a/target-i386/Makefile b/target-i386/Makefile
new file mode 100644
index 0000000..2422fc3
--- /dev/null
+++ b/target-i386/Makefile
@@ -0,0 +1,4 @@
+obj-$(CONFIG_KVM) += hyperv.o
+obj-$(CONFIG_LINUX_USER) += ioport-user.o
+obj-$(CONFIG_BSD_USER) += ioport-user.o
+
diff --git a/ioport-user.c b/target-i386/ioport-user.c
similarity index 100%
rename from ioport-user.c
rename to target-i386/ioport-user.c
diff --git a/target-lm32/Makefile b/target-lm32/Makefile
new file mode 100644
index 0000000..c574c9e
--- /dev/null
+++ b/target-lm32/Makefile
@@ -0,0 +1 @@
+# still empty
diff --git a/target-m68k/Makefile b/target-m68k/Makefile
new file mode 100644
index 0000000..e73a5ba
--- /dev/null
+++ b/target-m68k/Makefile
@@ -0,0 +1 @@
+obj-y += m68k-semi.o
diff --git a/m68k-semi.c b/target-m68k/m68k-semi.c
similarity index 100%
rename from m68k-semi.c
rename to target-m68k/m68k-semi.c
diff --git a/target-microblaze/Makefile b/target-microblaze/Makefile
new file mode 100644
index 0000000..c574c9e
--- /dev/null
+++ b/target-microblaze/Makefile
@@ -0,0 +1 @@
+# still empty
diff --git a/target-mips/Makefile b/target-mips/Makefile
new file mode 100644
index 0000000..c574c9e
--- /dev/null
+++ b/target-mips/Makefile
@@ -0,0 +1 @@
+# still empty
diff --git a/target-ppc/Makefile b/target-ppc/Makefile
new file mode 100644
index 0000000..c574c9e
--- /dev/null
+++ b/target-ppc/Makefile
@@ -0,0 +1 @@
+# still empty
diff --git a/target-s390x/Makefile b/target-s390x/Makefile
new file mode 100644
index 0000000..c574c9e
--- /dev/null
+++ b/target-s390x/Makefile
@@ -0,0 +1 @@
+# still empty
diff --git a/target-sh4/Makefile b/target-sh4/Makefile
new file mode 100644
index 0000000..c574c9e
--- /dev/null
+++ b/target-sh4/Makefile
@@ -0,0 +1 @@
+# still empty
diff --git a/target-sparc/Makefile b/target-sparc/Makefile
new file mode 100644
index 0000000..c574c9e
--- /dev/null
+++ b/target-sparc/Makefile
@@ -0,0 +1 @@
+# still empty
diff --git a/target-unicore32/Makefile b/target-unicore32/Makefile
new file mode 100644
index 0000000..c574c9e
--- /dev/null
+++ b/target-unicore32/Makefile
@@ -0,0 +1 @@
+# still empty
diff --git a/target-xtensa/Makefile b/target-xtensa/Makefile
new file mode 100644
index 0000000..a49ca8d
--- /dev/null
+++ b/target-xtensa/Makefile
@@ -0,0 +1,4 @@
+obj-y += xtensa-semi.o
+obj-y += core-dc232b.o
+obj-y += core-dc233c.o
+obj-y += core-fsf.o
diff --git a/xtensa-semi.c b/target-xtensa/xtensa-semi.c
similarity index 100%
rename from xtensa-semi.c
rename to target-xtensa/xtensa-semi.c
--
1.7.10.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH 06/24] move libobj-y variable to nested Makefile
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
` (4 preceding siblings ...)
2012-06-03 12:25 ` [Qemu-devel] [PATCH 05/24] move obj-TARGET-y variables " Paolo Bonzini
@ 2012-06-03 12:25 ` Paolo Bonzini
2012-06-03 13:42 ` Blue Swirl
2012-06-03 12:25 ` [Qemu-devel] [PATCH 07/24] move other target-*/ objects to nested Makefiles Paolo Bonzini
` (21 subsequent siblings)
27 siblings, 1 reply; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 12:25 UTC (permalink / raw)
To: qemu-devel
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile.target | 42 ++++++++----------------------------------
configure | 6 ------
target-alpha/Makefile | 3 ++-
target-arm/Makefile | 2 ++
target-cris/Makefile | 3 ++-
target-i386/Makefile | 2 +-
target-lm32/Makefile | 2 +-
target-m68k/Makefile | 1 +
target-microblaze/Makefile | 3 ++-
target-mips/Makefile | 2 +-
target-ppc/Makefile | 2 +-
target-s390x/Makefile | 2 +-
target-sh4/Makefile | 2 +-
target-sparc/Makefile | 6 +++++-
target-unicore32/Makefile | 2 +-
target-xtensa/Makefile | 1 +
16 files changed, 30 insertions(+), 51 deletions(-)
diff --git a/Makefile.target b/Makefile.target
index f64419d..f323ed2 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -76,41 +76,20 @@ all: $(PROGS) stap
#########################################################
# cpu emulator library
-libobj-y = exec.o translate-all.o cpu-exec.o translate.o
-libobj-y += tcg/tcg.o tcg/optimize.o
-libobj-$(CONFIG_TCG_INTERPRETER) += tci.o
-libobj-y += fpu/softfloat.o
-ifneq ($(TARGET_BASE_ARCH), sparc)
-ifneq ($(TARGET_BASE_ARCH), alpha)
-libobj-y += op_helper.o
-endif
-endif
-libobj-y += helper.o
-ifneq ($(TARGET_BASE_ARCH), ppc)
-libobj-y += cpu.o
-endif
-libobj-$(TARGET_SPARC64) += vis_helper.o
-libobj-$(CONFIG_NEED_MMU) += mmu.o
-libobj-$(TARGET_ARM) += neon_helper.o iwmmxt_helper.o
-ifeq ($(TARGET_BASE_ARCH), sparc)
-libobj-y += fop_helper.o cc_helper.o win_helper.o mmu_helper.o ldst_helper.o
-endif
-libobj-$(TARGET_SPARC) += int32_helper.o
-libobj-$(TARGET_SPARC64) += int64_helper.o
-libobj-$(TARGET_ALPHA) += int_helper.o fpu_helper.o sys_helper.o mem_helper.o
-
-libobj-y += disas.o
-libobj-$(CONFIG_TCI_DIS) += tci-dis.o
-
+obj-y = exec.o translate-all.o cpu-exec.o translate.o
+obj-y += tcg/tcg.o tcg/optimize.o
+obj-$(CONFIG_TCG_INTERPRETER) += tci.o
+obj-y += fpu/softfloat.o
+obj-y += disas.o
+obj-$(CONFIG_TCI_DIS) += tci-dis.o
obj-y += target-$(TARGET_BASE_ARCH)/
+obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o
tci-dis.o: QEMU_CFLAGS += -I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/tci
# HELPER_CFLAGS is used for all the legacy code compiled with static register
# variables
-ifneq ($(TARGET_BASE_ARCH), sparc)
-op_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
-endif
+%/op_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
user-exec.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
# Note: this is a workaround. The real fix is to avoid compiling
@@ -130,7 +109,6 @@ obj-y += gdbstub.o thunk.o user-exec.o $(oslib-obj-y)
obj-y += $(addprefix ../, $(universal-obj-y))
obj-y += $(addprefix ../libuser/, $(user-obj-y))
obj-y += $(addprefix ../libdis-user/, $(libdis-y))
-obj-y += $(libobj-y)
endif #CONFIG_LINUX_USER
@@ -147,7 +125,6 @@ obj-y += gdbstub.o user-exec.o
obj-y += $(addprefix ../, $(universal-obj-y))
obj-y += $(addprefix ../libuser/, $(user-obj-y))
obj-y += $(addprefix ../libdis-user/, $(libdis-y))
-obj-y += $(libobj-y)
endif #CONFIG_BSD_USER
@@ -212,7 +189,6 @@ GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h
obj-y += $(addprefix ../, $(universal-obj-y))
obj-y += $(addprefix ../, $(common-obj-y))
obj-y += $(addprefix ../libdis/, $(libdis-y))
-obj-y += $(libobj-y)
obj-y += $(addprefix $(HWDIR)/, $(hw-obj-y))
obj-y += $(addprefix ../, $(trace-obj-y))
@@ -226,8 +202,6 @@ obj-$(CONFIG_SMARTCARD_NSS) += $(addprefix ../libcacard/, $(libcacard-y))
endif # CONFIG_BSD_USER
endif # CONFIG_LINUX_USER
-obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o
-
nested-vars = obj-y
dummy := $(foreach var, $(nested-vars), $(call unnest-var,$(var)))
diff --git a/configure b/configure
index 48d78e1..082f0e1 100755
--- a/configure
+++ b/configure
@@ -3884,12 +3884,6 @@ if test "$target_softmmu" = "yes" ; then
esac
fi
-if test "$target_softmmu" = "yes" -a \( \
- "$TARGET_ARCH" = "microblaze" -o \
- "$TARGET_ARCH" = "cris" \) ; then
- echo "CONFIG_NEED_MMU=y" >> $config_target_mak
-fi
-
if test "$gprof" = "yes" ; then
echo "TARGET_GPROF=yes" >> $config_target_mak
if test "$target_linux_user" = "yes" ; then
diff --git a/target-alpha/Makefile b/target-alpha/Makefile
index c574c9e..9a72870 100644
--- a/target-alpha/Makefile
+++ b/target-alpha/Makefile
@@ -1 +1,2 @@
-# still empty
+obj-y += helper.o cpu.o
+obj-y += int_helper.o fpu_helper.o sys_helper.o mem_helper.o
diff --git a/target-arm/Makefile b/target-arm/Makefile
index f5bb920..64b7830 100644
--- a/target-arm/Makefile
+++ b/target-arm/Makefile
@@ -1 +1,3 @@
obj-y += arm-semi.o
+obj-y += op_helper.o helper.o cpu.o
+obj-y += neon_helper.o iwmmxt_helper.o
diff --git a/target-cris/Makefile b/target-cris/Makefile
index c574c9e..8fc92b4 100644
--- a/target-cris/Makefile
+++ b/target-cris/Makefile
@@ -1 +1,2 @@
-# still empty
+obj-y += op_helper.o helper.o cpu.o
+obj-$(CONFIG_SOFTMMU) += mmu.o
diff --git a/target-i386/Makefile b/target-i386/Makefile
index 2422fc3..c64b207 100644
--- a/target-i386/Makefile
+++ b/target-i386/Makefile
@@ -1,4 +1,4 @@
+obj-y += op_helper.o helper.o cpu.o
obj-$(CONFIG_KVM) += hyperv.o
obj-$(CONFIG_LINUX_USER) += ioport-user.o
obj-$(CONFIG_BSD_USER) += ioport-user.o
-
diff --git a/target-lm32/Makefile b/target-lm32/Makefile
index c574c9e..15826d1 100644
--- a/target-lm32/Makefile
+++ b/target-lm32/Makefile
@@ -1 +1 @@
-# still empty
+obj-y += op_helper.o helper.o cpu.o
diff --git a/target-m68k/Makefile b/target-m68k/Makefile
index e73a5ba..e43774f 100644
--- a/target-m68k/Makefile
+++ b/target-m68k/Makefile
@@ -1 +1,2 @@
obj-y += m68k-semi.o
+obj-y += op_helper.o helper.o cpu.o
diff --git a/target-microblaze/Makefile b/target-microblaze/Makefile
index c574c9e..8fc92b4 100644
--- a/target-microblaze/Makefile
+++ b/target-microblaze/Makefile
@@ -1 +1,2 @@
-# still empty
+obj-y += op_helper.o helper.o cpu.o
+obj-$(CONFIG_SOFTMMU) += mmu.o
diff --git a/target-mips/Makefile b/target-mips/Makefile
index c574c9e..15826d1 100644
--- a/target-mips/Makefile
+++ b/target-mips/Makefile
@@ -1 +1 @@
-# still empty
+obj-y += op_helper.o helper.o cpu.o
diff --git a/target-ppc/Makefile b/target-ppc/Makefile
index c574c9e..8413532 100644
--- a/target-ppc/Makefile
+++ b/target-ppc/Makefile
@@ -1 +1 @@
-# still empty
+obj-y += op_helper.o helper.o
diff --git a/target-s390x/Makefile b/target-s390x/Makefile
index c574c9e..15826d1 100644
--- a/target-s390x/Makefile
+++ b/target-s390x/Makefile
@@ -1 +1 @@
-# still empty
+obj-y += op_helper.o helper.o cpu.o
diff --git a/target-sh4/Makefile b/target-sh4/Makefile
index c574c9e..15826d1 100644
--- a/target-sh4/Makefile
+++ b/target-sh4/Makefile
@@ -1 +1 @@
-# still empty
+obj-y += op_helper.o helper.o cpu.o
diff --git a/target-sparc/Makefile b/target-sparc/Makefile
index c574c9e..4bd1a4c 100644
--- a/target-sparc/Makefile
+++ b/target-sparc/Makefile
@@ -1 +1,5 @@
-# still empty
+obj-y += helper.o cpu.o
+obj-y += fop_helper.o cc_helper.o win_helper.o mmu_helper.o ldst_helper.o
+obj-$(TARGET_SPARC) += int32_helper.o
+obj-$(TARGET_SPARC64) += int64_helper.o
+obj-$(TARGET_SPARC64) += vis_helper.o
diff --git a/target-unicore32/Makefile b/target-unicore32/Makefile
index c574c9e..15826d1 100644
--- a/target-unicore32/Makefile
+++ b/target-unicore32/Makefile
@@ -1 +1 @@
-# still empty
+obj-y += op_helper.o helper.o cpu.o
diff --git a/target-xtensa/Makefile b/target-xtensa/Makefile
index a49ca8d..7644065 100644
--- a/target-xtensa/Makefile
+++ b/target-xtensa/Makefile
@@ -2,3 +2,4 @@ obj-y += xtensa-semi.o
obj-y += core-dc232b.o
obj-y += core-dc233c.o
obj-y += core-fsf.o
+obj-y += op_helper.o helper.o cpu.o
--
1.7.10.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH 07/24] move other target-*/ objects to nested Makefiles
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
` (5 preceding siblings ...)
2012-06-03 12:25 ` [Qemu-devel] [PATCH 06/24] move libobj-y variable " Paolo Bonzini
@ 2012-06-03 12:25 ` Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 08/24] move rules for nesting to Makefile.objs Paolo Bonzini
` (20 subsequent siblings)
27 siblings, 0 replies; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 12:25 UTC (permalink / raw)
To: qemu-devel
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile.target | 6 +++---
target-alpha/Makefile | 3 ++-
target-arm/Makefile | 3 ++-
target-cris/Makefile | 4 ++--
target-i386/Makefile | 4 +++-
target-lm32/Makefile | 3 ++-
target-m68k/Makefile | 3 ++-
target-microblaze/Makefile | 4 ++--
target-mips/Makefile | 3 ++-
target-ppc/Makefile | 4 +++-
target-s390x/Makefile | 4 +++-
target-sh4/Makefile | 3 ++-
target-sparc/Makefile | 3 ++-
target-unicore32/Makefile | 3 ++-
target-xtensa/Makefile | 3 ++-
15 files changed, 34 insertions(+), 19 deletions(-)
diff --git a/Makefile.target b/Makefile.target
index f323ed2..ce9296d 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -76,7 +76,7 @@ all: $(PROGS) stap
#########################################################
# cpu emulator library
-obj-y = exec.o translate-all.o cpu-exec.o translate.o
+obj-y = exec.o translate-all.o cpu-exec.o
obj-y += tcg/tcg.o tcg/optimize.o
obj-$(CONFIG_TCG_INTERPRETER) += tci.o
obj-y += fpu/softfloat.o
@@ -132,7 +132,7 @@ endif #CONFIG_BSD_USER
# System emulator target
ifdef CONFIG_SOFTMMU
-obj-y += arch_init.o cpus.o monitor.o machine.o gdbstub.o balloon.o ioport.o
+obj-y += arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o
# virtio has to be here due to weird dependency between PCI and virtio-net.
# need to fix this properly
obj-$(CONFIG_NO_PCI) += pci-stub.o
@@ -141,7 +141,7 @@ obj-$(CONFIG_VIRTIO) += virtio-scsi.o
obj-y += vhost_net.o
obj-$(CONFIG_VHOST_NET) += vhost.o
obj-$(CONFIG_REALLY_VIRTFS) += 9pfs/virtio-9p-device.o
-obj-$(CONFIG_KVM) += kvm.o kvm-all.o
+obj-$(CONFIG_KVM) += kvm-all.o
obj-$(CONFIG_NO_KVM) += kvm-stub.o
obj-$(CONFIG_VGA) += vga.o
obj-y += memory.o savevm.o cputlb.o
diff --git a/target-alpha/Makefile b/target-alpha/Makefile
index 9a72870..590304c 100644
--- a/target-alpha/Makefile
+++ b/target-alpha/Makefile
@@ -1,2 +1,3 @@
-obj-y += helper.o cpu.o
+obj-$(CONFIG_SOFTMMU) += machine.o
+obj-y += translate.o helper.o cpu.o
obj-y += int_helper.o fpu_helper.o sys_helper.o mem_helper.o
diff --git a/target-arm/Makefile b/target-arm/Makefile
index 64b7830..b6f1a9e 100644
--- a/target-arm/Makefile
+++ b/target-arm/Makefile
@@ -1,3 +1,4 @@
obj-y += arm-semi.o
-obj-y += op_helper.o helper.o cpu.o
+obj-$(CONFIG_SOFTMMU) += machine.o
+obj-y += translate.o op_helper.o helper.o cpu.o
obj-y += neon_helper.o iwmmxt_helper.o
diff --git a/target-cris/Makefile b/target-cris/Makefile
index 8fc92b4..afb87bc 100644
--- a/target-cris/Makefile
+++ b/target-cris/Makefile
@@ -1,2 +1,2 @@
-obj-y += op_helper.o helper.o cpu.o
-obj-$(CONFIG_SOFTMMU) += mmu.o
+obj-y += translate.o op_helper.o helper.o cpu.o
+obj-$(CONFIG_SOFTMMU) += mmu.o machine.o
diff --git a/target-i386/Makefile b/target-i386/Makefile
index c64b207..2bfa156 100644
--- a/target-i386/Makefile
+++ b/target-i386/Makefile
@@ -1,4 +1,6 @@
-obj-y += op_helper.o helper.o cpu.o
+obj-$(CONFIG_SOFTMMU) += machine.o
+obj-y += translate.o op_helper.o helper.o cpu.o
obj-$(CONFIG_KVM) += hyperv.o
obj-$(CONFIG_LINUX_USER) += ioport-user.o
obj-$(CONFIG_BSD_USER) += ioport-user.o
+obj-$(CONFIG_KVM) += kvm.o
diff --git a/target-lm32/Makefile b/target-lm32/Makefile
index 15826d1..dd9d914 100644
--- a/target-lm32/Makefile
+++ b/target-lm32/Makefile
@@ -1 +1,2 @@
-obj-y += op_helper.o helper.o cpu.o
+obj-$(CONFIG_SOFTMMU) += machine.o
+obj-y += translate.o op_helper.o helper.o cpu.o
diff --git a/target-m68k/Makefile b/target-m68k/Makefile
index e43774f..265a78f 100644
--- a/target-m68k/Makefile
+++ b/target-m68k/Makefile
@@ -1,2 +1,3 @@
obj-y += m68k-semi.o
-obj-y += op_helper.o helper.o cpu.o
+obj-$(CONFIG_SOFTMMU) += machine.o
+obj-y += translate.o op_helper.o helper.o cpu.o
diff --git a/target-microblaze/Makefile b/target-microblaze/Makefile
index 8fc92b4..95ca018 100644
--- a/target-microblaze/Makefile
+++ b/target-microblaze/Makefile
@@ -1,2 +1,2 @@
-obj-y += op_helper.o helper.o cpu.o
-obj-$(CONFIG_SOFTMMU) += mmu.o
+obj-$(CONFIG_SOFTMMU) += mmu.o machine.o
+obj-y += translate.o op_helper.o helper.o cpu.o
diff --git a/target-mips/Makefile b/target-mips/Makefile
index 15826d1..dd9d914 100644
--- a/target-mips/Makefile
+++ b/target-mips/Makefile
@@ -1 +1,2 @@
-obj-y += op_helper.o helper.o cpu.o
+obj-$(CONFIG_SOFTMMU) += machine.o
+obj-y += translate.o op_helper.o helper.o cpu.o
diff --git a/target-ppc/Makefile b/target-ppc/Makefile
index 8413532..2c32f9c 100644
--- a/target-ppc/Makefile
+++ b/target-ppc/Makefile
@@ -1 +1,3 @@
-obj-y += op_helper.o helper.o
+obj-$(CONFIG_SOFTMMU) += machine.o
+obj-y += translate.o op_helper.o helper.o
+obj-$(CONFIG_KVM) += kvm.o
diff --git a/target-s390x/Makefile b/target-s390x/Makefile
index 15826d1..a597327 100644
--- a/target-s390x/Makefile
+++ b/target-s390x/Makefile
@@ -1 +1,3 @@
-obj-y += op_helper.o helper.o cpu.o
+obj-$(CONFIG_SOFTMMU) += machine.o
+obj-y += translate.o op_helper.o helper.o cpu.o
+obj-$(CONFIG_KVM) += kvm.o
diff --git a/target-sh4/Makefile b/target-sh4/Makefile
index 15826d1..dd9d914 100644
--- a/target-sh4/Makefile
+++ b/target-sh4/Makefile
@@ -1 +1,2 @@
-obj-y += op_helper.o helper.o cpu.o
+obj-$(CONFIG_SOFTMMU) += machine.o
+obj-y += translate.o op_helper.o helper.o cpu.o
diff --git a/target-sparc/Makefile b/target-sparc/Makefile
index 4bd1a4c..9fc42ea 100644
--- a/target-sparc/Makefile
+++ b/target-sparc/Makefile
@@ -1,4 +1,5 @@
-obj-y += helper.o cpu.o
+obj-$(CONFIG_SOFTMMU) += machine.o
+obj-y += translate.o helper.o cpu.o
obj-y += fop_helper.o cc_helper.o win_helper.o mmu_helper.o ldst_helper.o
obj-$(TARGET_SPARC) += int32_helper.o
obj-$(TARGET_SPARC64) += int64_helper.o
diff --git a/target-unicore32/Makefile b/target-unicore32/Makefile
index 15826d1..dd9d914 100644
--- a/target-unicore32/Makefile
+++ b/target-unicore32/Makefile
@@ -1 +1,2 @@
-obj-y += op_helper.o helper.o cpu.o
+obj-$(CONFIG_SOFTMMU) += machine.o
+obj-y += translate.o op_helper.o helper.o cpu.o
diff --git a/target-xtensa/Makefile b/target-xtensa/Makefile
index 7644065..292c6d2 100644
--- a/target-xtensa/Makefile
+++ b/target-xtensa/Makefile
@@ -2,4 +2,5 @@ obj-y += xtensa-semi.o
obj-y += core-dc232b.o
obj-y += core-dc233c.o
obj-y += core-fsf.o
-obj-y += op_helper.o helper.o cpu.o
+obj-$(CONFIG_SOFTMMU) += machine.o
+obj-y += translate.o op_helper.o helper.o cpu.o
--
1.7.10.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH 08/24] move rules for nesting to Makefile.objs
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
` (6 preceding siblings ...)
2012-06-03 12:25 ` [Qemu-devel] [PATCH 07/24] move other target-*/ objects to nested Makefiles Paolo Bonzini
@ 2012-06-03 12:25 ` Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 09/24] use nested Makefile rules for qom/ objects Paolo Bonzini
` (19 subsequent siblings)
27 siblings, 0 replies; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 12:25 UTC (permalink / raw)
To: qemu-devel
At this point we will start adding nesting behavior to other files
than Makefile.target. Because Makefile.objs is included by
Makefile.target, it is simpler to move the processing of
subdirectories there.
To enable this, only add per-target files to obj-y. Use a separate
variable for the linker dependencies, all-obj-y. This variable includes
obj-y and also all objects that are taken from other directories.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile.objs | 2 ++
Makefile.target | 47 ++++++++++++++++++++++-------------------------
2 files changed, 24 insertions(+), 25 deletions(-)
diff --git a/Makefile.objs b/Makefile.objs
index 1daa92c..2eed180 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -468,3 +468,5 @@ vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS)
QEMU_CFLAGS+=$(GLIB_CFLAGS)
+nested-vars += # ...
+dummy := $(foreach var, $(nested-vars), $(call unnest-var,$(var)))
diff --git a/Makefile.target b/Makefile.target
index ce9296d..e4bc550 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -19,8 +19,6 @@ QEMU_CFLAGS += -I../linux-headers
endif
QEMU_CFLAGS += -I.. -I$(TARGET_PATH) -DNEED_CPU_H
-include $(SRC_PATH)/Makefile.objs
-
QEMU_CFLAGS+=-I$(SRC_PATH)/include
ifdef CONFIG_USER_ONLY
@@ -106,10 +104,6 @@ QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) -I$(SRC_PATH)/linux-user
obj-y += linux-user/
obj-y += gdbstub.o thunk.o user-exec.o $(oslib-obj-y)
-obj-y += $(addprefix ../, $(universal-obj-y))
-obj-y += $(addprefix ../libuser/, $(user-obj-y))
-obj-y += $(addprefix ../libdis-user/, $(libdis-y))
-
endif #CONFIG_LINUX_USER
#########################################################
@@ -122,10 +116,6 @@ QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
obj-y += bsd-user/
obj-y += gdbstub.o user-exec.o
-obj-y += $(addprefix ../, $(universal-obj-y))
-obj-y += $(addprefix ../libuser/, $(user-obj-y))
-obj-y += $(addprefix ../libdis-user/, $(libdis-y))
-
endif #CONFIG_BSD_USER
#########################################################
@@ -186,33 +176,40 @@ main.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h
-obj-y += $(addprefix ../, $(universal-obj-y))
-obj-y += $(addprefix ../, $(common-obj-y))
-obj-y += $(addprefix ../libdis/, $(libdis-y))
-obj-y += $(addprefix $(HWDIR)/, $(hw-obj-y))
-obj-y += $(addprefix ../, $(trace-obj-y))
-
endif # CONFIG_SOFTMMU
-ifndef CONFIG_LINUX_USER
-ifndef CONFIG_BSD_USER
+nested-vars += obj-y
+
+# This resolves all nested paths, so it must come last
+include $(SRC_PATH)/Makefile.objs
+
+all-obj-y = $(obj-y)
+all-obj-y += $(addprefix ../, $(universal-obj-y))
+
+ifdef CONFIG_SOFTMMU
+
+all-obj-y += $(addprefix ../, $(common-obj-y))
+all-obj-y += $(addprefix ../libdis/, $(libdis-y))
+all-obj-y += $(addprefix $(HWDIR)/, $(hw-obj-y))
+all-obj-y += $(addprefix ../, $(trace-obj-y))
+
# libcacard needs qemu-thread support, and besides is only needed by devices
# so not requires with linux-user / bsd-user targets
-obj-$(CONFIG_SMARTCARD_NSS) += $(addprefix ../libcacard/, $(libcacard-y))
-endif # CONFIG_BSD_USER
-endif # CONFIG_LINUX_USER
+all-obj-$(CONFIG_SMARTCARD_NSS) += $(addprefix ../libcacard/, $(libcacard-y))
-nested-vars = obj-y
-dummy := $(foreach var, $(nested-vars), $(call unnest-var,$(var)))
+else
+all-obj-y += $(addprefix ../libuser/, $(user-obj-y))
+all-obj-y += $(addprefix ../libdis-user/, $(libdis-y))
+endif #CONFIG_LINUX_USER
ifdef QEMU_PROGW
# The linker builds a windows executable. Make also a console executable.
-$(QEMU_PROGW): $(obj-y)
+$(QEMU_PROGW): $(all-obj-y)
$(call LINK,$^)
$(QEMU_PROG): $(QEMU_PROGW)
$(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROGW) $(QEMU_PROG)," GEN $(TARGET_DIR)$(QEMU_PROG)")
else
-$(QEMU_PROG): $(obj-y)
+$(QEMU_PROG): $(all-obj-y)
$(call LINK,$^)
endif
--
1.7.10.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH 09/24] use nested Makefile rules for qom/ objects
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
` (7 preceding siblings ...)
2012-06-03 12:25 ` [Qemu-devel] [PATCH 08/24] move rules for nesting to Makefile.objs Paolo Bonzini
@ 2012-06-03 12:25 ` Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 10/24] move block/ objects to nested Makefile Paolo Bonzini
` (18 subsequent siblings)
27 siblings, 0 replies; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 12:25 UTC (permalink / raw)
To: qemu-devel
qom/ already used a separate makefile. Convert it to use relative
paths, and make it declare both common-obj-y and user-obj-y. This
way, the upper makefiles do not need to know that some QOM files
are compiled twice.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile.objs | 13 +++++++------
qom/Makefile | 6 ++++--
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/Makefile.objs b/Makefile.objs
index 2eed180..d823968 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -12,9 +12,7 @@ universal-obj-y += $(qobject-obj-y)
#######################################################################
# QOM
-include $(SRC_PATH)/qom/Makefile
-qom-obj-y = $(addprefix qom/, $(qom-y))
-qom-obj-twice-y = $(addprefix qom/, $(qom-twice-y))
+qom-obj-y = qom/
universal-obj-y += $(qom-obj-y)
@@ -94,7 +92,7 @@ fsdev-obj-$(CONFIG_VIRTFS) += $(addprefix fsdev/, $(fsdev-nested-y))
common-obj-y = $(block-obj-y) blockdev.o
common-obj-y += $(net-obj-y)
-common-obj-y += $(qom-obj-twice-y)
+common-obj-y += qom/
common-obj-$(CONFIG_LINUX) += $(fsdev-obj-$(CONFIG_LINUX))
common-obj-y += readline.o console.o cursor.o
common-obj-y += $(oslib-obj-y)
@@ -202,7 +200,7 @@ user-obj-y += cutils.o cache-utils.o
user-obj-y += module.o
user-obj-y += qemu-user.o
user-obj-y += $(trace-obj-y)
-user-obj-y += $(qom-obj-twice-y)
+user-obj-y += qom/
######################################################################
# libhw
@@ -468,5 +466,8 @@ vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS)
QEMU_CFLAGS+=$(GLIB_CFLAGS)
-nested-vars += # ...
+nested-vars += \
+ qom-obj-y \
+ user-obj-y \
+ common-obj-y
dummy := $(foreach var, $(nested-vars), $(call unnest-var,$(var)))
diff --git a/qom/Makefile b/qom/Makefile
index 34c6de5..5ef060a 100644
--- a/qom/Makefile
+++ b/qom/Makefile
@@ -1,2 +1,4 @@
-qom-y = object.o container.o qom-qobject.o
-qom-twice-y = cpu.o
+qom-obj-y = object.o container.o qom-qobject.o
+qom-obj-twice-y = cpu.o
+common-obj-y = $(qom-obj-twice-y)
+user-obj-y = $(qom-obj-twice-y)
--
1.7.10.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH 10/24] move block/ objects to nested Makefile
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
` (8 preceding siblings ...)
2012-06-03 12:25 ` [Qemu-devel] [PATCH 09/24] use nested Makefile rules for qom/ objects Paolo Bonzini
@ 2012-06-03 12:25 ` Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 11/24] move net/ " Paolo Bonzini
` (17 subsequent siblings)
27 siblings, 0 replies; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 12:25 UTC (permalink / raw)
To: qemu-devel
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile.objs | 16 ++--------------
block/Makefile | 11 +++++++++++
2 files changed, 13 insertions(+), 14 deletions(-)
create mode 100644 block/Makefile
diff --git a/Makefile.objs b/Makefile.objs
index d823968..7c8a997 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -45,20 +45,7 @@ block-obj-y += nbd.o block.o aio.o aes.o qemu-config.o qemu-progress.o qemu-sock
block-obj-y += $(coroutine-obj-y) $(qobject-obj-y) $(version-obj-y)
block-obj-$(CONFIG_POSIX) += posix-aio-compat.o
block-obj-$(CONFIG_LINUX_AIO) += linux-aio.o
-
-block-nested-y += raw.o cow.o qcow.o vdi.o vmdk.o cloop.o dmg.o bochs.o vpc.o vvfat.o
-block-nested-y += qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snapshot.o qcow2-cache.o
-block-nested-y += qed.o qed-gencb.o qed-l2-cache.o qed-table.o qed-cluster.o
-block-nested-y += qed-check.o
-block-nested-y += parallels.o nbd.o blkdebug.o sheepdog.o blkverify.o
-block-nested-y += stream.o
-block-nested-$(CONFIG_WIN32) += raw-win32.o
-block-nested-$(CONFIG_POSIX) += raw-posix.o
-block-nested-$(CONFIG_LIBISCSI) += iscsi.o
-block-nested-$(CONFIG_CURL) += curl.o
-block-nested-$(CONFIG_RBD) += rbd.o
-
-block-obj-y += $(addprefix block/, $(block-nested-y))
+block-obj-y += block/
net-obj-y = net.o
net-nested-y = queue.o checksum.o util.o
@@ -467,6 +454,7 @@ vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS)
QEMU_CFLAGS+=$(GLIB_CFLAGS)
nested-vars += \
+ block-obj-y \
qom-obj-y \
user-obj-y \
common-obj-y
diff --git a/block/Makefile b/block/Makefile
new file mode 100644
index 0000000..b5754d3
--- /dev/null
+++ b/block/Makefile
@@ -0,0 +1,11 @@
+block-obj-y += raw.o cow.o qcow.o vdi.o vmdk.o cloop.o dmg.o bochs.o vpc.o vvfat.o
+block-obj-y += qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snapshot.o qcow2-cache.o
+block-obj-y += qed.o qed-gencb.o qed-l2-cache.o qed-table.o qed-cluster.o
+block-obj-y += qed-check.o
+block-obj-y += parallels.o nbd.o blkdebug.o sheepdog.o blkverify.o
+block-obj-y += stream.o
+block-obj-$(CONFIG_WIN32) += raw-win32.o
+block-obj-$(CONFIG_POSIX) += raw-posix.o
+block-obj-$(CONFIG_LIBISCSI) += iscsi.o
+block-obj-$(CONFIG_CURL) += curl.o
+block-obj-$(CONFIG_RBD) += rbd.o
--
1.7.10.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH 11/24] move net/ objects to nested Makefile
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
` (9 preceding siblings ...)
2012-06-03 12:25 ` [Qemu-devel] [PATCH 10/24] move block/ objects to nested Makefile Paolo Bonzini
@ 2012-06-03 12:25 ` Paolo Bonzini
2012-06-03 13:44 ` Blue Swirl
2012-06-03 12:25 ` [Qemu-devel] [PATCH 12/24] move fsdev/ " Paolo Bonzini
` (16 subsequent siblings)
27 siblings, 1 reply; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 12:25 UTC (permalink / raw)
To: qemu-devel
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile.objs | 17 +----------------
net/Makefile | 13 +++++++++++++
2 files changed, 14 insertions(+), 16 deletions(-)
create mode 100644 net/Makefile
diff --git a/Makefile.objs b/Makefile.objs
index 7c8a997..8433fad 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -47,21 +47,6 @@ block-obj-$(CONFIG_POSIX) += posix-aio-compat.o
block-obj-$(CONFIG_LINUX_AIO) += linux-aio.o
block-obj-y += block/
-net-obj-y = net.o
-net-nested-y = queue.o checksum.o util.o
-net-nested-y += socket.o
-net-nested-y += dump.o
-net-nested-$(CONFIG_POSIX) += tap.o
-net-nested-$(CONFIG_LINUX) += tap-linux.o
-net-nested-$(CONFIG_WIN32) += tap-win32.o
-net-nested-$(CONFIG_BSD) += tap-bsd.o
-net-nested-$(CONFIG_SOLARIS) += tap-solaris.o
-net-nested-$(CONFIG_AIX) += tap-aix.o
-net-nested-$(CONFIG_HAIKU) += tap-haiku.o
-net-nested-$(CONFIG_SLIRP) += slirp.o
-net-nested-$(CONFIG_VDE) += vde.o
-net-obj-y += $(addprefix net/, $(net-nested-y))
-
ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy)
# Lots of the fsdev/9pcode is pulled in by vl.c via qemu_fsdev_add.
# only pull in the actual virtio-9p device if we also enabled virtio.
@@ -78,7 +63,7 @@ fsdev-obj-$(CONFIG_VIRTFS) += $(addprefix fsdev/, $(fsdev-nested-y))
# single QEMU executable should support all CPUs and machines.
common-obj-y = $(block-obj-y) blockdev.o
-common-obj-y += $(net-obj-y)
+common-obj-y += net.o net/
common-obj-y += qom/
common-obj-$(CONFIG_LINUX) += $(fsdev-obj-$(CONFIG_LINUX))
common-obj-y += readline.o console.o cursor.o
diff --git a/net/Makefile b/net/Makefile
new file mode 100644
index 0000000..e970ec4
--- /dev/null
+++ b/net/Makefile
@@ -0,0 +1,13 @@
+common-obj-y = queue.o checksum.o util.o
+common-obj-y += socket.o
+common-obj-y += dump.o
+common-obj-$(CONFIG_POSIX) += tap.o
+common-obj-$(CONFIG_LINUX) += tap-linux.o
+common-obj-$(CONFIG_WIN32) += tap-win32.o
+common-obj-$(CONFIG_BSD) += tap-bsd.o
+common-obj-$(CONFIG_SOLARIS) += tap-solaris.o
+common-obj-$(CONFIG_AIX) += tap-aix.o
+common-obj-$(CONFIG_HAIKU) += tap-haiku.o
+common-obj-$(CONFIG_SLIRP) += slirp.o
+common-obj-$(CONFIG_VDE) += vde.o
+
--
1.7.10.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH 12/24] move fsdev/ objects to nested Makefile
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
` (10 preceding siblings ...)
2012-06-03 12:25 ` [Qemu-devel] [PATCH 11/24] move net/ " Paolo Bonzini
@ 2012-06-03 12:25 ` Paolo Bonzini
2012-06-03 13:32 ` Blue Swirl
2012-06-03 12:25 ` [Qemu-devel] [PATCH 13/24] move ui/ " Paolo Bonzini
` (15 subsequent siblings)
27 siblings, 1 reply; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 12:25 UTC (permalink / raw)
To: qemu-devel
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile.objs | 6 +-----
fsdev/Makefile | 6 ++++++
2 files changed, 7 insertions(+), 5 deletions(-)
create mode 100644 fsdev/Makefile
diff --git a/Makefile.objs b/Makefile.objs
index 8433fad..383d4cc 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -51,11 +51,7 @@ ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy)
# Lots of the fsdev/9pcode is pulled in by vl.c via qemu_fsdev_add.
# only pull in the actual virtio-9p device if we also enabled virtio.
CONFIG_REALLY_VIRTFS=y
-fsdev-nested-y = qemu-fsdev.o virtio-9p-marshal.o
-else
-fsdev-nested-y = qemu-fsdev-dummy.o
endif
-fsdev-obj-$(CONFIG_VIRTFS) += $(addprefix fsdev/, $(fsdev-nested-y))
######################################################################
# Target independent part of system emulation. The long term path is to
@@ -65,7 +61,7 @@ fsdev-obj-$(CONFIG_VIRTFS) += $(addprefix fsdev/, $(fsdev-nested-y))
common-obj-y = $(block-obj-y) blockdev.o
common-obj-y += net.o net/
common-obj-y += qom/
-common-obj-$(CONFIG_LINUX) += $(fsdev-obj-$(CONFIG_LINUX))
+common-obj-$(CONFIG_LINUX) += fsdev/
common-obj-y += readline.o console.o cursor.o
common-obj-y += $(oslib-obj-y)
common-obj-$(CONFIG_WIN32) += os-win32.o
diff --git a/fsdev/Makefile b/fsdev/Makefile
new file mode 100644
index 0000000..7f13d86
--- /dev/null
+++ b/fsdev/Makefile
@@ -0,0 +1,6 @@
+ifeq ($(CONFIG_REALLY_VIRTFS),y)
+common-obj-y = qemu-fsdev.o virtio-9p-marshal.o
+else
+common-obj-y = qemu-fsdev-dummy.o
+endif
+
--
1.7.10.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH 13/24] move ui/ objects to nested Makefile
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
` (11 preceding siblings ...)
2012-06-03 12:25 ` [Qemu-devel] [PATCH 12/24] move fsdev/ " Paolo Bonzini
@ 2012-06-03 12:25 ` Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 14/24] move audio/ " Paolo Bonzini
` (14 subsequent siblings)
27 siblings, 0 replies; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 12:25 UTC (permalink / raw)
To: qemu-devel
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile.objs | 21 ++-------------------
ui/Makefile | 18 ++++++++++++++++++
2 files changed, 20 insertions(+), 19 deletions(-)
create mode 100644 ui/Makefile
diff --git a/Makefile.objs b/Makefile.objs
index 383d4cc..b0fa446 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -108,7 +108,6 @@ common-obj-$(CONFIG_BRLAPI) += baum.o
common-obj-$(CONFIG_POSIX) += migration-exec.o migration-unix.o migration-fd.o
common-obj-$(CONFIG_WIN32) += version.o
-common-obj-$(CONFIG_SPICE) += ui/spice-core.o ui/spice-input.o ui/spice-display.o spice-qemu-char.o
audio-obj-y = audio.o noaudio.o wavaudio.o mixeng.o
audio-obj-$(CONFIG_SDL) += sdlaudio.o
@@ -125,24 +124,8 @@ audio-obj-$(CONFIG_AUDIO_PT_INT) += audio_pt_int.o
audio-obj-$(CONFIG_AUDIO_WIN_INT) += audio_win_int.o
audio-obj-y += wavcapture.o
common-obj-y += $(addprefix audio/, $(audio-obj-y))
-
-ui-obj-y += keymaps.o
-ui-obj-$(CONFIG_SDL) += sdl.o sdl_zoom.o x_keymap.o
-ui-obj-$(CONFIG_COCOA) += cocoa.o
-ui-obj-$(CONFIG_CURSES) += curses.o
-vnc-obj-y += vnc.o d3des.o
-vnc-obj-y += vnc-enc-zlib.o vnc-enc-hextile.o
-vnc-obj-y += vnc-enc-tight.o vnc-palette.o
-vnc-obj-y += vnc-enc-zrle.o
-vnc-obj-$(CONFIG_VNC_TLS) += vnc-tls.o vnc-auth-vencrypt.o
-vnc-obj-$(CONFIG_VNC_SASL) += vnc-auth-sasl.o
-ifdef CONFIG_VNC_THREAD
-vnc-obj-y += vnc-jobs-async.o
-else
-vnc-obj-y += vnc-jobs-sync.o
-endif
-common-obj-y += $(addprefix ui/, $(ui-obj-y))
-common-obj-$(CONFIG_VNC) += $(addprefix ui/, $(vnc-obj-y))
+common-obj-$(CONFIG_SPICE) += spice-qemu-char.o
+common-obj-y += ui/
common-obj-y += iov.o acl.o
common-obj-$(CONFIG_POSIX) += compatfd.o
diff --git a/ui/Makefile b/ui/Makefile
new file mode 100644
index 0000000..3687c8a
--- /dev/null
+++ b/ui/Makefile
@@ -0,0 +1,18 @@
+vnc-obj-y += vnc.o d3des.o
+vnc-obj-y += vnc-enc-zlib.o vnc-enc-hextile.o
+vnc-obj-y += vnc-enc-tight.o vnc-palette.o
+vnc-obj-y += vnc-enc-zrle.o
+vnc-obj-$(CONFIG_VNC_TLS) += vnc-tls.o vnc-auth-vencrypt.o
+vnc-obj-$(CONFIG_VNC_SASL) += vnc-auth-sasl.o
+ifdef CONFIG_VNC_THREAD
+vnc-obj-y += vnc-jobs-async.o
+else
+vnc-obj-y += vnc-jobs-sync.o
+endif
+
+common-obj-y += keymaps.o
+common-obj-$(CONFIG_SPICE) += spice-core.o spice-input.o spice-display.o
+common-obj-$(CONFIG_SDL) += sdl.o sdl_zoom.o x_keymap.o
+common-obj-$(CONFIG_COCOA) += cocoa.o
+common-obj-$(CONFIG_CURSES) += curses.o
+common-obj-$(CONFIG_VNC) += $(vnc-obj-y)
--
1.7.10.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH 14/24] move audio/ objects to nested Makefile
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
` (12 preceding siblings ...)
2012-06-03 12:25 ` [Qemu-devel] [PATCH 13/24] move ui/ " Paolo Bonzini
@ 2012-06-03 12:25 ` Paolo Bonzini
2012-06-03 13:33 ` Blue Swirl
2012-06-03 12:25 ` [Qemu-devel] [PATCH 15/24] move slirp/ " Paolo Bonzini
` (13 subsequent siblings)
27 siblings, 1 reply; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 12:25 UTC (permalink / raw)
To: qemu-devel
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile.objs | 18 ++----------------
audio/Makefile | 15 +++++++++++++++
2 files changed, 17 insertions(+), 16 deletions(-)
create mode 100644 audio/Makefile
diff --git a/Makefile.objs b/Makefile.objs
index b0fa446..f1be02a 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -108,23 +108,9 @@ common-obj-$(CONFIG_BRLAPI) += baum.o
common-obj-$(CONFIG_POSIX) += migration-exec.o migration-unix.o migration-fd.o
common-obj-$(CONFIG_WIN32) += version.o
-
-audio-obj-y = audio.o noaudio.o wavaudio.o mixeng.o
-audio-obj-$(CONFIG_SDL) += sdlaudio.o
-audio-obj-$(CONFIG_OSS) += ossaudio.o
-audio-obj-$(CONFIG_SPICE) += spiceaudio.o
-audio-obj-$(CONFIG_COREAUDIO) += coreaudio.o
-audio-obj-$(CONFIG_ALSA) += alsaaudio.o
-audio-obj-$(CONFIG_DSOUND) += dsoundaudio.o
-audio-obj-$(CONFIG_FMOD) += fmodaudio.o
-audio-obj-$(CONFIG_ESD) += esdaudio.o
-audio-obj-$(CONFIG_PA) += paaudio.o
-audio-obj-$(CONFIG_WINWAVE) += winwaveaudio.o
-audio-obj-$(CONFIG_AUDIO_PT_INT) += audio_pt_int.o
-audio-obj-$(CONFIG_AUDIO_WIN_INT) += audio_win_int.o
-audio-obj-y += wavcapture.o
-common-obj-y += $(addprefix audio/, $(audio-obj-y))
common-obj-$(CONFIG_SPICE) += spice-qemu-char.o
+
+common-obj-y += audio/
common-obj-y += ui/
common-obj-y += iov.o acl.o
diff --git a/audio/Makefile b/audio/Makefile
new file mode 100644
index 0000000..a54f7ae
--- /dev/null
+++ b/audio/Makefile
@@ -0,0 +1,15 @@
+common-obj-y = audio.o noaudio.o wavaudio.o mixeng.o
+common-obj-$(CONFIG_SDL) += sdlaudio.o
+common-obj-$(CONFIG_OSS) += ossaudio.o
+common-obj-$(CONFIG_SPICE) += spiceaudio.o
+common-obj-$(CONFIG_COREAUDIO) += coreaudio.o
+common-obj-$(CONFIG_ALSA) += alsaaudio.o
+common-obj-$(CONFIG_DSOUND) += dsoundaudio.o
+common-obj-$(CONFIG_FMOD) += fmodaudio.o
+common-obj-$(CONFIG_ESD) += esdaudio.o
+common-obj-$(CONFIG_PA) += paaudio.o
+common-obj-$(CONFIG_WINWAVE) += winwaveaudio.o
+common-obj-$(CONFIG_AUDIO_PT_INT) += audio_pt_int.o
+common-obj-$(CONFIG_AUDIO_WIN_INT) += audio_win_int.o
+common-obj-y += wavcapture.o
+
--
1.7.10.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH 15/24] move slirp/ objects to nested Makefile
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
` (13 preceding siblings ...)
2012-06-03 12:25 ` [Qemu-devel] [PATCH 14/24] move audio/ " Paolo Bonzini
@ 2012-06-03 12:25 ` Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 16/24] move qapi/ " Paolo Bonzini
` (12 subsequent siblings)
27 siblings, 0 replies; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 12:25 UTC (permalink / raw)
To: qemu-devel
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile.objs | 5 +----
slirp/Makefile | 4 ++++
2 files changed, 5 insertions(+), 4 deletions(-)
create mode 100644 slirp/Makefile
diff --git a/Makefile.objs b/Makefile.objs
index f1be02a..6a3ff49 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -118,10 +118,7 @@ common-obj-$(CONFIG_POSIX) += compatfd.o
common-obj-y += notify.o event_notifier.o
common-obj-y += qemu-timer.o qemu-timer-common.o
-slirp-obj-y = cksum.o if.o ip_icmp.o ip_input.o ip_output.o
-slirp-obj-y += slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o
-slirp-obj-y += tcp_subr.o tcp_timer.o udp.o bootp.o tftp.o arp_table.o
-common-obj-$(CONFIG_SLIRP) += $(addprefix slirp/, $(slirp-obj-y))
+common-obj-$(CONFIG_SLIRP) += slirp/
# xen backend driver support
common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_devconfig.o
diff --git a/slirp/Makefile b/slirp/Makefile
new file mode 100644
index 0000000..1028488
--- /dev/null
+++ b/slirp/Makefile
@@ -0,0 +1,4 @@
+common-obj-y = cksum.o if.o ip_icmp.o ip_input.o ip_output.o
+common-obj-y += slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o
+common-obj-y += tcp_subr.o tcp_timer.o udp.o bootp.o tftp.o arp_table.o
+
--
1.7.10.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH 16/24] move qapi/ objects to nested Makefile
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
` (14 preceding siblings ...)
2012-06-03 12:25 ` [Qemu-devel] [PATCH 15/24] move slirp/ " Paolo Bonzini
@ 2012-06-03 12:25 ` Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 17/24] move qga/ " Paolo Bonzini
` (11 subsequent siblings)
27 siblings, 0 replies; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 12:25 UTC (permalink / raw)
To: qemu-devel
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile.objs | 6 ++----
qapi/Makefile | 3 +++
2 files changed, 5 insertions(+), 4 deletions(-)
create mode 100644 qapi/Makefile
diff --git a/Makefile.objs b/Makefile.objs
index 6a3ff49..54ab6e6 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -373,10 +373,7 @@ libcacard-y = cac.o event.o vcard.o vreader.o vcard_emul_nss.o vcard_emul_type.o
######################################################################
# qapi
-qapi-nested-y = qapi-visit-core.o qapi-dealloc-visitor.o qmp-input-visitor.o
-qapi-nested-y += qmp-output-visitor.o qmp-registry.o qmp-dispatch.o
-qapi-nested-y += string-input-visitor.o string-output-visitor.o
-qapi-obj-y = $(addprefix qapi/, $(qapi-nested-y))
+qapi-obj-y = qapi/
common-obj-y += qmp-marshal.o qapi-visit.o qapi-types.o
common-obj-y += qmp.o hmp.o
@@ -403,6 +400,7 @@ QEMU_CFLAGS+=$(GLIB_CFLAGS)
nested-vars += \
block-obj-y \
qom-obj-y \
+ qapi-obj-y \
user-obj-y \
common-obj-y
dummy := $(foreach var, $(nested-vars), $(call unnest-var,$(var)))
diff --git a/qapi/Makefile b/qapi/Makefile
new file mode 100644
index 0000000..d0b0c16
--- /dev/null
+++ b/qapi/Makefile
@@ -0,0 +1,3 @@
+qapi-obj-y = qapi-visit-core.o qapi-dealloc-visitor.o qmp-input-visitor.o
+qapi-obj-y += qmp-output-visitor.o qmp-registry.o qmp-dispatch.o
+qapi-obj-y += string-input-visitor.o string-output-visitor.o
--
1.7.10.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH 17/24] move qga/ objects to nested Makefile
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
` (15 preceding siblings ...)
2012-06-03 12:25 ` [Qemu-devel] [PATCH 16/24] move qapi/ " Paolo Bonzini
@ 2012-06-03 12:25 ` Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 18/24] move target-independent hw/ objects to nested Makefiles Paolo Bonzini
` (10 subsequent siblings)
27 siblings, 0 replies; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 12:25 UTC (permalink / raw)
To: qemu-devel
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile.objs | 7 ++-----
qga/Makefile | 4 ++++
2 files changed, 6 insertions(+), 5 deletions(-)
create mode 100644 qga/Makefile
diff --git a/Makefile.objs b/Makefile.objs
index 54ab6e6..73e07b0 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -383,11 +383,7 @@ universal-obj-y += $(qapi-obj-y)
######################################################################
# guest agent
-qga-nested-y = commands.o guest-agent-command-state.o
-qga-nested-$(CONFIG_POSIX) += commands-posix.o channel-posix.o
-qga-nested-$(CONFIG_WIN32) += commands-win32.o channel-win32.o service-win32.o
-qga-obj-y = $(addprefix qga/, $(qga-nested-y))
-qga-obj-y += qemu-ga.o module.o
+qga-obj-y = qga/ qemu-ga.o module.o
qga-obj-$(CONFIG_WIN32) += oslib-win32.o
qga-obj-$(CONFIG_POSIX) += oslib-posix.o qemu-sockets.o qemu-option.o
@@ -398,6 +394,7 @@ vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS)
QEMU_CFLAGS+=$(GLIB_CFLAGS)
nested-vars += \
+ qga-obj-y \
block-obj-y \
qom-obj-y \
qapi-obj-y \
diff --git a/qga/Makefile b/qga/Makefile
new file mode 100644
index 0000000..11b3665
--- /dev/null
+++ b/qga/Makefile
@@ -0,0 +1,4 @@
+qga-obj-y = commands.o guest-agent-command-state.o
+qga-obj-$(CONFIG_POSIX) += commands-posix.o channel-posix.o
+qga-obj-$(CONFIG_WIN32) += commands-win32.o channel-win32.o service-win32.o
+
--
1.7.10.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH 18/24] move target-independent hw/ objects to nested Makefiles
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
` (16 preceding siblings ...)
2012-06-03 12:25 ` [Qemu-devel] [PATCH 17/24] move qga/ " Paolo Bonzini
@ 2012-06-03 12:25 ` Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 19/24] convert libhw " Paolo Bonzini
` (9 subsequent siblings)
27 siblings, 0 replies; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 12:25 UTC (permalink / raw)
To: qemu-devel
This patch starts converting the hw/ directory. Some files in hw/
are compiled once, some twice (32-/64-bit), some once per target.
Each category is moved in a separate patch.
After this patch, the files that are compiled once will show the
same hierarchy in the build tree as they do in the source tree,
for example hw/qdev.o instead of just qdev.o.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile | 6 ++++--
Makefile.objs | 38 +++-----------------------------------
configure | 2 +-
hw/Makefile | 32 ++++++++++++++++++++++++++++++++
hw/usb/Makefile | 4 ++++
5 files changed, 44 insertions(+), 38 deletions(-)
create mode 100644 hw/Makefile
create mode 100644 hw/usb/Makefile
diff --git a/Makefile b/Makefile
index c0ab97a..3ffeb03 100644
--- a/Makefile
+++ b/Makefile
@@ -120,7 +120,7 @@ QEMU_CFLAGS += -I$(SRC_PATH)/include
ui/cocoa.o: ui/cocoa.m
-ui/sdl.o audio/sdlaudio.o ui/sdl_zoom.o baum.o: QEMU_CFLAGS += $(SDL_CFLAGS)
+ui/sdl.o audio/sdlaudio.o ui/sdl_zoom.o hw/baum.o: QEMU_CFLAGS += $(SDL_CFLAGS)
ui/vnc.o: QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
@@ -214,6 +214,7 @@ clean:
rm -Rf .libs
rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d block/*.o block/*.d net/*.o net/*.d fsdev/*.o fsdev/*.d ui/*.o ui/*.d qapi/*.o qapi/*.d qga/*.o qga/*.d
rm -f qom/*.o qom/*.d
+ rm -f usb/*.o usb/*.d hw/*.o hw/*.d
rm -f qemu-img-cmds.h
rm -f trace/*.o trace/*.d
rm -f trace-dtrace.dtrace trace-dtrace.dtrace-timestamp
@@ -400,4 +401,5 @@ tar:
Makefile: $(GENERATED_HEADERS)
# Include automatically generated dependency files
--include $(wildcard *.d audio/*.d slirp/*.d block/*.d net/*.d ui/*.d qapi/*.d qga/*.d)
+-include $(wildcard *.d audio/*.d slirp/*.d block/*.d net/*.d ui/*.d qapi/*.d)
+-include $(wildcard qga/*.d hw/*.d hw/usb/*.d)
diff --git a/Makefile.objs b/Makefile.objs
index 73e07b0..a181eb1 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -68,50 +68,22 @@ common-obj-$(CONFIG_WIN32) += os-win32.o
common-obj-$(CONFIG_POSIX) += os-posix.o
common-obj-y += tcg-runtime.o host-utils.o main-loop.o
-common-obj-y += irq.o input.o
-common-obj-$(CONFIG_PTIMER) += ptimer.o
-common-obj-$(CONFIG_MAX7310) += max7310.o
-common-obj-$(CONFIG_WM8750) += wm8750.o
-common-obj-$(CONFIG_TWL92230) += twl92230.o
-common-obj-$(CONFIG_TSC2005) += tsc2005.o
-common-obj-$(CONFIG_LM832X) += lm832x.o
-common-obj-$(CONFIG_TMP105) += tmp105.o
-common-obj-$(CONFIG_STELLARIS_INPUT) += stellaris_input.o
-common-obj-$(CONFIG_SSD0303) += ssd0303.o
-common-obj-$(CONFIG_SSD0323) += ssd0323.o
-common-obj-$(CONFIG_ADS7846) += ads7846.o
-common-obj-$(CONFIG_MAX111X) += max111x.o
-common-obj-$(CONFIG_DS1338) += ds1338.o
-common-obj-y += i2c.o smbus.o smbus_eeprom.o
-common-obj-y += eeprom93xx.o
-common-obj-y += scsi-disk.o cdrom.o
-common-obj-y += scsi-generic.o scsi-bus.o
-common-obj-y += hid.o
-common-obj-y += usb/core.o usb/bus.o usb/desc.o usb/dev-hub.o
-common-obj-y += usb/host-$(HOST_USB).o
-common-obj-y += usb/dev-hid.o usb/dev-storage.o usb/dev-wacom.o
-common-obj-y += usb/dev-serial.o usb/dev-network.o usb/dev-audio.o
-common-obj-$(CONFIG_SSI) += ssi.o
-common-obj-$(CONFIG_SSI_SD) += ssi-sd.o
-common-obj-$(CONFIG_SD) += sd.o
-common-obj-y += bt.o bt-host.o bt-vhci.o bt-l2cap.o bt-sdp.o bt-hci.o bt-hid.o
-common-obj-y += bt-hci-csr.o usb/dev-bluetooth.o
+common-obj-y += input.o
common-obj-y += buffered_file.o migration.o migration-tcp.o
common-obj-y += qemu-char.o #aio.o
-common-obj-y += msmouse.o ps2.o
-common-obj-y += qdev.o qdev-properties.o qdev-monitor.o
common-obj-y += block-migration.o iohandler.o
common-obj-y += pflib.o
common-obj-y += bitmap.o bitops.o
-common-obj-$(CONFIG_BRLAPI) += baum.o
common-obj-$(CONFIG_POSIX) += migration-exec.o migration-unix.o migration-fd.o
common-obj-$(CONFIG_WIN32) += version.o
common-obj-$(CONFIG_SPICE) += spice-qemu-char.o
common-obj-y += audio/
+common-obj-y += hw/
common-obj-y += ui/
+common-obj-y += bt-host.o bt-vhci.o
common-obj-y += iov.o acl.o
common-obj-$(CONFIG_POSIX) += compatfd.o
@@ -120,10 +92,6 @@ common-obj-y += qemu-timer.o qemu-timer-common.o
common-obj-$(CONFIG_SLIRP) += slirp/
-# xen backend driver support
-common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_devconfig.o
-common-obj-$(CONFIG_XEN_BACKEND) += xen_console.o xenfb.o xen_disk.o xen_nic.o
-
######################################################################
# libuser
diff --git a/configure b/configure
index 082f0e1..eff2265 100755
--- a/configure
+++ b/configure
@@ -3928,7 +3928,7 @@ DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32"
DIRS="$DIRS slirp audio block net pc-bios/optionrom"
DIRS="$DIRS pc-bios/spapr-rtas"
DIRS="$DIRS roms/seabios roms/vgabios"
-DIRS="$DIRS fsdev ui usb"
+DIRS="$DIRS fsdev ui hw hw/usb"
DIRS="$DIRS qapi qapi-generated"
DIRS="$DIRS qga trace qom"
FILES="Makefile tests/tcg/Makefile qdict-test-data.txt"
diff --git a/hw/Makefile b/hw/Makefile
new file mode 100644
index 0000000..00642f3
--- /dev/null
+++ b/hw/Makefile
@@ -0,0 +1,32 @@
+common-obj-y += usb/
+common-obj-y += irq.o
+common-obj-$(CONFIG_PTIMER) += ptimer.o
+common-obj-$(CONFIG_MAX7310) += max7310.o
+common-obj-$(CONFIG_WM8750) += wm8750.o
+common-obj-$(CONFIG_TWL92230) += twl92230.o
+common-obj-$(CONFIG_TSC2005) += tsc2005.o
+common-obj-$(CONFIG_LM832X) += lm832x.o
+common-obj-$(CONFIG_TMP105) += tmp105.o
+common-obj-$(CONFIG_STELLARIS_INPUT) += stellaris_input.o
+common-obj-$(CONFIG_SSD0303) += ssd0303.o
+common-obj-$(CONFIG_SSD0323) += ssd0323.o
+common-obj-$(CONFIG_ADS7846) += ads7846.o
+common-obj-$(CONFIG_MAX111X) += max111x.o
+common-obj-$(CONFIG_DS1338) += ds1338.o
+common-obj-y += i2c.o smbus.o smbus_eeprom.o
+common-obj-y += eeprom93xx.o
+common-obj-y += scsi-disk.o cdrom.o
+common-obj-y += scsi-generic.o scsi-bus.o
+common-obj-y += hid.o
+common-obj-$(CONFIG_SSI) += ssi.o
+common-obj-$(CONFIG_SSI_SD) += ssi-sd.o
+common-obj-$(CONFIG_SD) += sd.o
+common-obj-y += bt.o bt-l2cap.o bt-sdp.o bt-hci.o bt-hid.o
+common-obj-y += bt-hci-csr.o
+common-obj-y += msmouse.o ps2.o
+common-obj-y += qdev.o qdev-properties.o qdev-monitor.o
+common-obj-$(CONFIG_BRLAPI) += baum.o
+
+# xen backend driver support
+common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_devconfig.o
+common-obj-$(CONFIG_XEN_BACKEND) += xen_console.o xenfb.o xen_disk.o xen_nic.o
diff --git a/hw/usb/Makefile b/hw/usb/Makefile
new file mode 100644
index 0000000..7dbc33b
--- /dev/null
+++ b/hw/usb/Makefile
@@ -0,0 +1,4 @@
+common-obj-y += core.o bus.o desc.o dev-hub.o
+common-obj-y += host-$(HOST_USB).o dev-bluetooth.o
+common-obj-y += dev-hid.o dev-storage.o dev-wacom.o
+common-obj-y += dev-serial.o dev-network.o dev-audio.o
--
1.7.10.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH 19/24] convert libhw to nested Makefiles
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
` (17 preceding siblings ...)
2012-06-03 12:25 ` [Qemu-devel] [PATCH 18/24] move target-independent hw/ objects to nested Makefiles Paolo Bonzini
@ 2012-06-03 12:25 ` Paolo Bonzini
2012-06-04 18:08 ` Andreas Färber
2012-06-03 12:25 ` [Qemu-devel] [PATCH 20/24] move per-target hw/ objects " Paolo Bonzini
` (8 subsequent siblings)
27 siblings, 1 reply; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 12:25 UTC (permalink / raw)
To: qemu-devel
After this patch, the libhw* directories will have a hierarchy
that mimics the source tree. This is useful because we do have
a couple of files there that are in the top source directory.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile.hw | 6 +--
Makefile.objs | 145 ++----------------------------------------------------
configure | 7 +--
hw/9pfs/Makefile | 7 +++
hw/Makefile | 113 ++++++++++++++++++++++++++++++++++++++++++
hw/ide/Makefile | 10 ++++
hw/usb/Makefile | 9 ++++
7 files changed, 150 insertions(+), 147 deletions(-)
create mode 100644 hw/9pfs/Makefile
create mode 100644 hw/ide/Makefile
diff --git a/Makefile.hw b/Makefile.hw
index 33f1ab0..155a0c3 100644
--- a/Makefile.hw
+++ b/Makefile.hw
@@ -7,7 +7,7 @@ include $(SRC_PATH)/rules.mak
.PHONY: all
-$(call set-vpath, $(SRC_PATH):$(SRC_PATH)/hw)
+$(call set-vpath, $(SRC_PATH))
QEMU_CFLAGS+=-I..
QEMU_CFLAGS += -I$(SRC_PATH)/include
@@ -19,7 +19,7 @@ all: $(hw-obj-y)
@true
clean:
- rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~
+ rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~ */*/*.d
# Include automatically generated dependency files
--include $(wildcard *.d */*.d)
+-include $(wildcard *.d */*.d */*/*.d)
diff --git a/Makefile.objs b/Makefile.objs
index a181eb1..2c0c3f6 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -107,147 +107,9 @@ user-obj-y += qom/
######################################################################
# libhw
-hw-obj-y =
-hw-obj-y += vl.o loader.o
-hw-obj-$(CONFIG_VIRTIO) += virtio-console.o
-hw-obj-y += usb/libhw.o
-hw-obj-$(CONFIG_VIRTIO_PCI) += virtio-pci.o
-hw-obj-y += fw_cfg.o
-hw-obj-$(CONFIG_PCI) += pci.o pci_bridge.o pci_bridge_dev.o
-hw-obj-$(CONFIG_PCI) += msix.o msi.o
-hw-obj-$(CONFIG_PCI) += shpc.o
-hw-obj-$(CONFIG_PCI) += slotid_cap.o
-hw-obj-$(CONFIG_PCI) += pci_host.o pcie_host.o
-hw-obj-$(CONFIG_PCI) += ioh3420.o xio3130_upstream.o xio3130_downstream.o
-hw-obj-y += watchdog.o
-hw-obj-$(CONFIG_ISA_MMIO) += isa_mmio.o
-hw-obj-$(CONFIG_ECC) += ecc.o
-hw-obj-$(CONFIG_NAND) += nand.o
-hw-obj-$(CONFIG_PFLASH_CFI01) += pflash_cfi01.o
-hw-obj-$(CONFIG_PFLASH_CFI02) += pflash_cfi02.o
-
-hw-obj-$(CONFIG_M48T59) += m48t59.o
-hw-obj-$(CONFIG_ESCC) += escc.o
-hw-obj-$(CONFIG_EMPTY_SLOT) += empty_slot.o
-
-hw-obj-$(CONFIG_SERIAL) += serial.o
-hw-obj-$(CONFIG_PARALLEL) += parallel.o
-hw-obj-$(CONFIG_I8254) += i8254_common.o i8254.o
-hw-obj-$(CONFIG_PCSPK) += pcspk.o
-hw-obj-$(CONFIG_PCKBD) += pckbd.o
-hw-obj-$(CONFIG_USB_UHCI) += usb/hcd-uhci.o
-hw-obj-$(CONFIG_USB_OHCI) += usb/hcd-ohci.o
-hw-obj-$(CONFIG_USB_EHCI) += usb/hcd-ehci.o
-hw-obj-$(CONFIG_USB_XHCI) += usb/hcd-xhci.o
-hw-obj-$(CONFIG_FDC) += fdc.o
-hw-obj-$(CONFIG_ACPI) += acpi.o acpi_piix4.o
-hw-obj-$(CONFIG_APM) += pm_smbus.o apm.o
-hw-obj-$(CONFIG_DMA) += dma.o
-hw-obj-$(CONFIG_I82374) += i82374.o
-hw-obj-$(CONFIG_HPET) += hpet.o
-hw-obj-$(CONFIG_APPLESMC) += applesmc.o
-hw-obj-$(CONFIG_SMARTCARD) += usb/dev-smartcard-reader.o ccid-card-passthru.o
-hw-obj-$(CONFIG_SMARTCARD_NSS) += ccid-card-emulated.o
-hw-obj-$(CONFIG_USB_REDIR) += usb/redirect.o
-hw-obj-$(CONFIG_I8259) += i8259_common.o i8259.o
-
-# PPC devices
-hw-obj-$(CONFIG_PREP_PCI) += prep_pci.o
-hw-obj-$(CONFIG_I82378) += i82378.o
-# Mac shared devices
-hw-obj-$(CONFIG_MACIO) += macio.o
-hw-obj-$(CONFIG_CUDA) += cuda.o
-hw-obj-$(CONFIG_ADB) += adb.o
-hw-obj-$(CONFIG_MAC_NVRAM) += mac_nvram.o
-hw-obj-$(CONFIG_MAC_DBDMA) += mac_dbdma.o
-# OldWorld PowerMac
-hw-obj-$(CONFIG_HEATHROW_PIC) += heathrow_pic.o
-hw-obj-$(CONFIG_GRACKLE_PCI) += grackle_pci.o
-# NewWorld PowerMac
-hw-obj-$(CONFIG_UNIN_PCI) += unin_pci.o
-hw-obj-$(CONFIG_DEC_PCI) += dec_pci.o
-# PowerPC E500 boards
-hw-obj-$(CONFIG_PPCE500_PCI) += ppce500_pci.o
-
-# MIPS devices
-hw-obj-$(CONFIG_PIIX4) += piix4.o
-hw-obj-$(CONFIG_G364FB) += g364fb.o
-hw-obj-$(CONFIG_JAZZ_LED) += jazz_led.o
-
-# PCI watchdog devices
-hw-obj-$(CONFIG_PCI) += wdt_i6300esb.o
-
-hw-obj-$(CONFIG_PCI) += pcie.o pcie_aer.o pcie_port.o
-
-# PCI network cards
-hw-obj-$(CONFIG_NE2000_PCI) += ne2000.o
-hw-obj-$(CONFIG_EEPRO100_PCI) += eepro100.o
-hw-obj-$(CONFIG_PCNET_PCI) += pcnet-pci.o
-hw-obj-$(CONFIG_PCNET_COMMON) += pcnet.o
-hw-obj-$(CONFIG_E1000_PCI) += e1000.o
-hw-obj-$(CONFIG_RTL8139_PCI) += rtl8139.o
-
-hw-obj-$(CONFIG_SMC91C111) += smc91c111.o
-hw-obj-$(CONFIG_LAN9118) += lan9118.o
-hw-obj-$(CONFIG_NE2000_ISA) += ne2000-isa.o
-hw-obj-$(CONFIG_OPENCORES_ETH) += opencores_eth.o
-
-# IDE
-hw-obj-$(CONFIG_IDE_CORE) += ide/core.o ide/atapi.o
-hw-obj-$(CONFIG_IDE_QDEV) += ide/qdev.o
-hw-obj-$(CONFIG_IDE_PCI) += ide/pci.o
-hw-obj-$(CONFIG_IDE_ISA) += ide/isa.o
-hw-obj-$(CONFIG_IDE_PIIX) += ide/piix.o
-hw-obj-$(CONFIG_IDE_CMD646) += ide/cmd646.o
-hw-obj-$(CONFIG_IDE_MACIO) += ide/macio.o
-hw-obj-$(CONFIG_IDE_VIA) += ide/via.o
-hw-obj-$(CONFIG_AHCI) += ide/ahci.o
-hw-obj-$(CONFIG_AHCI) += ide/ich.o
-
-# SCSI layer
-hw-obj-$(CONFIG_LSI_SCSI_PCI) += lsi53c895a.o
-hw-obj-$(CONFIG_ESP) += esp.o
-
-hw-obj-y += dma-helpers.o sysbus.o isa-bus.o
-hw-obj-y += qdev-addr.o
-
-# VGA
-hw-obj-$(CONFIG_VGA_PCI) += vga-pci.o
-hw-obj-$(CONFIG_VGA_ISA) += vga-isa.o
-hw-obj-$(CONFIG_VGA_ISA_MM) += vga-isa-mm.o
-hw-obj-$(CONFIG_VMWARE_VGA) += vmware_vga.o
-hw-obj-$(CONFIG_VMMOUSE) += vmmouse.o
-hw-obj-$(CONFIG_VGA_CIRRUS) += cirrus_vga.o
-
-hw-obj-$(CONFIG_RC4030) += rc4030.o
-hw-obj-$(CONFIG_DP8393X) += dp8393x.o
-hw-obj-$(CONFIG_DS1225Y) += ds1225y.o
-hw-obj-$(CONFIG_MIPSNET) += mipsnet.o
-
-hw-obj-y += qtest.o
-
-# Sound
-sound-obj-y =
-sound-obj-$(CONFIG_SB16) += sb16.o
-sound-obj-$(CONFIG_ES1370) += es1370.o
-sound-obj-$(CONFIG_AC97) += ac97.o
-sound-obj-$(CONFIG_ADLIB) += fmopl.o adlib.o
-sound-obj-$(CONFIG_GUS) += gus.o gusemu_hal.o gusemu_mixer.o
-sound-obj-$(CONFIG_CS4231A) += cs4231a.o
-sound-obj-$(CONFIG_HDA) += intel-hda.o hda-audio.o
-
-adlib.o fmopl.o: QEMU_CFLAGS += -DBUILD_Y8950=0
-hw-obj-$(CONFIG_SOUND) += $(sound-obj-y)
-
-9pfs-nested-$(CONFIG_VIRTFS) = virtio-9p.o
-9pfs-nested-$(CONFIG_VIRTFS) += virtio-9p-local.o virtio-9p-xattr.o
-9pfs-nested-$(CONFIG_VIRTFS) += virtio-9p-xattr-user.o virtio-9p-posix-acl.o
-9pfs-nested-$(CONFIG_VIRTFS) += virtio-9p-coth.o cofs.o codir.o cofile.o
-9pfs-nested-$(CONFIG_VIRTFS) += coxattr.o virtio-9p-synth.o
-9pfs-nested-$(CONFIG_OPEN_BY_HANDLE) += virtio-9p-handle.o
-9pfs-nested-$(CONFIG_VIRTFS) += virtio-9p-proxy.o
-
-hw-obj-$(CONFIG_REALLY_VIRTFS) += $(addprefix 9pfs/, $(9pfs-nested-y))
+hw-obj-y = vl.o dma-helpers.o qtest.o hw/
+
+hw/adlib.o hw/fmopl.o: QEMU_CFLAGS += -DBUILD_Y8950=0
######################################################################
# libdis
@@ -362,6 +224,7 @@ vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS)
QEMU_CFLAGS+=$(GLIB_CFLAGS)
nested-vars += \
+ hw-obj-y \
qga-obj-y \
block-obj-y \
qom-obj-y \
diff --git a/configure b/configure
index eff2265..6d0a935 100755
--- a/configure
+++ b/configure
@@ -3969,10 +3969,11 @@ done
for hwlib in 32 64; do
d=libhw$hwlib
mkdir -p $d
- mkdir -p $d/ide
- mkdir -p $d/usb
+ mkdir -p $d/hw
+ mkdir -p $d/hw/ide
+ mkdir -p $d/hw/usb
symlink "$source_path/Makefile.hw" "$d/Makefile"
- mkdir -p $d/9pfs
+ mkdir -p $d/hw/9pfs
echo "QEMU_CFLAGS+=-DTARGET_PHYS_ADDR_BITS=$hwlib" > $d/config.mak
done
diff --git a/hw/9pfs/Makefile b/hw/9pfs/Makefile
new file mode 100644
index 0000000..2700772
--- /dev/null
+++ b/hw/9pfs/Makefile
@@ -0,0 +1,7 @@
+hw-obj-y = virtio-9p.o
+hw-obj-y += virtio-9p-local.o virtio-9p-xattr.o
+hw-obj-y += virtio-9p-xattr-user.o virtio-9p-posix-acl.o
+hw-obj-y += virtio-9p-coth.o cofs.o codir.o cofile.o
+hw-obj-y += coxattr.o virtio-9p-synth.o
+hw-obj-$(CONFIG_OPEN_BY_HANDLE) += virtio-9p-handle.o
+hw-obj-y += virtio-9p-proxy.o
diff --git a/hw/Makefile b/hw/Makefile
index 00642f3..43dc824 100644
--- a/hw/Makefile
+++ b/hw/Makefile
@@ -1,3 +1,116 @@
+hw-obj-y = usb/ ide/
+hw-obj-y += loader.o
+hw-obj-$(CONFIG_VIRTIO) += virtio-console.o
+hw-obj-$(CONFIG_VIRTIO_PCI) += virtio-pci.o
+hw-obj-y += fw_cfg.o
+hw-obj-$(CONFIG_PCI) += pci.o pci_bridge.o pci_bridge_dev.o
+hw-obj-$(CONFIG_PCI) += msix.o msi.o
+hw-obj-$(CONFIG_PCI) += shpc.o
+hw-obj-$(CONFIG_PCI) += slotid_cap.o
+hw-obj-$(CONFIG_PCI) += pci_host.o pcie_host.o
+hw-obj-$(CONFIG_PCI) += ioh3420.o xio3130_upstream.o xio3130_downstream.o
+hw-obj-y += watchdog.o
+hw-obj-$(CONFIG_ISA_MMIO) += isa_mmio.o
+hw-obj-$(CONFIG_ECC) += ecc.o
+hw-obj-$(CONFIG_NAND) += nand.o
+hw-obj-$(CONFIG_PFLASH_CFI01) += pflash_cfi01.o
+hw-obj-$(CONFIG_PFLASH_CFI02) += pflash_cfi02.o
+
+hw-obj-$(CONFIG_M48T59) += m48t59.o
+hw-obj-$(CONFIG_ESCC) += escc.o
+hw-obj-$(CONFIG_EMPTY_SLOT) += empty_slot.o
+
+hw-obj-$(CONFIG_SERIAL) += serial.o
+hw-obj-$(CONFIG_PARALLEL) += parallel.o
+hw-obj-$(CONFIG_I8254) += i8254_common.o i8254.o
+hw-obj-$(CONFIG_PCSPK) += pcspk.o
+hw-obj-$(CONFIG_PCKBD) += pckbd.o
+hw-obj-$(CONFIG_FDC) += fdc.o
+hw-obj-$(CONFIG_ACPI) += acpi.o acpi_piix4.o
+hw-obj-$(CONFIG_APM) += pm_smbus.o apm.o
+hw-obj-$(CONFIG_DMA) += dma.o
+hw-obj-$(CONFIG_I82374) += i82374.o
+hw-obj-$(CONFIG_HPET) += hpet.o
+hw-obj-$(CONFIG_APPLESMC) += applesmc.o
+hw-obj-$(CONFIG_SMARTCARD) += ccid-card-passthru.o
+hw-obj-$(CONFIG_SMARTCARD_NSS) += ccid-card-emulated.o
+hw-obj-$(CONFIG_I8259) += i8259_common.o i8259.o
+
+# PPC devices
+hw-obj-$(CONFIG_PREP_PCI) += prep_pci.o
+hw-obj-$(CONFIG_I82378) += i82378.o
+# Mac shared devices
+hw-obj-$(CONFIG_MACIO) += macio.o
+hw-obj-$(CONFIG_CUDA) += cuda.o
+hw-obj-$(CONFIG_ADB) += adb.o
+hw-obj-$(CONFIG_MAC_NVRAM) += mac_nvram.o
+hw-obj-$(CONFIG_MAC_DBDMA) += mac_dbdma.o
+# OldWorld PowerMac
+hw-obj-$(CONFIG_HEATHROW_PIC) += heathrow_pic.o
+hw-obj-$(CONFIG_GRACKLE_PCI) += grackle_pci.o
+# NewWorld PowerMac
+hw-obj-$(CONFIG_UNIN_PCI) += unin_pci.o
+hw-obj-$(CONFIG_DEC_PCI) += dec_pci.o
+# PowerPC E500 boards
+hw-obj-$(CONFIG_PPCE500_PCI) += ppce500_pci.o
+
+# MIPS devices
+hw-obj-$(CONFIG_PIIX4) += piix4.o
+hw-obj-$(CONFIG_G364FB) += g364fb.o
+hw-obj-$(CONFIG_JAZZ_LED) += jazz_led.o
+
+# PCI watchdog devices
+hw-obj-$(CONFIG_PCI) += wdt_i6300esb.o
+
+hw-obj-$(CONFIG_PCI) += pcie.o pcie_aer.o pcie_port.o
+
+# PCI network cards
+hw-obj-$(CONFIG_NE2000_PCI) += ne2000.o
+hw-obj-$(CONFIG_EEPRO100_PCI) += eepro100.o
+hw-obj-$(CONFIG_PCNET_PCI) += pcnet-pci.o
+hw-obj-$(CONFIG_PCNET_COMMON) += pcnet.o
+hw-obj-$(CONFIG_E1000_PCI) += e1000.o
+hw-obj-$(CONFIG_RTL8139_PCI) += rtl8139.o
+
+hw-obj-$(CONFIG_SMC91C111) += smc91c111.o
+hw-obj-$(CONFIG_LAN9118) += lan9118.o
+hw-obj-$(CONFIG_NE2000_ISA) += ne2000-isa.o
+hw-obj-$(CONFIG_OPENCORES_ETH) += opencores_eth.o
+
+# SCSI layer
+hw-obj-$(CONFIG_LSI_SCSI_PCI) += lsi53c895a.o
+hw-obj-$(CONFIG_ESP) += esp.o
+
+hw-obj-y += sysbus.o isa-bus.o
+hw-obj-y += qdev-addr.o
+
+# VGA
+hw-obj-$(CONFIG_VGA_PCI) += vga-pci.o
+hw-obj-$(CONFIG_VGA_ISA) += vga-isa.o
+hw-obj-$(CONFIG_VGA_ISA_MM) += vga-isa-mm.o
+hw-obj-$(CONFIG_VMWARE_VGA) += vmware_vga.o
+hw-obj-$(CONFIG_VMMOUSE) += vmmouse.o
+hw-obj-$(CONFIG_VGA_CIRRUS) += cirrus_vga.o
+
+hw-obj-$(CONFIG_RC4030) += rc4030.o
+hw-obj-$(CONFIG_DP8393X) += dp8393x.o
+hw-obj-$(CONFIG_DS1225Y) += ds1225y.o
+hw-obj-$(CONFIG_MIPSNET) += mipsnet.o
+
+# Sound
+sound-obj-y =
+sound-obj-$(CONFIG_SB16) += sb16.o
+sound-obj-$(CONFIG_ES1370) += es1370.o
+sound-obj-$(CONFIG_AC97) += ac97.o
+sound-obj-$(CONFIG_ADLIB) += fmopl.o adlib.o
+sound-obj-$(CONFIG_GUS) += gus.o gusemu_hal.o gusemu_mixer.o
+sound-obj-$(CONFIG_CS4231A) += cs4231a.o
+sound-obj-$(CONFIG_HDA) += intel-hda.o hda-audio.o
+
+hw-obj-$(CONFIG_SOUND) += $(sound-obj-y)
+
+hw-obj-$(CONFIG_REALLY_VIRTFS) += 9pfs/
+
common-obj-y += usb/
common-obj-y += irq.o
common-obj-$(CONFIG_PTIMER) += ptimer.o
diff --git a/hw/ide/Makefile b/hw/ide/Makefile
new file mode 100644
index 0000000..cf718dd
--- /dev/null
+++ b/hw/ide/Makefile
@@ -0,0 +1,10 @@
+hw-obj-$(CONFIG_IDE_CORE) += core.o atapi.o
+hw-obj-$(CONFIG_IDE_QDEV) += qdev.o
+hw-obj-$(CONFIG_IDE_PCI) += pci.o
+hw-obj-$(CONFIG_IDE_ISA) += isa.o
+hw-obj-$(CONFIG_IDE_PIIX) += piix.o
+hw-obj-$(CONFIG_IDE_CMD646) += cmd646.o
+hw-obj-$(CONFIG_IDE_MACIO) += macio.o
+hw-obj-$(CONFIG_IDE_VIA) += via.o
+hw-obj-$(CONFIG_AHCI) += ahci.o
+hw-obj-$(CONFIG_AHCI) += ich.o
diff --git a/hw/usb/Makefile b/hw/usb/Makefile
index 7dbc33b..9c7ddf5 100644
--- a/hw/usb/Makefile
+++ b/hw/usb/Makefile
@@ -1,3 +1,12 @@
+hw-obj-$(CONFIG_USB_UHCI) += hcd-uhci.o
+hw-obj-$(CONFIG_USB_OHCI) += hcd-ohci.o
+hw-obj-$(CONFIG_USB_EHCI) += hcd-ehci.o
+hw-obj-$(CONFIG_USB_XHCI) += hcd-xhci.o
+hw-obj-y += libhw.o
+
+hw-obj-$(CONFIG_SMARTCARD) += dev-smartcard-reader.o
+hw-obj-$(CONFIG_USB_REDIR) += redirect.o
+
common-obj-y += core.o bus.o desc.o dev-hub.o
common-obj-y += host-$(HOST_USB).o dev-bluetooth.o
common-obj-y += dev-hid.o dev-storage.o dev-wacom.o
--
1.7.10.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH 20/24] move per-target hw/ objects to nested Makefiles
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
` (18 preceding siblings ...)
2012-06-03 12:25 ` [Qemu-devel] [PATCH 19/24] convert libhw " Paolo Bonzini
@ 2012-06-03 12:25 ` Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 21/24] move device tree to per-target Makefile Paolo Bonzini
` (7 subsequent siblings)
27 siblings, 0 replies; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 12:25 UTC (permalink / raw)
To: qemu-devel
This completes the move to nested Makefiles for virtio and a few
other files that were not part of obj-TARGET-y, but still were
compiled separately for each target.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile.hw | 5 +++--
Makefile.target | 22 +---------------------
configure | 1 +
hw/9pfs/Makefile | 2 ++
hw/Makefile | 17 +++++++++++++++++
5 files changed, 24 insertions(+), 23 deletions(-)
diff --git a/Makefile.hw b/Makefile.hw
index 155a0c3..2bcbaff 100644
--- a/Makefile.hw
+++ b/Makefile.hw
@@ -19,7 +19,8 @@ all: $(hw-obj-y)
@true
clean:
- rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~ */*/*.d
+ rm -f $(addsuffix /*.o, $(dir $(sort $(hw-obj-y))))
+ rm -f $(addsuffix /*.d, $(dir $(sort $(hw-obj-y))))
# Include automatically generated dependency files
--include $(wildcard *.d */*.d */*/*.d)
+-include $(patsubst %.o, %.d, $(hw-obj-y))
diff --git a/Makefile.target b/Makefile.target
index e4bc550..1770901 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -123,17 +123,9 @@ endif #CONFIG_BSD_USER
ifdef CONFIG_SOFTMMU
obj-y += arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o
-# virtio has to be here due to weird dependency between PCI and virtio-net.
-# need to fix this properly
-obj-$(CONFIG_NO_PCI) += pci-stub.o
-obj-$(CONFIG_VIRTIO) += virtio.o virtio-blk.o virtio-balloon.o virtio-net.o virtio-serial-bus.o
-obj-$(CONFIG_VIRTIO) += virtio-scsi.o
-obj-y += vhost_net.o
-obj-$(CONFIG_VHOST_NET) += vhost.o
-obj-$(CONFIG_REALLY_VIRTFS) += 9pfs/virtio-9p-device.o
+obj-y += hw/
obj-$(CONFIG_KVM) += kvm-all.o
obj-$(CONFIG_NO_KVM) += kvm-stub.o
-obj-$(CONFIG_VGA) += vga.o
obj-y += memory.o savevm.o cputlb.o
LIBS+=-lz
@@ -146,18 +138,6 @@ QEMU_CFLAGS += $(VNC_PNG_CFLAGS)
obj-$(CONFIG_XEN) += xen-all.o xen_machine_pv.o xen_domainbuild.o xen-mapcache.o
obj-$(CONFIG_NO_XEN) += xen-stub.o
-# Inter-VM PCI shared memory
-CONFIG_IVSHMEM =
-ifeq ($(CONFIG_KVM), y)
- ifeq ($(CONFIG_PCI), y)
- CONFIG_IVSHMEM = y
- endif
-endif
-obj-$(CONFIG_IVSHMEM) += ivshmem.o
-
-# Generic hotplugging
-obj-y += device-hotplug.o
-
# Hardware support
ifeq ($(TARGET_ARCH), sparc64)
obj-y += hw/sparc64/
diff --git a/configure b/configure
index 6d0a935..22063f2 100755
--- a/configure
+++ b/configure
@@ -3656,6 +3656,7 @@ mkdir -p $target_dir/9pfs
mkdir -p $target_dir/hw
mkdir -p $target_dir/hw/ide
mkdir -p $target_dir/hw/usb
+mkdir -p $target_dir/hw/9pfs
mkdir -p $target_dir/hw/kvm
mkdir -p $target_dir/hw/$TARGET_ARCH
mkdir -p $target_dir/hw/$TARGET_BASE_ARCH
diff --git a/hw/9pfs/Makefile b/hw/9pfs/Makefile
index 2700772..972df24 100644
--- a/hw/9pfs/Makefile
+++ b/hw/9pfs/Makefile
@@ -5,3 +5,5 @@ hw-obj-y += virtio-9p-coth.o cofs.o codir.o cofile.o
hw-obj-y += coxattr.o virtio-9p-synth.o
hw-obj-$(CONFIG_OPEN_BY_HANDLE) += virtio-9p-handle.o
hw-obj-y += virtio-9p-proxy.o
+
+obj-y += virtio-9p-device.o
diff --git a/hw/Makefile b/hw/Makefile
index 43dc824..5ad8554 100644
--- a/hw/Makefile
+++ b/hw/Makefile
@@ -143,3 +143,20 @@ common-obj-$(CONFIG_BRLAPI) += baum.o
# xen backend driver support
common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_devconfig.o
common-obj-$(CONFIG_XEN_BACKEND) += xen_console.o xenfb.o xen_disk.o xen_nic.o
+
+# Per-target files
+# virtio has to be here due to weird dependency between PCI and virtio-net.
+# need to fix this properly
+obj-$(CONFIG_VIRTIO) += virtio.o virtio-blk.o virtio-balloon.o virtio-net.o
+obj-$(CONFIG_VIRTIO) += virtio-serial-bus.o virtio-scsi.o
+obj-y += vhost_net.o
+obj-$(CONFIG_VHOST_NET) += vhost.o
+obj-$(CONFIG_REALLY_VIRTFS) += 9pfs/
+obj-$(CONFIG_NO_PCI) += pci-stub.o
+obj-$(CONFIG_VGA) += vga.o
+obj-y += device-hotplug.o
+
+# Inter-VM PCI shared memory
+ifeq ($(CONFIG_PCI), y)
+obj-$(CONFIG_KVM) += ivshmem.o
+endif
--
1.7.10.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH 21/24] move device tree to per-target Makefile
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
` (19 preceding siblings ...)
2012-06-03 12:25 ` [Qemu-devel] [PATCH 20/24] move per-target hw/ objects " Paolo Bonzini
@ 2012-06-03 12:25 ` Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 22/24] libcacard Makefile cleanups Paolo Bonzini
` (6 subsequent siblings)
27 siblings, 0 replies; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 12:25 UTC (permalink / raw)
To: qemu-devel
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile.target | 7 -------
hw/arm/Makefile | 1 +
hw/microblaze/Makefile | 1 +
hw/ppc/Makefile | 1 +
4 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/Makefile.target b/Makefile.target
index 1770901..5bd5538 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -145,13 +145,6 @@ else
obj-y += hw/$(TARGET_BASE_ARCH)/
endif
-# Device tree
-ifeq ($(CONFIG_FDT), y)
-obj-$(TARGET_ARM) += device_tree.o
-obj-$(TARGET_MICROBLAZE) += device_tree.o
-obj-$(TARGET_PPC) += device_tree.o
-endif
-
main.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h
diff --git a/hw/arm/Makefile b/hw/arm/Makefile
index 92b4f1e..a0ff6a6 100644
--- a/hw/arm/Makefile
+++ b/hw/arm/Makefile
@@ -35,5 +35,6 @@ obj-y += vexpress.o
obj-y += strongarm.o
obj-y += collie.o
obj-y += pl041.o lm4549.o
+obj-$(CONFIG_FDT) += ../device_tree.o
obj-y := $(addprefix ../,$(obj-y))
diff --git a/hw/microblaze/Makefile b/hw/microblaze/Makefile
index 4172442..020f7b6 100644
--- a/hw/microblaze/Makefile
+++ b/hw/microblaze/Makefile
@@ -9,5 +9,6 @@ obj-y += xilinx_uartlite.o
obj-y += xilinx_ethlite.o
obj-y += xilinx_axidma.o
obj-y += xilinx_axienet.o
+obj-$(CONFIG_FDT) += ../device_tree.o
obj-y := $(addprefix ../,$(obj-y))
diff --git a/hw/ppc/Makefile b/hw/ppc/Makefile
index 8fb7633..070f497 100644
--- a/hw/ppc/Makefile
+++ b/hw/ppc/Makefile
@@ -21,6 +21,7 @@ obj-y += virtex_ml507.o
obj-$(CONFIG_KVM) += kvm_ppc.o
# PowerPC OpenPIC
obj-y += openpic.o
+obj-$(CONFIG_FDT) += ../device_tree.o
# Xilinx PPC peripherals
obj-y += xilinx_intc.o
--
1.7.10.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH 22/24] libcacard Makefile cleanups
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
` (20 preceding siblings ...)
2012-06-03 12:25 ` [Qemu-devel] [PATCH 21/24] move device tree to per-target Makefile Paolo Bonzini
@ 2012-06-03 12:25 ` Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 23/24] limit usage of vpath Paolo Bonzini
` (5 subsequent siblings)
27 siblings, 0 replies; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 12:25 UTC (permalink / raw)
To: qemu-devel
Build vscclient from toplevel Makefile, limit usage of vpath.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile | 4 ++++
Makefile.objs | 8 +++++++-
Makefile.target | 6 ------
configure | 12 +++++-------
libcacard/Makefile | 17 ++++++-----------
5 files changed, 22 insertions(+), 25 deletions(-)
diff --git a/Makefile b/Makefile
index 3ffeb03..75cbbda 100644
--- a/Makefile
+++ b/Makefile
@@ -147,6 +147,10 @@ libcacard.la: $(oslib-obj-y) qemu-timer-common.o $(addsuffix .lo, $(basename $(t
install-libcacard: libcacard.la
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" install-libcacard,)
endif
+
+vscclient$(EXESUF): $(libcacard-y) $(oslib-obj-y) qemu-timer-common.o libcacard/vscclient.o
+ $(call quiet-command,$(CC) -o $@ $^ $(libcacard_libs) $(LIBS)," LINK $@")
+
######################################################################
qemu-img.o: qemu-img-cmds.h
diff --git a/Makefile.objs b/Makefile.objs
index 2c0c3f6..b91d4f4 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -198,7 +198,13 @@ $(trace-obj-y): $(GENERATED_HEADERS)
######################################################################
# smartcard
-libcacard-y = cac.o event.o vcard.o vreader.o vcard_emul_nss.o vcard_emul_type.o card_7816.o
+libcacard-y += libcacard/cac.o libcacard/event.o
+libcacard-y += libcacard/vcard.o libcacard/vreader.o
+libcacard-y += libcacard/vcard_emul_nss.o
+libcacard-y += libcacard/vcard_emul_type.o
+libcacard-y += libcacard/card_7816.o
+
+common-obj-$(CONFIG_SMARTCARD_NSS) += $(libcacard-y)
######################################################################
# qapi
diff --git a/Makefile.target b/Makefile.target
index 5bd5538..c714b76 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -160,16 +160,10 @@ all-obj-y = $(obj-y)
all-obj-y += $(addprefix ../, $(universal-obj-y))
ifdef CONFIG_SOFTMMU
-
all-obj-y += $(addprefix ../, $(common-obj-y))
all-obj-y += $(addprefix ../libdis/, $(libdis-y))
all-obj-y += $(addprefix $(HWDIR)/, $(hw-obj-y))
all-obj-y += $(addprefix ../, $(trace-obj-y))
-
-# libcacard needs qemu-thread support, and besides is only needed by devices
-# so not requires with linux-user / bsd-user targets
-all-obj-$(CONFIG_SMARTCARD_NSS) += $(addprefix ../libcacard/, $(libcacard-y))
-
else
all-obj-y += $(addprefix ../libuser/, $(user-obj-y))
all-obj-y += $(addprefix ../libdis-user/, $(libdis-y))
diff --git a/configure b/configure
index 22063f2..a4d7821 100755
--- a/configure
+++ b/configure
@@ -2912,6 +2912,9 @@ if test "$softmmu" = yes ; then
fi
fi
fi
+if test "$smartcard_nss" = "yes" ; then
+ tools="vscclient\$(EXESUF) $tools"
+fi
# Mac OS X ships with a broken assembler
roms=
@@ -3932,9 +3935,10 @@ DIRS="$DIRS roms/seabios roms/vgabios"
DIRS="$DIRS fsdev ui hw hw/usb"
DIRS="$DIRS qapi qapi-generated"
DIRS="$DIRS qga trace qom"
+DIRS="$DIRS libcacard libcacard/libcacard libcacard/trace"
FILES="Makefile tests/tcg/Makefile qdict-test-data.txt"
FILES="$FILES tests/tcg/cris/Makefile tests/tcg/cris/.gdbinit"
-FILES="$FILES tests/tcg/lm32/Makefile"
+FILES="$FILES tests/tcg/lm32/Makefile libcacard/Makefile"
FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps"
FILES="$FILES pc-bios/spapr-rtas/Makefile"
FILES="$FILES roms/seabios/Makefile roms/vgabios/Makefile"
@@ -3978,12 +3982,6 @@ for hwlib in 32 64; do
echo "QEMU_CFLAGS+=-DTARGET_PHYS_ADDR_BITS=$hwlib" > $d/config.mak
done
-if [ "$source_path" != `pwd` ]; then
- # out of tree build
- mkdir -p libcacard
- symlink "$source_path/libcacard/Makefile" libcacard/Makefile
-fi
-
d=libuser
mkdir -p $d
mkdir -p $d/trace
diff --git a/libcacard/Makefile b/libcacard/Makefile
index c6a896a..fdc2873 100644
--- a/libcacard/Makefile
+++ b/libcacard/Makefile
@@ -2,29 +2,23 @@
-include $(SRC_PATH)/Makefile.objs
-include $(SRC_PATH)/rules.mak
-libcacard_srcpath=$(SRC_PATH)/libcacard
libcacard_includedir=$(includedir)/cacard
-$(call set-vpath, $(SRC_PATH):$(libcacard_srcpath))
-
-# objects linked against normal qemu binaries, not compiled with libtool
-QEMU_OBJS=$(addprefix ../,$(oslib-obj-y) qemu-timer-common.o $(trace-obj-y))
+$(call set-vpath, $(SRC_PATH))
# objects linked into a shared library, built with libtool with -fPIC if required
-QEMU_OBJS_LIB=$(addsuffix .lo,$(basename $(QEMU_OBJS)))
+QEMU_OBJS=$(oslib-obj-y) qemu-timer-common.o $(trace-obj-y)
+QEMU_OBJS_LIB=$(patsubst %.o,%.lo,$(QEMU_OBJS))
QEMU_CFLAGS+=-I../
-libcacard.lib-y=$(addsuffix .lo,$(basename $(libcacard-y)))
-
-vscclient: $(libcacard-y) $(QEMU_OBJS) vscclient.o
- $(call quiet-command,$(CC) -o $@ $^ $(libcacard_libs) $(LIBS)," LINK $@")
+libcacard.lib-y=$(patsubst %.o,%.lo,$(libcacard-y))
clean:
rm -f *.o */*.o *.d */*.d *.a */*.a *~ */*~ vscclient *.lo .libs/* *.la *.pc
rm -Rf .libs
-all: vscclient
+all: libcacard.la libcacard.pc
# Dummy command so that make thinks it has done something
@true
@@ -41,6 +35,7 @@ else
libcacard.la: $(libcacard.lib-y) $(QEMU_OBJS_LIB)
$(call quiet-command,$(LIBTOOL) --mode=link --quiet --tag=CC $(CC) -rpath $(libdir) -o $@ $^ $(libcacard_libs)," lt LINK $@")
+libcacard_srcpath=$(SRC_PATH)/libcacard
libcacard.pc: $(libcacard_srcpath)/libcacard.pc.in
sed -e 's|@LIBDIR@|$(libdir)|' \
-e 's|@INCLUDEDIR@|$(libcacard_includedir)|' \
--
1.7.10.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH 23/24] limit usage of vpath
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
` (21 preceding siblings ...)
2012-06-03 12:25 ` [Qemu-devel] [PATCH 22/24] libcacard Makefile cleanups Paolo Bonzini
@ 2012-06-03 12:25 ` Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 24/24] compile oslib-obj-y once Paolo Bonzini
` (4 subsequent siblings)
27 siblings, 0 replies; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 12:25 UTC (permalink / raw)
To: qemu-devel
All paths are now explicitly given, and the object tree mimics
the source tree, so there is no need to apply special vpaths.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile | 2 +-
Makefile.target | 5 ++---
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 75cbbda..f63bb30 100644
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,7 @@ configure: ;
.PHONY: all clean cscope distclean dvi html info install install-doc \
pdf recurse-all speed tar tarbin test build-all
-$(call set-vpath, $(SRC_PATH):$(SRC_PATH)/hw)
+$(call set-vpath, $(SRC_PATH))
LIBS+=-lz $(LIBS_TOOLS)
diff --git a/Makefile.target b/Makefile.target
index c714b76..78147c3 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -12,12 +12,11 @@ ifneq ($(HWDIR),)
include $(HWDIR)/config.mak
endif
-TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
-$(call set-vpath, $(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw)
+$(call set-vpath, $(SRC_PATH))
ifdef CONFIG_LINUX
QEMU_CFLAGS += -I../linux-headers
endif
-QEMU_CFLAGS += -I.. -I$(TARGET_PATH) -DNEED_CPU_H
+QEMU_CFLAGS += -I.. -I$(SRC_PATH)/target-$(TARGET_BASE_ARCH) -DNEED_CPU_H
QEMU_CFLAGS+=-I$(SRC_PATH)/include
--
1.7.10.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [Qemu-devel] [PATCH 24/24] compile oslib-obj-y once
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
` (22 preceding siblings ...)
2012-06-03 12:25 ` [Qemu-devel] [PATCH 23/24] limit usage of vpath Paolo Bonzini
@ 2012-06-03 12:25 ` Paolo Bonzini
2012-06-03 13:31 ` [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Blue Swirl
` (3 subsequent siblings)
27 siblings, 0 replies; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 12:25 UTC (permalink / raw)
To: qemu-devel
There is no difference in oslib-obj-y between user-mode and system
targets. There used to be when user-mode could optionally be
compiled with PIE.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile.objs | 3 ++-
Makefile.target | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/Makefile.objs b/Makefile.objs
index b91d4f4..797c440 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -22,6 +22,8 @@ oslib-obj-y = osdep.o
oslib-obj-$(CONFIG_WIN32) += oslib-win32.o qemu-thread-win32.o
oslib-obj-$(CONFIG_POSIX) += oslib-posix.o qemu-thread-posix.o
+universal-obj-y += $(oslib-obj-y)
+
#######################################################################
# coroutines
coroutine-obj-y = qemu-coroutine.o qemu-coroutine-lock.o qemu-coroutine-io.o
@@ -63,7 +65,6 @@ common-obj-y += net.o net/
common-obj-y += qom/
common-obj-$(CONFIG_LINUX) += fsdev/
common-obj-y += readline.o console.o cursor.o
-common-obj-y += $(oslib-obj-y)
common-obj-$(CONFIG_WIN32) += os-win32.o
common-obj-$(CONFIG_POSIX) += os-posix.o
diff --git a/Makefile.target b/Makefile.target
index 78147c3..98b4054 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -101,7 +101,7 @@ ifdef CONFIG_LINUX_USER
QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) -I$(SRC_PATH)/linux-user
obj-y += linux-user/
-obj-y += gdbstub.o thunk.o user-exec.o $(oslib-obj-y)
+obj-y += gdbstub.o thunk.o user-exec.o
endif #CONFIG_LINUX_USER
--
1.7.10.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
` (23 preceding siblings ...)
2012-06-03 12:25 ` [Qemu-devel] [PATCH 24/24] compile oslib-obj-y once Paolo Bonzini
@ 2012-06-03 13:31 ` Blue Swirl
2012-06-03 17:34 ` Paolo Bonzini
2012-06-03 22:40 ` Andreas Färber
` (2 subsequent siblings)
27 siblings, 1 reply; 42+ messages in thread
From: Blue Swirl @ 2012-06-03 13:31 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
On Sun, Jun 3, 2012 at 12:25 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> One source of complexity in the QEMU source is that we have a very
> shallow tree for a source code of over 750,000 lines of code. In
> fact, one third of these lines alone is in one directory, hw/.
>
> As a prerequisite to cleaning up the structure, but as a worthwhile
> step on its own, this patchset cleans up the build system so that
> separate directories have their own Makefile snippet. As in the Linux
> kernel build system, the overall build system is generally flat (in
> the case of QEMU, with one recursive invocation per emulation target).
> Subdirectories do not include complete Makefiles, instead they only host
> the declarations for a few variables (common-obj-y, universal-obj-y,
> obj-y, etc.). Definitions for all the directories are merged with a
> little GNU Make magic (not much, only 20 lines).
>
> Two nice side effects are:
>
> - we can match the source tree and the object tree (for example the
> per-target device models will be in XYZ-softmmu/hw, not in
> XYZ-softmmu; those that are compiled once will be in hw/ rather
> than in the root).
>
> - because the resolution of nested makefiles tracks the nested
> directory, there is no need to use VPATH to find sources in
> the hw/ and target-*/ directory.
>
> - there is a lot less Makefile programming (conditionals, addprefix,
> etc.), replaced by only 20 lines in rules.mak and 1 in Makefile.objs.
>
> The series is entirely bisectable, and mostly consists of boring patches.
> If the concept is accepted, I would like to get it in as soon as possible.
> I have a few other cleanups on top (I stopped once I undid the diffstat
> of this series :)), but they can be covered later.
>
> Thoughts, approvals, rejections?
Neat. Could we (eventually) eliminate Makefile.dis, Makefile.hw,
Makefile.target and Makefile.user completely?
>
> Paolo
>
>
> Paolo Bonzini (24):
> remove trace-nested-y
> do not sprinkle around GENERATED_HEADERS dependencies
> add rules for nesting
> move *-user/ objects to nested Makefile
> move obj-TARGET-y variables to nested Makefile
> move libobj-y variable to nested Makefile
> move other target-*/ objects to nested Makefiles
> move rules for nesting to Makefile.objs
> use nested Makefile rules for qom/ objects
> move block/ objects to nested Makefile
> move net/ objects to nested Makefile
> move fsdev/ objects to nested Makefile
> move ui/ objects to nested Makefile
> move audio/ objects to nested Makefile
> move slirp/ objects to nested Makefile
> move qapi/ objects to nested Makefile
> move qga/ objects to nested Makefile
> move target-independent hw/ objects to nested Makefiles
> convert libhw to nested Makefiles
> move per-target hw/ objects to nested Makefiles
> move device tree to per-target Makefile
> libcacard Makefile cleanups
> limit usage of vpath
> compile oslib-obj-y once
>
> Makefile | 30 ++-
> Makefile.hw | 7 +-
> Makefile.objs | 316 ++++---------------------
> Makefile.target | 325 ++++----------------------
> audio/Makefile | 15 ++
> block/Makefile | 11 +
> bsd-user/Makefile | 3 +
> configure | 70 +++---
> fsdev/Makefile | 6 +
> hw/9pfs/Makefile | 9 +
> hw/Makefile | 162 +++++++++++++
> hw/alpha/Makefile | 4 +
> hw/arm/Makefile | 40 ++++
> hw/cris/Makefile | 13 ++
> hw/i386/Makefile | 13 ++
> hw/ide/Makefile | 10 +
> hw/lm32/Makefile | 23 ++
> hw/m68k/Makefile | 4 +
> hw/microblaze/Makefile | 14 ++
> hw/mips/Makefile | 6 +
> hw/ppc/Makefile | 32 +++
> hw/s390x/Makefile | 3 +
> hw/sh4/Makefile | 5 +
> hw/sparc/Makefile | 8 +
> hw/sparc64/Makefile | 4 +
> hw/usb/Makefile | 13 ++
> hw/xtensa/Makefile | 5 +
> libcacard/Makefile | 17 +-
> linux-user/Makefile | 7 +
> linux-user/arm/nwfpe/Makefile | 3 +
> net/Makefile | 13 ++
> qapi/Makefile | 3 +
> qga/Makefile | 4 +
> qom/Makefile | 6 +-
> rules.mak | 21 ++
> slirp/Makefile | 4 +
> target-alpha/Makefile | 3 +
> target-arm/Makefile | 4 +
> arm-semi.c => target-arm/arm-semi.c | 0
> target-cris/Makefile | 2 +
> target-i386/Makefile | 6 +
> ioport-user.c => target-i386/ioport-user.c | 0
> target-lm32/Makefile | 2 +
> target-m68k/Makefile | 3 +
> m68k-semi.c => target-m68k/m68k-semi.c | 0
> target-microblaze/Makefile | 2 +
> target-mips/Makefile | 2 +
> target-ppc/Makefile | 3 +
> target-s390x/Makefile | 3 +
> target-sh4/Makefile | 2 +
> target-sparc/Makefile | 6 +
> target-unicore32/Makefile | 2 +
> target-xtensa/Makefile | 6 +
> xtensa-semi.c => target-xtensa/xtensa-semi.c | 0
> tests/Makefile | 1 -
> ui/Makefile | 18 ++
> 56 files changed, 674 insertions(+), 620 deletions(-)
> create mode 100644 audio/Makefile
> create mode 100644 block/Makefile
> create mode 100644 bsd-user/Makefile
> create mode 100644 fsdev/Makefile
> create mode 100644 hw/9pfs/Makefile
> create mode 100644 hw/Makefile
> create mode 100644 hw/alpha/Makefile
> create mode 100644 hw/arm/Makefile
> create mode 100644 hw/cris/Makefile
> create mode 100644 hw/i386/Makefile
> create mode 100644 hw/ide/Makefile
> create mode 100644 hw/lm32/Makefile
> create mode 100644 hw/m68k/Makefile
> create mode 100644 hw/microblaze/Makefile
> create mode 100644 hw/mips/Makefile
> create mode 100644 hw/ppc/Makefile
> create mode 100644 hw/s390x/Makefile
> create mode 100644 hw/sh4/Makefile
> create mode 100644 hw/sparc/Makefile
> create mode 100644 hw/sparc64/Makefile
> create mode 100644 hw/usb/Makefile
> create mode 100644 hw/xtensa/Makefile
> create mode 100644 linux-user/Makefile
> create mode 100644 linux-user/arm/nwfpe/Makefile
> create mode 100644 net/Makefile
> create mode 100644 qapi/Makefile
> create mode 100644 qga/Makefile
> create mode 100644 slirp/Makefile
> create mode 100644 target-alpha/Makefile
> create mode 100644 target-arm/Makefile
> rename arm-semi.c => target-arm/arm-semi.c (100%)
> create mode 100644 target-cris/Makefile
> create mode 100644 target-i386/Makefile
> rename ioport-user.c => target-i386/ioport-user.c (100%)
> create mode 100644 target-lm32/Makefile
> create mode 100644 target-m68k/Makefile
> rename m68k-semi.c => target-m68k/m68k-semi.c (100%)
> create mode 100644 target-microblaze/Makefile
> create mode 100644 target-mips/Makefile
> create mode 100644 target-ppc/Makefile
> create mode 100644 target-s390x/Makefile
> create mode 100644 target-sh4/Makefile
> create mode 100644 target-sparc/Makefile
> create mode 100644 target-unicore32/Makefile
> create mode 100644 target-xtensa/Makefile
> rename xtensa-semi.c => target-xtensa/xtensa-semi.c (100%)
> create mode 100644 ui/Makefile
>
> --
> 1.7.10.1
>
>
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH 12/24] move fsdev/ objects to nested Makefile
2012-06-03 12:25 ` [Qemu-devel] [PATCH 12/24] move fsdev/ " Paolo Bonzini
@ 2012-06-03 13:32 ` Blue Swirl
0 siblings, 0 replies; 42+ messages in thread
From: Blue Swirl @ 2012-06-03 13:32 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
On Sun, Jun 3, 2012 at 12:25 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> Makefile.objs | 6 +-----
> fsdev/Makefile | 6 ++++++
> 2 files changed, 7 insertions(+), 5 deletions(-)
> create mode 100644 fsdev/Makefile
>
> diff --git a/Makefile.objs b/Makefile.objs
> index 8433fad..383d4cc 100644
> --- a/Makefile.objs
> +++ b/Makefile.objs
> @@ -51,11 +51,7 @@ ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy)
> # Lots of the fsdev/9pcode is pulled in by vl.c via qemu_fsdev_add.
> # only pull in the actual virtio-9p device if we also enabled virtio.
> CONFIG_REALLY_VIRTFS=y
> -fsdev-nested-y = qemu-fsdev.o virtio-9p-marshal.o
> -else
> -fsdev-nested-y = qemu-fsdev-dummy.o
> endif
> -fsdev-obj-$(CONFIG_VIRTFS) += $(addprefix fsdev/, $(fsdev-nested-y))
>
> ######################################################################
> # Target independent part of system emulation. The long term path is to
> @@ -65,7 +61,7 @@ fsdev-obj-$(CONFIG_VIRTFS) += $(addprefix fsdev/, $(fsdev-nested-y))
> common-obj-y = $(block-obj-y) blockdev.o
> common-obj-y += net.o net/
> common-obj-y += qom/
> -common-obj-$(CONFIG_LINUX) += $(fsdev-obj-$(CONFIG_LINUX))
> +common-obj-$(CONFIG_LINUX) += fsdev/
> common-obj-y += readline.o console.o cursor.o
> common-obj-y += $(oslib-obj-y)
> common-obj-$(CONFIG_WIN32) += os-win32.o
> diff --git a/fsdev/Makefile b/fsdev/Makefile
> new file mode 100644
> index 0000000..7f13d86
> --- /dev/null
> +++ b/fsdev/Makefile
> @@ -0,0 +1,6 @@
> +ifeq ($(CONFIG_REALLY_VIRTFS),y)
> +common-obj-y = qemu-fsdev.o virtio-9p-marshal.o
> +else
> +common-obj-y = qemu-fsdev-dummy.o
> +endif
> +
Empty line at the end.
> --
> 1.7.10.1
>
>
>
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH 14/24] move audio/ objects to nested Makefile
2012-06-03 12:25 ` [Qemu-devel] [PATCH 14/24] move audio/ " Paolo Bonzini
@ 2012-06-03 13:33 ` Blue Swirl
0 siblings, 0 replies; 42+ messages in thread
From: Blue Swirl @ 2012-06-03 13:33 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
On Sun, Jun 3, 2012 at 12:25 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> Makefile.objs | 18 ++----------------
> audio/Makefile | 15 +++++++++++++++
> 2 files changed, 17 insertions(+), 16 deletions(-)
> create mode 100644 audio/Makefile
>
> diff --git a/Makefile.objs b/Makefile.objs
> index b0fa446..f1be02a 100644
> --- a/Makefile.objs
> +++ b/Makefile.objs
> @@ -108,23 +108,9 @@ common-obj-$(CONFIG_BRLAPI) += baum.o
> common-obj-$(CONFIG_POSIX) += migration-exec.o migration-unix.o migration-fd.o
> common-obj-$(CONFIG_WIN32) += version.o
>
> -
> -audio-obj-y = audio.o noaudio.o wavaudio.o mixeng.o
> -audio-obj-$(CONFIG_SDL) += sdlaudio.o
> -audio-obj-$(CONFIG_OSS) += ossaudio.o
> -audio-obj-$(CONFIG_SPICE) += spiceaudio.o
> -audio-obj-$(CONFIG_COREAUDIO) += coreaudio.o
> -audio-obj-$(CONFIG_ALSA) += alsaaudio.o
> -audio-obj-$(CONFIG_DSOUND) += dsoundaudio.o
> -audio-obj-$(CONFIG_FMOD) += fmodaudio.o
> -audio-obj-$(CONFIG_ESD) += esdaudio.o
> -audio-obj-$(CONFIG_PA) += paaudio.o
> -audio-obj-$(CONFIG_WINWAVE) += winwaveaudio.o
> -audio-obj-$(CONFIG_AUDIO_PT_INT) += audio_pt_int.o
> -audio-obj-$(CONFIG_AUDIO_WIN_INT) += audio_win_int.o
> -audio-obj-y += wavcapture.o
> -common-obj-y += $(addprefix audio/, $(audio-obj-y))
> common-obj-$(CONFIG_SPICE) += spice-qemu-char.o
> +
> +common-obj-y += audio/
> common-obj-y += ui/
>
> common-obj-y += iov.o acl.o
> diff --git a/audio/Makefile b/audio/Makefile
> new file mode 100644
> index 0000000..a54f7ae
> --- /dev/null
> +++ b/audio/Makefile
> @@ -0,0 +1,15 @@
> +common-obj-y = audio.o noaudio.o wavaudio.o mixeng.o
> +common-obj-$(CONFIG_SDL) += sdlaudio.o
> +common-obj-$(CONFIG_OSS) += ossaudio.o
> +common-obj-$(CONFIG_SPICE) += spiceaudio.o
> +common-obj-$(CONFIG_COREAUDIO) += coreaudio.o
> +common-obj-$(CONFIG_ALSA) += alsaaudio.o
> +common-obj-$(CONFIG_DSOUND) += dsoundaudio.o
> +common-obj-$(CONFIG_FMOD) += fmodaudio.o
> +common-obj-$(CONFIG_ESD) += esdaudio.o
> +common-obj-$(CONFIG_PA) += paaudio.o
> +common-obj-$(CONFIG_WINWAVE) += winwaveaudio.o
> +common-obj-$(CONFIG_AUDIO_PT_INT) += audio_pt_int.o
> +common-obj-$(CONFIG_AUDIO_WIN_INT) += audio_win_int.o
> +common-obj-y += wavcapture.o
> +
Also here.
> --
> 1.7.10.1
>
>
>
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH 06/24] move libobj-y variable to nested Makefile
2012-06-03 12:25 ` [Qemu-devel] [PATCH 06/24] move libobj-y variable " Paolo Bonzini
@ 2012-06-03 13:42 ` Blue Swirl
2012-06-03 17:32 ` Paolo Bonzini
0 siblings, 1 reply; 42+ messages in thread
From: Blue Swirl @ 2012-06-03 13:42 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
On Sun, Jun 3, 2012 at 12:25 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> Makefile.target | 42 ++++++++----------------------------------
> configure | 6 ------
> target-alpha/Makefile | 3 ++-
> target-arm/Makefile | 2 ++
> target-cris/Makefile | 3 ++-
> target-i386/Makefile | 2 +-
> target-lm32/Makefile | 2 +-
> target-m68k/Makefile | 1 +
> target-microblaze/Makefile | 3 ++-
> target-mips/Makefile | 2 +-
> target-ppc/Makefile | 2 +-
> target-s390x/Makefile | 2 +-
> target-sh4/Makefile | 2 +-
> target-sparc/Makefile | 6 +++++-
> target-unicore32/Makefile | 2 +-
> target-xtensa/Makefile | 1 +
> 16 files changed, 30 insertions(+), 51 deletions(-)
>
> diff --git a/Makefile.target b/Makefile.target
> index f64419d..f323ed2 100644
> --- a/Makefile.target
> +++ b/Makefile.target
> @@ -76,41 +76,20 @@ all: $(PROGS) stap
>
> #########################################################
> # cpu emulator library
> -libobj-y = exec.o translate-all.o cpu-exec.o translate.o
> -libobj-y += tcg/tcg.o tcg/optimize.o
> -libobj-$(CONFIG_TCG_INTERPRETER) += tci.o
> -libobj-y += fpu/softfloat.o
> -ifneq ($(TARGET_BASE_ARCH), sparc)
> -ifneq ($(TARGET_BASE_ARCH), alpha)
> -libobj-y += op_helper.o
> -endif
> -endif
> -libobj-y += helper.o
> -ifneq ($(TARGET_BASE_ARCH), ppc)
> -libobj-y += cpu.o
> -endif
> -libobj-$(TARGET_SPARC64) += vis_helper.o
> -libobj-$(CONFIG_NEED_MMU) += mmu.o
> -libobj-$(TARGET_ARM) += neon_helper.o iwmmxt_helper.o
> -ifeq ($(TARGET_BASE_ARCH), sparc)
> -libobj-y += fop_helper.o cc_helper.o win_helper.o mmu_helper.o ldst_helper.o
> -endif
> -libobj-$(TARGET_SPARC) += int32_helper.o
> -libobj-$(TARGET_SPARC64) += int64_helper.o
> -libobj-$(TARGET_ALPHA) += int_helper.o fpu_helper.o sys_helper.o mem_helper.o
> -
> -libobj-y += disas.o
> -libobj-$(CONFIG_TCI_DIS) += tci-dis.o
> -
> +obj-y = exec.o translate-all.o cpu-exec.o translate.o
> +obj-y += tcg/tcg.o tcg/optimize.o
> +obj-$(CONFIG_TCG_INTERPRETER) += tci.o
> +obj-y += fpu/softfloat.o
> +obj-y += disas.o
> +obj-$(CONFIG_TCI_DIS) += tci-dis.o
> obj-y += target-$(TARGET_BASE_ARCH)/
> +obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o
>
> tci-dis.o: QEMU_CFLAGS += -I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/tci
>
> # HELPER_CFLAGS is used for all the legacy code compiled with static register
> # variables
> -ifneq ($(TARGET_BASE_ARCH), sparc)
> -op_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
> -endif
> +%/op_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
This should be target specific.
Overall, the target-* changes will conflict with AREG0 conversion,
perhaps those patches should be postponed.
> user-exec.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
>
> # Note: this is a workaround. The real fix is to avoid compiling
> @@ -130,7 +109,6 @@ obj-y += gdbstub.o thunk.o user-exec.o $(oslib-obj-y)
> obj-y += $(addprefix ../, $(universal-obj-y))
> obj-y += $(addprefix ../libuser/, $(user-obj-y))
> obj-y += $(addprefix ../libdis-user/, $(libdis-y))
> -obj-y += $(libobj-y)
>
> endif #CONFIG_LINUX_USER
>
> @@ -147,7 +125,6 @@ obj-y += gdbstub.o user-exec.o
> obj-y += $(addprefix ../, $(universal-obj-y))
> obj-y += $(addprefix ../libuser/, $(user-obj-y))
> obj-y += $(addprefix ../libdis-user/, $(libdis-y))
> -obj-y += $(libobj-y)
>
> endif #CONFIG_BSD_USER
>
> @@ -212,7 +189,6 @@ GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h
> obj-y += $(addprefix ../, $(universal-obj-y))
> obj-y += $(addprefix ../, $(common-obj-y))
> obj-y += $(addprefix ../libdis/, $(libdis-y))
> -obj-y += $(libobj-y)
> obj-y += $(addprefix $(HWDIR)/, $(hw-obj-y))
> obj-y += $(addprefix ../, $(trace-obj-y))
>
> @@ -226,8 +202,6 @@ obj-$(CONFIG_SMARTCARD_NSS) += $(addprefix ../libcacard/, $(libcacard-y))
> endif # CONFIG_BSD_USER
> endif # CONFIG_LINUX_USER
>
> -obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o
> -
> nested-vars = obj-y
> dummy := $(foreach var, $(nested-vars), $(call unnest-var,$(var)))
>
> diff --git a/configure b/configure
> index 48d78e1..082f0e1 100755
> --- a/configure
> +++ b/configure
> @@ -3884,12 +3884,6 @@ if test "$target_softmmu" = "yes" ; then
> esac
> fi
>
> -if test "$target_softmmu" = "yes" -a \( \
> - "$TARGET_ARCH" = "microblaze" -o \
> - "$TARGET_ARCH" = "cris" \) ; then
> - echo "CONFIG_NEED_MMU=y" >> $config_target_mak
> -fi
> -
> if test "$gprof" = "yes" ; then
> echo "TARGET_GPROF=yes" >> $config_target_mak
> if test "$target_linux_user" = "yes" ; then
> diff --git a/target-alpha/Makefile b/target-alpha/Makefile
> index c574c9e..9a72870 100644
> --- a/target-alpha/Makefile
> +++ b/target-alpha/Makefile
> @@ -1 +1,2 @@
> -# still empty
> +obj-y += helper.o cpu.o
> +obj-y += int_helper.o fpu_helper.o sys_helper.o mem_helper.o
> diff --git a/target-arm/Makefile b/target-arm/Makefile
> index f5bb920..64b7830 100644
> --- a/target-arm/Makefile
> +++ b/target-arm/Makefile
> @@ -1 +1,3 @@
> obj-y += arm-semi.o
> +obj-y += op_helper.o helper.o cpu.o
> +obj-y += neon_helper.o iwmmxt_helper.o
> diff --git a/target-cris/Makefile b/target-cris/Makefile
> index c574c9e..8fc92b4 100644
> --- a/target-cris/Makefile
> +++ b/target-cris/Makefile
> @@ -1 +1,2 @@
> -# still empty
> +obj-y += op_helper.o helper.o cpu.o
> +obj-$(CONFIG_SOFTMMU) += mmu.o
> diff --git a/target-i386/Makefile b/target-i386/Makefile
> index 2422fc3..c64b207 100644
> --- a/target-i386/Makefile
> +++ b/target-i386/Makefile
> @@ -1,4 +1,4 @@
> +obj-y += op_helper.o helper.o cpu.o
> obj-$(CONFIG_KVM) += hyperv.o
> obj-$(CONFIG_LINUX_USER) += ioport-user.o
> obj-$(CONFIG_BSD_USER) += ioport-user.o
> -
> diff --git a/target-lm32/Makefile b/target-lm32/Makefile
> index c574c9e..15826d1 100644
> --- a/target-lm32/Makefile
> +++ b/target-lm32/Makefile
> @@ -1 +1 @@
> -# still empty
> +obj-y += op_helper.o helper.o cpu.o
> diff --git a/target-m68k/Makefile b/target-m68k/Makefile
> index e73a5ba..e43774f 100644
> --- a/target-m68k/Makefile
> +++ b/target-m68k/Makefile
> @@ -1 +1,2 @@
> obj-y += m68k-semi.o
> +obj-y += op_helper.o helper.o cpu.o
> diff --git a/target-microblaze/Makefile b/target-microblaze/Makefile
> index c574c9e..8fc92b4 100644
> --- a/target-microblaze/Makefile
> +++ b/target-microblaze/Makefile
> @@ -1 +1,2 @@
> -# still empty
> +obj-y += op_helper.o helper.o cpu.o
> +obj-$(CONFIG_SOFTMMU) += mmu.o
> diff --git a/target-mips/Makefile b/target-mips/Makefile
> index c574c9e..15826d1 100644
> --- a/target-mips/Makefile
> +++ b/target-mips/Makefile
> @@ -1 +1 @@
> -# still empty
> +obj-y += op_helper.o helper.o cpu.o
> diff --git a/target-ppc/Makefile b/target-ppc/Makefile
> index c574c9e..8413532 100644
> --- a/target-ppc/Makefile
> +++ b/target-ppc/Makefile
> @@ -1 +1 @@
> -# still empty
> +obj-y += op_helper.o helper.o
> diff --git a/target-s390x/Makefile b/target-s390x/Makefile
> index c574c9e..15826d1 100644
> --- a/target-s390x/Makefile
> +++ b/target-s390x/Makefile
> @@ -1 +1 @@
> -# still empty
> +obj-y += op_helper.o helper.o cpu.o
> diff --git a/target-sh4/Makefile b/target-sh4/Makefile
> index c574c9e..15826d1 100644
> --- a/target-sh4/Makefile
> +++ b/target-sh4/Makefile
> @@ -1 +1 @@
> -# still empty
> +obj-y += op_helper.o helper.o cpu.o
> diff --git a/target-sparc/Makefile b/target-sparc/Makefile
> index c574c9e..4bd1a4c 100644
> --- a/target-sparc/Makefile
> +++ b/target-sparc/Makefile
> @@ -1 +1,5 @@
> -# still empty
> +obj-y += helper.o cpu.o
> +obj-y += fop_helper.o cc_helper.o win_helper.o mmu_helper.o ldst_helper.o
> +obj-$(TARGET_SPARC) += int32_helper.o
> +obj-$(TARGET_SPARC64) += int64_helper.o
> +obj-$(TARGET_SPARC64) += vis_helper.o
> diff --git a/target-unicore32/Makefile b/target-unicore32/Makefile
> index c574c9e..15826d1 100644
> --- a/target-unicore32/Makefile
> +++ b/target-unicore32/Makefile
> @@ -1 +1 @@
> -# still empty
> +obj-y += op_helper.o helper.o cpu.o
> diff --git a/target-xtensa/Makefile b/target-xtensa/Makefile
> index a49ca8d..7644065 100644
> --- a/target-xtensa/Makefile
> +++ b/target-xtensa/Makefile
> @@ -2,3 +2,4 @@ obj-y += xtensa-semi.o
> obj-y += core-dc232b.o
> obj-y += core-dc233c.o
> obj-y += core-fsf.o
> +obj-y += op_helper.o helper.o cpu.o
> --
> 1.7.10.1
>
>
>
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH 11/24] move net/ objects to nested Makefile
2012-06-03 12:25 ` [Qemu-devel] [PATCH 11/24] move net/ " Paolo Bonzini
@ 2012-06-03 13:44 ` Blue Swirl
0 siblings, 0 replies; 42+ messages in thread
From: Blue Swirl @ 2012-06-03 13:44 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
On Sun, Jun 3, 2012 at 12:25 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> Makefile.objs | 17 +----------------
> net/Makefile | 13 +++++++++++++
> 2 files changed, 14 insertions(+), 16 deletions(-)
> create mode 100644 net/Makefile
>
> diff --git a/Makefile.objs b/Makefile.objs
> index 7c8a997..8433fad 100644
> --- a/Makefile.objs
> +++ b/Makefile.objs
> @@ -47,21 +47,6 @@ block-obj-$(CONFIG_POSIX) += posix-aio-compat.o
> block-obj-$(CONFIG_LINUX_AIO) += linux-aio.o
> block-obj-y += block/
>
> -net-obj-y = net.o
> -net-nested-y = queue.o checksum.o util.o
> -net-nested-y += socket.o
> -net-nested-y += dump.o
> -net-nested-$(CONFIG_POSIX) += tap.o
> -net-nested-$(CONFIG_LINUX) += tap-linux.o
> -net-nested-$(CONFIG_WIN32) += tap-win32.o
> -net-nested-$(CONFIG_BSD) += tap-bsd.o
> -net-nested-$(CONFIG_SOLARIS) += tap-solaris.o
> -net-nested-$(CONFIG_AIX) += tap-aix.o
> -net-nested-$(CONFIG_HAIKU) += tap-haiku.o
> -net-nested-$(CONFIG_SLIRP) += slirp.o
> -net-nested-$(CONFIG_VDE) += vde.o
> -net-obj-y += $(addprefix net/, $(net-nested-y))
> -
> ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy)
> # Lots of the fsdev/9pcode is pulled in by vl.c via qemu_fsdev_add.
> # only pull in the actual virtio-9p device if we also enabled virtio.
> @@ -78,7 +63,7 @@ fsdev-obj-$(CONFIG_VIRTFS) += $(addprefix fsdev/, $(fsdev-nested-y))
> # single QEMU executable should support all CPUs and machines.
>
> common-obj-y = $(block-obj-y) blockdev.o
> -common-obj-y += $(net-obj-y)
> +common-obj-y += net.o net/
> common-obj-y += qom/
> common-obj-$(CONFIG_LINUX) += $(fsdev-obj-$(CONFIG_LINUX))
> common-obj-y += readline.o console.o cursor.o
> diff --git a/net/Makefile b/net/Makefile
> new file mode 100644
> index 0000000..e970ec4
> --- /dev/null
> +++ b/net/Makefile
> @@ -0,0 +1,13 @@
> +common-obj-y = queue.o checksum.o util.o
> +common-obj-y += socket.o
> +common-obj-y += dump.o
> +common-obj-$(CONFIG_POSIX) += tap.o
> +common-obj-$(CONFIG_LINUX) += tap-linux.o
> +common-obj-$(CONFIG_WIN32) += tap-win32.o
> +common-obj-$(CONFIG_BSD) += tap-bsd.o
> +common-obj-$(CONFIG_SOLARIS) += tap-solaris.o
> +common-obj-$(CONFIG_AIX) += tap-aix.o
> +common-obj-$(CONFIG_HAIKU) += tap-haiku.o
> +common-obj-$(CONFIG_SLIRP) += slirp.o
> +common-obj-$(CONFIG_VDE) += vde.o
> +
Blank at end.
> --
> 1.7.10.1
>
>
>
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH 06/24] move libobj-y variable to nested Makefile
2012-06-03 13:42 ` Blue Swirl
@ 2012-06-03 17:32 ` Paolo Bonzini
0 siblings, 0 replies; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 17:32 UTC (permalink / raw)
To: Blue Swirl; +Cc: qemu-devel
Il 03/06/2012 15:42, Blue Swirl ha scritto:
>> > # HELPER_CFLAGS is used for all the legacy code compiled with static register
>> > # variables
>> > -ifneq ($(TARGET_BASE_ARCH), sparc)
>> > -op_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
>> > -endif
>> > +%/op_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
> This should be target specific.
>
> Overall, the target-* changes will conflict with AREG0 conversion,
> perhaps those patches should be postponed.
It's difficult to convert Makefile.objs without doing Makefile.target
first. Not a big deal though, the conflicts are easy for me to resolve.
Paolo
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse
2012-06-03 13:31 ` [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Blue Swirl
@ 2012-06-03 17:34 ` Paolo Bonzini
0 siblings, 0 replies; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-03 17:34 UTC (permalink / raw)
To: Blue Swirl; +Cc: qemu-devel
Il 03/06/2012 15:31, Blue Swirl ha scritto:
>> > The series is entirely bisectable, and mostly consists of boring patches.
>> > If the concept is accepted, I would like to get it in as soon as possible.
>> > I have a few other cleanups on top (I stopped once I undid the diffstat
>> > of this series :)), but they can be covered later.
>> >
>> > Thoughts, approvals, rejections?
> Neat. Could we (eventually) eliminate Makefile.dis, Makefile.hw,
> Makefile.target and Makefile.user completely?
Probably not, because (especially for Makefile.target) we need to
include the per-target header to find the set of objects to link together.
Perhaps Makefile.dis, because there is no longer any need to build
libdis separately for system and user emulation targets.
However, definitely one purpose of this patch is to pull information out
of Makefile.target, like done before for the others.
Paolo
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
` (24 preceding siblings ...)
2012-06-03 13:31 ` [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Blue Swirl
@ 2012-06-03 22:40 ` Andreas Färber
2012-06-03 22:57 ` Anthony Liguori
2012-06-03 22:55 ` Anthony Liguori
2012-06-04 16:02 ` Lluís Vilanova
27 siblings, 1 reply; 42+ messages in thread
From: Andreas Färber @ 2012-06-03 22:40 UTC (permalink / raw)
To: Paolo Bonzini, Anthony Liguori; +Cc: qemu-devel
Am 03.06.2012 14:25, schrieb Paolo Bonzini:
> One source of complexity in the QEMU source is that we have a very
> shallow tree for a source code of over 750,000 lines of code. In
> fact, one third of these lines alone is in one directory, hw/.
>
> As a prerequisite to cleaning up the structure, but as a worthwhile
> step on its own, this patchset cleans up the build system so that
> separate directories have their own Makefile snippet. As in the Linux
> kernel build system, the overall build system is generally flat (in
> the case of QEMU, with one recursive invocation per emulation target).
> Subdirectories do not include complete Makefiles, instead they only host
> the declarations for a few variables (common-obj-y, universal-obj-y,
> obj-y, etc.). Definitions for all the directories are merged with a
> little GNU Make magic (not much, only 20 lines).
>
> Two nice side effects are:
>
> - we can match the source tree and the object tree (for example the
> per-target device models will be in XYZ-softmmu/hw, not in
> XYZ-softmmu; those that are compiled once will be in hw/ rather
> than in the root).
>
> - because the resolution of nested makefiles tracks the nested
> directory, there is no need to use VPATH to find sources in
> the hw/ and target-*/ directory.
>
> - there is a lot less Makefile programming (conditionals, addprefix,
> etc.), replaced by only 20 lines in rules.mak and 1 in Makefile.objs.
>
> The series is entirely bisectable, and mostly consists of boring patches.
> If the concept is accepted, I would like to get it in as soon as possible.
> I have a few other cleanups on top (I stopped once I undid the diffstat
> of this series :)), but they can be covered later.
>
> Thoughts, approvals, rejections?
As before, I dislike the use of the filename "Makefile" for files that
are not self-contained. If make is called from that deep directory, it
leads to undefined results. Either we must make sure through some clever
ifeq'ery and a local "all" target that such an attempt fails, or better
use a filename that is recognized by editors as Makefile syntax but not
used by make without explicit -f, e.g., foo.mak.
Note that I have been working on moving some more files from
Makefile.target to Makefile.objs for compilation into libhw{32,64}. I'll
defer that if people agree this is the way to restructure.
Anthony had been talking about restructuring hw/ into a more Linux-like
directory structure. Any update on that, Anthony?
Regards,
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
` (25 preceding siblings ...)
2012-06-03 22:40 ` Andreas Färber
@ 2012-06-03 22:55 ` Anthony Liguori
2012-06-04 16:02 ` Lluís Vilanova
27 siblings, 0 replies; 42+ messages in thread
From: Anthony Liguori @ 2012-06-03 22:55 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
On 06/03/2012 08:25 PM, Paolo Bonzini wrote:
> One source of complexity in the QEMU source is that we have a very
> shallow tree for a source code of over 750,000 lines of code. In
> fact, one third of these lines alone is in one directory, hw/.
>
> As a prerequisite to cleaning up the structure, but as a worthwhile
> step on its own, this patchset cleans up the build system so that
> separate directories have their own Makefile snippet. As in the Linux
> kernel build system, the overall build system is generally flat (in
> the case of QEMU, with one recursive invocation per emulation target).
> Subdirectories do not include complete Makefiles, instead they only host
> the declarations for a few variables (common-obj-y, universal-obj-y,
> obj-y, etc.). Definitions for all the directories are merged with a
> little GNU Make magic (not much, only 20 lines).
>
> Two nice side effects are:
>
> - we can match the source tree and the object tree (for example the
> per-target device models will be in XYZ-softmmu/hw, not in
> XYZ-softmmu; those that are compiled once will be in hw/ rather
> than in the root).
>
> - because the resolution of nested makefiles tracks the nested
> directory, there is no need to use VPATH to find sources in
> the hw/ and target-*/ directory.
>
> - there is a lot less Makefile programming (conditionals, addprefix,
> etc.), replaced by only 20 lines in rules.mak and 1 in Makefile.objs.
>
> The series is entirely bisectable, and mostly consists of boring patches.
> If the concept is accepted, I would like to get it in as soon as possible.
> I have a few other cleanups on top (I stopped once I undid the diffstat
> of this series :)), but they can be covered later.
>
> Thoughts, approvals, rejections?
Awesomness!
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
I tried to do something similar but my make-magic isn't quite as good as yours.
If you do a v2 fixing the whitespace issues Blue pointed out, I'll apply ASAP.
Regards,
Anthony Liguori
>
> Paolo
>
>
> Paolo Bonzini (24):
> remove trace-nested-y
> do not sprinkle around GENERATED_HEADERS dependencies
> add rules for nesting
> move *-user/ objects to nested Makefile
> move obj-TARGET-y variables to nested Makefile
> move libobj-y variable to nested Makefile
> move other target-*/ objects to nested Makefiles
> move rules for nesting to Makefile.objs
> use nested Makefile rules for qom/ objects
> move block/ objects to nested Makefile
> move net/ objects to nested Makefile
> move fsdev/ objects to nested Makefile
> move ui/ objects to nested Makefile
> move audio/ objects to nested Makefile
> move slirp/ objects to nested Makefile
> move qapi/ objects to nested Makefile
> move qga/ objects to nested Makefile
> move target-independent hw/ objects to nested Makefiles
> convert libhw to nested Makefiles
> move per-target hw/ objects to nested Makefiles
> move device tree to per-target Makefile
> libcacard Makefile cleanups
> limit usage of vpath
> compile oslib-obj-y once
>
> Makefile | 30 ++-
> Makefile.hw | 7 +-
> Makefile.objs | 316 ++++---------------------
> Makefile.target | 325 ++++----------------------
> audio/Makefile | 15 ++
> block/Makefile | 11 +
> bsd-user/Makefile | 3 +
> configure | 70 +++---
> fsdev/Makefile | 6 +
> hw/9pfs/Makefile | 9 +
> hw/Makefile | 162 +++++++++++++
> hw/alpha/Makefile | 4 +
> hw/arm/Makefile | 40 ++++
> hw/cris/Makefile | 13 ++
> hw/i386/Makefile | 13 ++
> hw/ide/Makefile | 10 +
> hw/lm32/Makefile | 23 ++
> hw/m68k/Makefile | 4 +
> hw/microblaze/Makefile | 14 ++
> hw/mips/Makefile | 6 +
> hw/ppc/Makefile | 32 +++
> hw/s390x/Makefile | 3 +
> hw/sh4/Makefile | 5 +
> hw/sparc/Makefile | 8 +
> hw/sparc64/Makefile | 4 +
> hw/usb/Makefile | 13 ++
> hw/xtensa/Makefile | 5 +
> libcacard/Makefile | 17 +-
> linux-user/Makefile | 7 +
> linux-user/arm/nwfpe/Makefile | 3 +
> net/Makefile | 13 ++
> qapi/Makefile | 3 +
> qga/Makefile | 4 +
> qom/Makefile | 6 +-
> rules.mak | 21 ++
> slirp/Makefile | 4 +
> target-alpha/Makefile | 3 +
> target-arm/Makefile | 4 +
> arm-semi.c => target-arm/arm-semi.c | 0
> target-cris/Makefile | 2 +
> target-i386/Makefile | 6 +
> ioport-user.c => target-i386/ioport-user.c | 0
> target-lm32/Makefile | 2 +
> target-m68k/Makefile | 3 +
> m68k-semi.c => target-m68k/m68k-semi.c | 0
> target-microblaze/Makefile | 2 +
> target-mips/Makefile | 2 +
> target-ppc/Makefile | 3 +
> target-s390x/Makefile | 3 +
> target-sh4/Makefile | 2 +
> target-sparc/Makefile | 6 +
> target-unicore32/Makefile | 2 +
> target-xtensa/Makefile | 6 +
> xtensa-semi.c => target-xtensa/xtensa-semi.c | 0
> tests/Makefile | 1 -
> ui/Makefile | 18 ++
> 56 files changed, 674 insertions(+), 620 deletions(-)
> create mode 100644 audio/Makefile
> create mode 100644 block/Makefile
> create mode 100644 bsd-user/Makefile
> create mode 100644 fsdev/Makefile
> create mode 100644 hw/9pfs/Makefile
> create mode 100644 hw/Makefile
> create mode 100644 hw/alpha/Makefile
> create mode 100644 hw/arm/Makefile
> create mode 100644 hw/cris/Makefile
> create mode 100644 hw/i386/Makefile
> create mode 100644 hw/ide/Makefile
> create mode 100644 hw/lm32/Makefile
> create mode 100644 hw/m68k/Makefile
> create mode 100644 hw/microblaze/Makefile
> create mode 100644 hw/mips/Makefile
> create mode 100644 hw/ppc/Makefile
> create mode 100644 hw/s390x/Makefile
> create mode 100644 hw/sh4/Makefile
> create mode 100644 hw/sparc/Makefile
> create mode 100644 hw/sparc64/Makefile
> create mode 100644 hw/usb/Makefile
> create mode 100644 hw/xtensa/Makefile
> create mode 100644 linux-user/Makefile
> create mode 100644 linux-user/arm/nwfpe/Makefile
> create mode 100644 net/Makefile
> create mode 100644 qapi/Makefile
> create mode 100644 qga/Makefile
> create mode 100644 slirp/Makefile
> create mode 100644 target-alpha/Makefile
> create mode 100644 target-arm/Makefile
> rename arm-semi.c => target-arm/arm-semi.c (100%)
> create mode 100644 target-cris/Makefile
> create mode 100644 target-i386/Makefile
> rename ioport-user.c => target-i386/ioport-user.c (100%)
> create mode 100644 target-lm32/Makefile
> create mode 100644 target-m68k/Makefile
> rename m68k-semi.c => target-m68k/m68k-semi.c (100%)
> create mode 100644 target-microblaze/Makefile
> create mode 100644 target-mips/Makefile
> create mode 100644 target-ppc/Makefile
> create mode 100644 target-s390x/Makefile
> create mode 100644 target-sh4/Makefile
> create mode 100644 target-sparc/Makefile
> create mode 100644 target-unicore32/Makefile
> create mode 100644 target-xtensa/Makefile
> rename xtensa-semi.c => target-xtensa/xtensa-semi.c (100%)
> create mode 100644 ui/Makefile
>
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse
2012-06-03 22:40 ` Andreas Färber
@ 2012-06-03 22:57 ` Anthony Liguori
2012-06-04 6:36 ` Paolo Bonzini
0 siblings, 1 reply; 42+ messages in thread
From: Anthony Liguori @ 2012-06-03 22:57 UTC (permalink / raw)
To: Andreas Färber; +Cc: Paolo Bonzini, qemu-devel
On 06/04/2012 06:40 AM, Andreas Färber wrote:
> Am 03.06.2012 14:25, schrieb Paolo Bonzini:
>> One source of complexity in the QEMU source is that we have a very
>> shallow tree for a source code of over 750,000 lines of code. In
>> fact, one third of these lines alone is in one directory, hw/.
>>
>> As a prerequisite to cleaning up the structure, but as a worthwhile
>> step on its own, this patchset cleans up the build system so that
>> separate directories have their own Makefile snippet. As in the Linux
>> kernel build system, the overall build system is generally flat (in
>> the case of QEMU, with one recursive invocation per emulation target).
>> Subdirectories do not include complete Makefiles, instead they only host
>> the declarations for a few variables (common-obj-y, universal-obj-y,
>> obj-y, etc.). Definitions for all the directories are merged with a
>> little GNU Make magic (not much, only 20 lines).
>>
>> Two nice side effects are:
>>
>> - we can match the source tree and the object tree (for example the
>> per-target device models will be in XYZ-softmmu/hw, not in
>> XYZ-softmmu; those that are compiled once will be in hw/ rather
>> than in the root).
>>
>> - because the resolution of nested makefiles tracks the nested
>> directory, there is no need to use VPATH to find sources in
>> the hw/ and target-*/ directory.
>>
>> - there is a lot less Makefile programming (conditionals, addprefix,
>> etc.), replaced by only 20 lines in rules.mak and 1 in Makefile.objs.
>>
>> The series is entirely bisectable, and mostly consists of boring patches.
>> If the concept is accepted, I would like to get it in as soon as possible.
>> I have a few other cleanups on top (I stopped once I undid the diffstat
>> of this series :)), but they can be covered later.
>>
>> Thoughts, approvals, rejections?
>
> As before, I dislike the use of the filename "Makefile" for files that
> are not self-contained. If make is called from that deep directory, it
> leads to undefined results. Either we must make sure through some clever
> ifeq'ery and a local "all" target that such an attempt fails, or better
> use a filename that is recognized by editors as Makefile syntax but not
> used by make without explicit -f, e.g., foo.mak.
Linux does this. I think it's expected behavior at this point. In the long
term, we should either move to kconfig or autoconf so trying to act like one of
the two seems like a good idea to me.
> Note that I have been working on moving some more files from
> Makefile.target to Makefile.objs for compilation into libhw{32,64}. I'll
> defer that if people agree this is the way to restructure.
>
> Anthony had been talking about restructuring hw/ into a more Linux-like
> directory structure. Any update on that, Anthony?
Yes, I had a similar (but uglier) patch to this that was a pre-req. This
approach is much better though. I'd like to get this applied ASAP so we can
start shuffling things around.
BTW, we should change the build rules in rules.mak too such that they create
output directories on demand. Then we can add new subdirectories without
touching configure which is a bit annoyance right now.
Regards,
Anthony Liguori
>
> Regards,
> Andreas
>
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse
2012-06-03 22:57 ` Anthony Liguori
@ 2012-06-04 6:36 ` Paolo Bonzini
2012-06-04 18:52 ` Lluís Vilanova
0 siblings, 1 reply; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-04 6:36 UTC (permalink / raw)
To: Anthony Liguori; +Cc: Andreas Färber, qemu-devel
Il 04/06/2012 00:57, Anthony Liguori ha scritto:
>>
>> As before, I dislike the use of the filename "Makefile" for files that
>> are not self-contained. If make is called from that deep directory, it
>> leads to undefined results. Either we must make sure through some clever
>> ifeq'ery and a local "all" target that such an attempt fails, or better
>> use a filename that is recognized by editors as Makefile syntax but not
>> used by make without explicit -f, e.g., foo.mak.
>
> Linux does this. I think it's expected behavior at this point. In the
> long term, we should either move to kconfig or autoconf so trying to act
> like one of the two seems like a good idea to me.
This is not really necessary; we won't really move to kbuild anytime. I
don't really like the magic Makefiles and did it only because Linux does
this.
Naming files Makefile.objs would make just as much sense.
Paolo
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
` (26 preceding siblings ...)
2012-06-03 22:55 ` Anthony Liguori
@ 2012-06-04 16:02 ` Lluís Vilanova
27 siblings, 0 replies; 42+ messages in thread
From: Lluís Vilanova @ 2012-06-04 16:02 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
Paolo Bonzini writes:
> One source of complexity in the QEMU source is that we have a very
> shallow tree for a source code of over 750,000 lines of code. In
> fact, one third of these lines alone is in one directory, hw/.
> As a prerequisite to cleaning up the structure, but as a worthwhile
> step on its own, this patchset cleans up the build system so that
> separate directories have their own Makefile snippet. As in the Linux
> kernel build system, the overall build system is generally flat (in
> the case of QEMU, with one recursive invocation per emulation target).
> Subdirectories do not include complete Makefiles, instead they only host
> the declarations for a few variables (common-obj-y, universal-obj-y,
> obj-y, etc.). Definitions for all the directories are merged with a
> little GNU Make magic (not much, only 20 lines).
> Two nice side effects are:
> - we can match the source tree and the object tree (for example the
> per-target device models will be in XYZ-softmmu/hw, not in
> XYZ-softmmu; those that are compiled once will be in hw/ rather
> than in the root).
> - because the resolution of nested makefiles tracks the nested
> directory, there is no need to use VPATH to find sources in
> the hw/ and target-*/ directory.
> - there is a lot less Makefile programming (conditionals, addprefix,
> etc.), replaced by only 20 lines in rules.mak and 1 in Makefile.objs.
> The series is entirely bisectable, and mostly consists of boring patches.
> If the concept is accepted, I would like to get it in as soon as possible.
> I have a few other cleanups on top (I stopped once I undid the diffstat
> of this series :)), but they can be covered later.
> Thoughts, approvals, rejections?
Excellent!
I've wanted for long to have a few "generic" config variables defining what to
compile:
- CONFIG_TARGET (e.g., x86, arm, etc.)
- CONFIG_MODE (softmmu, user)
- CONFIG_? (tcg, kvm, xen)
- CONFIG_USER_OS (linux, bsd)
With this, it should be much more easy to lay the files out in a deeper and much
more "square-headed" hierarchy like
"<sybsystem>/<mode>/<user-os>/<?>/<target>" (where any of them is optional),
in the hopes to make it easier to split and locate code that depends on the
configuration.
With this, code can be separated into subsystems along time, so that you could
end up with "exec/tcg", "exec/kvm", "exec/user/linux/tcg/i386", "trace/softmmu",
etc.
This should also make it simpler to use soft-links and/or include paths to refer
to configuration-specific contents with a "generic" path (similar to what linux
does with "include/asm -> arch/x86/include/asm").
Lluis
--
"And it's much the same thing with knowledge, for whenever you learn
something new, the whole world becomes that much richer."
-- The Princess of Pure Reason, as told by Norton Juster in The Phantom
Tollbooth
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH 19/24] convert libhw to nested Makefiles
2012-06-03 12:25 ` [Qemu-devel] [PATCH 19/24] convert libhw " Paolo Bonzini
@ 2012-06-04 18:08 ` Andreas Färber
2012-06-05 6:30 ` Gerd Hoffmann
0 siblings, 1 reply; 42+ messages in thread
From: Andreas Färber @ 2012-06-04 18:08 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel, Gerd Hoffmann
Am 03.06.2012 14:25, schrieb Paolo Bonzini:
> diff --git a/hw/usb/Makefile b/hw/usb/Makefile
> index 7dbc33b..9c7ddf5 100644
> --- a/hw/usb/Makefile
> +++ b/hw/usb/Makefile
> @@ -1,3 +1,12 @@
> +hw-obj-$(CONFIG_USB_UHCI) += hcd-uhci.o
> +hw-obj-$(CONFIG_USB_OHCI) += hcd-ohci.o
> +hw-obj-$(CONFIG_USB_EHCI) += hcd-ehci.o
> +hw-obj-$(CONFIG_USB_XHCI) += hcd-xhci.o
> +hw-obj-y += libhw.o
Why a libhw.o in hw/usb/?
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse
2012-06-04 6:36 ` Paolo Bonzini
@ 2012-06-04 18:52 ` Lluís Vilanova
2012-06-04 18:58 ` Eric Blake
0 siblings, 1 reply; 42+ messages in thread
From: Lluís Vilanova @ 2012-06-04 18:52 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Andreas Färber, Anthony Liguori, qemu-devel
Paolo Bonzini writes:
> Il 04/06/2012 00:57, Anthony Liguori ha scritto:
>>>
>>> As before, I dislike the use of the filename "Makefile" for files that
>>> are not self-contained. If make is called from that deep directory, it
>>> leads to undefined results. Either we must make sure through some clever
>>> ifeq'ery and a local "all" target that such an attempt fails, or better
>>> use a filename that is recognized by editors as Makefile syntax but not
>>> used by make without explicit -f, e.g., foo.mak.
>>
>> Linux does this. I think it's expected behavior at this point. In the
>> long term, we should either move to kconfig or autoconf so trying to act
>> like one of the two seems like a good idea to me.
> This is not really necessary; we won't really move to kbuild anytime. I
> don't really like the magic Makefiles and did it only because Linux does
> this.
> Naming files Makefile.objs would make just as much sense.
Naming them as *.mak makes some common editors interpret the file as a makefile
(e.g., vim and emacs), while *.objs brings no meaning to these two.
Lluis
--
"And it's much the same thing with knowledge, for whenever you learn
something new, the whole world becomes that much richer."
-- The Princess of Pure Reason, as told by Norton Juster in The Phantom
Tollbooth
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse
2012-06-04 18:52 ` Lluís Vilanova
@ 2012-06-04 18:58 ` Eric Blake
2012-06-05 14:05 ` Paolo Bonzini
0 siblings, 1 reply; 42+ messages in thread
From: Eric Blake @ 2012-06-04 18:58 UTC (permalink / raw)
To: Lluís Vilanova
Cc: Paolo Bonzini, Andreas Färber, Anthony Liguori, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 652 bytes --]
On 06/04/2012 12:52 PM, Lluís Vilanova wrote:
>>>> As before, I dislike the use of the filename "Makefile" for files that
>>>> are not self-contained. If make is called from that deep directory, it
>>>> leads to undefined results.
>
> Naming them as *.mak makes some common editors interpret the file as a makefile
> (e.g., vim and emacs), while *.objs brings no meaning to these two.
Or you can always use magic comments, like "# -*- makefile -*-" for
emacs, to teach editors to use the right mode regardless of file name.
--
Eric Blake eblake@redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 620 bytes --]
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH 19/24] convert libhw to nested Makefiles
2012-06-04 18:08 ` Andreas Färber
@ 2012-06-05 6:30 ` Gerd Hoffmann
0 siblings, 0 replies; 42+ messages in thread
From: Gerd Hoffmann @ 2012-06-05 6:30 UTC (permalink / raw)
To: Andreas Färber; +Cc: Paolo Bonzini, qemu-devel
On 06/04/12 20:08, Andreas Färber wrote:
> Am 03.06.2012 14:25, schrieb Paolo Bonzini:
>> diff --git a/hw/usb/Makefile b/hw/usb/Makefile
>> index 7dbc33b..9c7ddf5 100644
>> --- a/hw/usb/Makefile
>> +++ b/hw/usb/Makefile
>> @@ -1,3 +1,12 @@
>> +hw-obj-$(CONFIG_USB_UHCI) += hcd-uhci.o
>> +hw-obj-$(CONFIG_USB_OHCI) += hcd-ohci.o
>> +hw-obj-$(CONFIG_USB_EHCI) += hcd-ehci.o
>> +hw-obj-$(CONFIG_USB_XHCI) += hcd-xhci.o
>> +hw-obj-y += libhw.o
>
> Why a libhw.o in hw/usb/?
That are the core usb bits which need to go into libhw{32,64}.
The usb_packet_{map,unmap} functions which operate on QEMUSGList are
living there.
cheers,
Gerd
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse
2012-06-04 18:58 ` Eric Blake
@ 2012-06-05 14:05 ` Paolo Bonzini
0 siblings, 0 replies; 42+ messages in thread
From: Paolo Bonzini @ 2012-06-05 14:05 UTC (permalink / raw)
To: Eric Blake
Cc: qemu-devel, Lluís Vilanova, Anthony Liguori,
Andreas Färber
Il 04/06/2012 20:58, Eric Blake ha scritto:
> On 06/04/2012 12:52 PM, Lluís Vilanova wrote:
>
>>>>> As before, I dislike the use of the filename "Makefile" for files that
>>>>> are not self-contained. If make is called from that deep directory, it
>>>>> leads to undefined results.
>
>>
>> Naming them as *.mak makes some common editors interpret the file as a makefile
>> (e.g., vim and emacs), while *.objs brings no meaning to these two.
vim grasps Make* correctly. Can Emacs be thought to do the same?
Paolo
^ permalink raw reply [flat|nested] 42+ messages in thread
end of thread, other threads:[~2012-06-05 14:05 UTC | newest]
Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-03 12:25 [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 01/24] remove trace-nested-y Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 02/24] do not sprinkle around GENERATED_HEADERS dependencies Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 03/24] add rules for nesting Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 04/24] move *-user/ objects to nested Makefile Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 05/24] move obj-TARGET-y variables " Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 06/24] move libobj-y variable " Paolo Bonzini
2012-06-03 13:42 ` Blue Swirl
2012-06-03 17:32 ` Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 07/24] move other target-*/ objects to nested Makefiles Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 08/24] move rules for nesting to Makefile.objs Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 09/24] use nested Makefile rules for qom/ objects Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 10/24] move block/ objects to nested Makefile Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 11/24] move net/ " Paolo Bonzini
2012-06-03 13:44 ` Blue Swirl
2012-06-03 12:25 ` [Qemu-devel] [PATCH 12/24] move fsdev/ " Paolo Bonzini
2012-06-03 13:32 ` Blue Swirl
2012-06-03 12:25 ` [Qemu-devel] [PATCH 13/24] move ui/ " Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 14/24] move audio/ " Paolo Bonzini
2012-06-03 13:33 ` Blue Swirl
2012-06-03 12:25 ` [Qemu-devel] [PATCH 15/24] move slirp/ " Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 16/24] move qapi/ " Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 17/24] move qga/ " Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 18/24] move target-independent hw/ objects to nested Makefiles Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 19/24] convert libhw " Paolo Bonzini
2012-06-04 18:08 ` Andreas Färber
2012-06-05 6:30 ` Gerd Hoffmann
2012-06-03 12:25 ` [Qemu-devel] [PATCH 20/24] move per-target hw/ objects " Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 21/24] move device tree to per-target Makefile Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 22/24] libcacard Makefile cleanups Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 23/24] limit usage of vpath Paolo Bonzini
2012-06-03 12:25 ` [Qemu-devel] [PATCH 24/24] compile oslib-obj-y once Paolo Bonzini
2012-06-03 13:31 ` [Qemu-devel] [PATCH 00/24] per-directory Makefile snippets, limit vpath abuse Blue Swirl
2012-06-03 17:34 ` Paolo Bonzini
2012-06-03 22:40 ` Andreas Färber
2012-06-03 22:57 ` Anthony Liguori
2012-06-04 6:36 ` Paolo Bonzini
2012-06-04 18:52 ` Lluís Vilanova
2012-06-04 18:58 ` Eric Blake
2012-06-05 14:05 ` Paolo Bonzini
2012-06-03 22:55 ` Anthony Liguori
2012-06-04 16:02 ` Lluís Vilanova
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).