[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 04/20] build-sys: use config headers to generate
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH v5 04/20] build-sys: use config headers to generate qapi |
Date: |
Wed, 17 Aug 2016 20:57:41 +0400 |
Configure the marshaller, events and introspection with config host and
target headers. Keep the types, visitors, and command header generic
since it will only use what is actually needed, but needs all
declarations to be compatible with the various targets.
Signed-off-by: Marc-André Lureau <address@hidden>
---
Makefile | 15 +++++++++------
Makefile.target | 12 +++++++-----
2 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/Makefile b/Makefile
index 83d27fb..f83b208 100644
--- a/Makefile
+++ b/Makefile
@@ -267,20 +267,23 @@ qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
$(SRC_PATH)/scripts/hxtool
qemu-ga$(EXESUF): LIBS = $(LIBS_QGA)
qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated
+qapi-hconfig = config-host.h
+qapi-flags = $(patsubst %,-f %,$(qapi-hconfig))
+
qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\
-$(SRC_PATH)/qga/qapi-schema.json $(qapi-types-py)
+$(SRC_PATH)/qga/qapi-schema.json $(qapi-types-py) $(qapi-hconfig)
$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
- $(qapi-gen-type) -o qga/qapi-generated -p "qga-" $<, \
+ $(qapi-flags) $(qapi-gen-type) -o qga/qapi-generated -p "qga-"
$<, \
" GEN $@")
qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h :\
-$(SRC_PATH)/qga/qapi-schema.json $(qapi-visit-py)
+$(SRC_PATH)/qga/qapi-schema.json $(qapi-visit-py) $(qapi-hconfig)
$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
- $(qapi-gen-type) -o qga/qapi-generated -p "qga-" $<, \
+ $(qapi-flags) $(qapi-gen-type) -o qga/qapi-generated -p "qga-"
$<, \
" GEN $@")
qga/qapi-generated/qga-qmp-commands.h qga/qapi-generated/qga-qmp-marshal.c :\
-$(SRC_PATH)/qga/qapi-schema.json $(qapi-commands-py)
+$(SRC_PATH)/qga/qapi-schema.json $(qapi-commands-py) $(qapi-hconfig)
$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
- $(qapi-gen-type) -o qga/qapi-generated -p "qga-" $<, \
+ $(qapi-flags) $(qapi-gen-type) -o qga/qapi-generated -p "qga-"
$<, \
" GEN $@")
qapi-types.c qapi-types.h :\
diff --git a/Makefile.target b/Makefile.target
index 6b672eb..c6c20bf 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -160,23 +160,25 @@ endif
GENERATED_HEADERS += hmp-commands.h hmp-commands-info.h qmp-commands-old.h
GENERATED_HEADERS += qmp-introspect.h
GENERATED_SOURCES += qmp-introspect.c qmp-marshal.c qapi-event.c
+qapi-hconfig = ../config-host.h config-target.h
+qapi-flags = $(patsubst %,-f %,$(qapi-hconfig))
qmp-marshal.c :\
-$(qapi-modules) $(qapi-commands-py)
+$(qapi-modules) $(qapi-commands-py) $(qapi-hconfig)
$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
- $(qapi-gen-type) -o "." -m $<, \
+ $(qapi-flags) $(qapi-gen-type) -o "." -m $<, \
" GEN $(TARGET_DIR)$@")
qapi-event.c :\
$(qapi-modules) $(qapi-event-py)
$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-event.py \
- $(qapi-gen-type) -o "." $<, \
+ $(qapi-flags) $(qapi-gen-type) -o "." $<, \
" GEN $@")
qmp-introspect.h qmp-introspect.c :\
-$(qapi-modules) $(qapi-introspect-py)
+$(qapi-modules) $(qapi-introspect-py) $(qapi-hconfig)
$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-introspect.py \
- $(qapi-gen-type) -o "." $<, \
+ $(qapi-flags) $(qapi-gen-type) -o "." $<, \
" GEN $(TARGET_DIR)$@")
obj-y += qmp-marshal.o qmp-introspect.o qapi-event.o
--
2.9.0
- [Qemu-devel] [PATCH v5 00/20] qapi: remove the 'middle' mode, Marc-André Lureau, 2016/08/17
- [Qemu-devel] [PATCH v5 02/20] qapi.py: add a simple #ifdef conditional, Marc-André Lureau, 2016/08/17
- [Qemu-devel] [PATCH v5 01/20] tests: do qmp introspect validation per target, Marc-André Lureau, 2016/08/17
- [Qemu-devel] [PATCH v5 03/20] build-sys: make qemu qapi per-target, Marc-André Lureau, 2016/08/17
- [Qemu-devel] [PATCH v5 05/20] qapi: configure the schema, Marc-André Lureau, 2016/08/17
- [Qemu-devel] [PATCH v5 04/20] build-sys: use config headers to generate qapi,
Marc-André Lureau <=
- [Qemu-devel] [PATCH v5 06/20] build-sys: define QEMU_VERSION_{MAJOR, MINOR, MICRO}, Marc-André Lureau, 2016/08/17
- [Qemu-devel] [PATCH v5 08/20] qapi-schema: add 'device_add', Marc-André Lureau, 2016/08/17
- [Qemu-devel] [PATCH v5 07/20] qapi-schema: use generated marshaller for 'qmp_capabilities', Marc-André Lureau, 2016/08/17
- [Qemu-devel] [PATCH v5 09/20] monitor: simplify invalid_qmp_mode(), Marc-André Lureau, 2016/08/17
- [Qemu-devel] [PATCH v5 11/20] qapi: export the marshallers, Marc-André Lureau, 2016/08/17
- [Qemu-devel] [PATCH v5 10/20] monitor: register gen:false commands manually, Marc-André Lureau, 2016/08/17
- [Qemu-devel] [PATCH v5 13/20] monitor: implement 'qmp_query_commands' without qmp_cmds, Marc-André Lureau, 2016/08/17
- [Qemu-devel] [PATCH v5 12/20] monitor: use qmp_find_command() (using generated qapi code), Marc-André Lureau, 2016/08/17
- [Qemu-devel] [PATCH v5 15/20] qapi: remove the "middle" mode, Marc-André Lureau, 2016/08/17
- [Qemu-devel] [PATCH v5 14/20] monitor: remove mhandler.cmd_new, Marc-André Lureau, 2016/08/17