aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMarc Mari <markmb@redhat.com>2016-08-12 09:27:02 -0400
committerMax Reitz <mreitz@redhat.com>2016-09-20 22:10:58 +0200
commit0c0c1fd973013671ea63680fcd9802766c1d04fe (patch)
treeff836e0e67de4752d00143a0afed93c27464a3a9 /Makefile
parentf57b4b5fb127b60e1aade2684a8b16bc4f630b29 (diff)
blockdev: Add dynamic generation of module_block.h
To simplify the addition of new block modules, add a script that generates module_block.h automatically from the modules' source code. This script assumes that the QEMU coding style rules are followed. Signed-off-by: Marc MarĂ­ <markmb@redhat.com> Signed-off-by: Colin Lord <clord@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1471008424-16465-3-git-send-email-clord@redhat.com Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 7 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 444ae37bd3..b7d1200c16 100644
--- a/Makefile
+++ b/Makefile
@@ -76,6 +76,8 @@ GENERATED_HEADERS += trace/generated-ust-provider.h
GENERATED_SOURCES += trace/generated-ust.c
endif
+GENERATED_HEADERS += module_block.h
+
# Don't try to regenerate Makefile or configure
# We don't generate any of them
Makefile: ;
@@ -352,6 +354,11 @@ ivshmem-client$(EXESUF): $(ivshmem-client-obj-y) libqemuutil.a libqemustub.a
ivshmem-server$(EXESUF): $(ivshmem-server-obj-y) libqemuutil.a libqemustub.a
$(call LINK, $^)
+module_block.h: $(SRC_PATH)/scripts/modules/module_block.py config-host.mak
+ $(call quiet-command,$(PYTHON) $< $@ \
+ $(addprefix $(SRC_PATH)/,$(patsubst %.mo,%.c,$(block-obj-m))), \
+ " GEN $@")
+
clean:
# avoid old build problems by removing potentially incorrect old files
rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h