From: Markus Armbruster <armbru@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Seeking QEMU makefile advice
Date: Wed, 13 Feb 2019 10:49:53 +0100 [thread overview]
Message-ID: <871s4chvb2.fsf@dusky.pond.sub.org> (raw)
Hi Paolo,
I'm trying to resolve a FIXME in a patch I recently posted. Here's what
I want to do:
QAPI_COMMON_MODULES = block-core block char common crypto introspect
QAPI_COMMON_MODULES += job migration misc net rdma rocker run-state
QAPI_COMMON_MODULES += sockets tpm trace transaction ui
QAPI_TARGET_MODULES = target
QAPI_MODULES = $(QAPI_COMMON_MODULES) $(QAPI_TARGET_MODULES)
util-obj-y += qapi/qapi-builtin-types.o
util-obj-y += $(QAPI_COMMON_MODULES:%=qapi/qapi-types-%.o)
util-obj-y += qapi/qapi-builtin-visit.o
util-obj-y += $(QAPI_COMMON_MODULES:%=qapi/qapi-visit-%.o)
util-obj-y += qapi/qapi-emit-events.o
util-obj-y += $(QAPI_COMMON_MODULES:%=qapi/qapi-events-%.o)
obj-y += $(QAPI_TARGET_MODULES:%=qapi/qapi-types-%.o)
obj-y += qapi/qapi-types.o
obj-y += $(QAPI_TARGET_MODULES:%=qapi/qapi-visit-%.o)
obj-y += qapi/qapi-visit.o
obj-y += $(QAPI_TARGET_MODULES:%=qapi/qapi-events-%.o)
obj-y += qapi/qapi-events.o
obj-y += $(QAPI_TARGET_MODULES:%=qapi/qapi-commands-%.o)
obj-y += qapi/qapi-commands.o
obj-y += qapi/qapi-introspect.o
Simple enough, except which part goes where?
First attempt:
* Define QAPI_COMMON_MODULES, QAPI_TARGET_MODULES and QAPI_MODULES in
Makefile.obj
* Add to util-obj-y in Makefile.obj
* Add to obj-y in Makefile.target
No go, because QAPI_TARGET_MODULES is blank there. To make progress,
I duplicated its definition there, marked FIXME.
Message-Id: <20190206181725.14337-8-armbru@redhat.com>
https://lists.nongnu.org/archive/html/qemu-devel/2019-02/msg01652.html
Diff appended for your convenience.
I've since realized QAPI_TARGET_MODULES is blank there because it only
gets defined further down, via include $(SRC_PATH)/Makefile.objs.
This leads me to my problem:
* On the one hand, I want to add to obj-y after the include defines
QAPI_TARGET_MODULES.
* On the other hand, I need to be done with adding to obj-y before the
all-obj-y := $(obj-y) line.
Can't satisfy both. Any ideas on how to better distribute the work
between the makefiles?
diff --git a/Makefile.objs b/Makefile.objs
index 70ee51742f..5f0a7a8ca5 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -1,20 +1,19 @@
-QAPI_MODULES = block-core block char common crypto introspect job migration
-QAPI_MODULES += misc net rdma rocker run-state sockets tpm trace transaction
-QAPI_MODULES += ui
+QAPI_COMMON_MODULES = block-core block char common crypto introspect
+QAPI_COMMON_MODULES += job migration misc net rdma rocker run-state
+QAPI_COMMON_MODULES += sockets tpm trace transaction ui
+QAPI_TARGET_MODULES = target
+QAPI_MODULES = $(QAPI_COMMON_MODULES) $(QAPI_TARGET_MODULES)
#######################################################################
# Common libraries for tools and emulators
stub-obj-y = stubs/ crypto/
util-obj-y = util/ qobject/ qapi/
util-obj-y += qapi/qapi-builtin-types.o
-util-obj-y += qapi/qapi-types.o
-util-obj-y += $(QAPI_MODULES:%=qapi/qapi-types-%.o)
+util-obj-y += $(QAPI_COMMON_MODULES:%=qapi/qapi-types-%.o)
util-obj-y += qapi/qapi-builtin-visit.o
-util-obj-y += qapi/qapi-visit.o
-util-obj-y += $(QAPI_MODULES:%=qapi/qapi-visit-%.o)
+util-obj-y += $(QAPI_COMMON_MODULES:%=qapi/qapi-visit-%.o)
util-obj-y += qapi/qapi-emit-events.o
-util-obj-y += qapi/qapi-events.o
-util-obj-y += $(QAPI_MODULES:%=qapi/qapi-events-%.o)
+util-obj-y += $(QAPI_COMMON_MODULES:%=qapi/qapi-events-%.o)
chardev-obj-y = chardev/
slirp-obj-$(CONFIG_SLIRP) = slirp/
@@ -92,8 +91,7 @@ common-obj-$(CONFIG_FDT) += device_tree.o
######################################################################
# qapi
-common-obj-y += qapi/qapi-commands.o
-common-obj-y += $(QAPI_MODULES:%=qapi/qapi-commands-%.o)
+common-obj-y += $(QAPI_COMMON_MODULES:%=qapi/qapi-commands-%.o)
common-obj-y += qmp.o hmp.o
endif
diff --git a/Makefile.target b/Makefile.target
index d8af835890..f908477040 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -164,6 +164,16 @@ endif
GENERATED_FILES += hmp-commands.h hmp-commands-info.h
+# FIXME duplicates Makefile.obj's
+QAPI_TARGET_MODULES = target
+obj-y += $(QAPI_TARGET_MODULES:%=qapi/qapi-types-%.o)
+obj-y += qapi/qapi-types.o
+obj-y += $(QAPI_TARGET_MODULES:%=qapi/qapi-visit-%.o)
+obj-y += qapi/qapi-visit.o
+obj-y += $(QAPI_TARGET_MODULES:%=qapi/qapi-events-%.o)
+obj-y += qapi/qapi-events.o
+obj-y += $(QAPI_TARGET_MODULES:%=qapi/qapi-commands-%.o)
+obj-y += qapi/qapi-commands.o
obj-y += qapi/qapi-introspect.o
endif # CONFIG_SOFTMMU
diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json
index 1845aa78ff..db61bfd688 100644
--- a/qapi/qapi-schema.json
+++ b/qapi/qapi-schema.json
@@ -97,3 +97,4 @@
{ 'include': 'trace.json' }
{ 'include': 'introspect.json' }
{ 'include': 'misc.json' }
+{ 'include': 'target.json' }
diff --git a/qapi/target.json b/qapi/target.json
new file mode 100644
index 0000000000..8054926293
--- /dev/null
+++ b/qapi/target.json
@@ -0,0 +1,13 @@
+# -*- Mode: Python -*-
+#
+
+##
+# = Target-specific commands & events
+##
+
+##
+# @TARGET-TEMPORARY-DUMMY:
+# Will go away in the next commit. Needed in this one because empty
+# modules don't generate anything, defeating this commit's purpose.
+##
+{ 'event': 'TARGET-TEMPORARY-DUMMY' }
next reply other threads:[~2019-02-13 9:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-13 9:49 Markus Armbruster [this message]
2019-02-13 14:18 ` [Qemu-devel] Seeking QEMU makefile advice Paolo Bonzini
2019-02-13 16:15 ` Markus Armbruster
2019-02-13 16:19 ` Paolo Bonzini
2019-02-14 8:30 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871s4chvb2.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.