[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 044/143] meson: generate hxtool files
From: |
Paolo Bonzini |
Subject: |
[PATCH 044/143] meson: generate hxtool files |
Date: |
Thu, 6 Aug 2020 21:14:40 +0200 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile | 8 +-------
Makefile.target | 6 ------
meson.build | 21 +++++++++++++++++++++
scripts/hxtool | 2 +-
4 files changed, 23 insertions(+), 14 deletions(-)
mode change 100644 => 100755 scripts/hxtool
diff --git a/Makefile b/Makefile
index 3fafc89..984f784 100644
--- a/Makefile
+++ b/Makefile
@@ -105,7 +105,7 @@ include $(SRC_PATH)/rules.mak
# lor is defined in rules.mak
CONFIG_BLOCK := $(call lor,$(CONFIG_SOFTMMU),$(CONFIG_TOOLS))
-generated-files-y = config-host.h qemu-options.def
+generated-files-y = config-host.h
generated-files-y += module_block.h
@@ -247,8 +247,6 @@ all: $(DOCS) $(if $(BUILD_DOCS),sphinxdocs) $(TOOLS)
$(HELPERS-y) recurse-all mo
config-host.h: config-host.h-timestamp
config-host.h-timestamp: config-host.mak
-qemu-options.def: $(SRC_PATH)/qemu-options.hx $(SRC_PATH)/scripts/hxtool
- $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< >
$@,"GEN","$@")
TARGET_DIRS_RULES := $(foreach t, all fuzz clean install, $(addsuffix /$(t),
$(TARGET_DIRS)))
@@ -355,9 +353,6 @@ ifdef CONFIG_MPATH
scsi/qemu-pr-helper$(EXESUF): LIBS += -ludev -lmultipath -lmpathpersist
endif
-qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool
- $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< >
$@,"GEN","$@")
-
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))), \
@@ -375,7 +370,6 @@ clean: recurse-clean
rm -f $(edk2-decompressed)
rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) TAGS cscope.* *.pod *~
*/*~
rm -f fsdev/*.pod scsi/*.pod
- rm -f qemu-img-cmds.h
rm -f $(foreach f,$(generated-files-y),$(f) $(f)-timestamp)
rm -f config-all-devices.mak
rm -f $(SUBDIR_DEVICES_MAK)
diff --git a/Makefile.target b/Makefile.target
index 0b32364..257afc2 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -225,12 +225,6 @@ endif
gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh
$(call quiet-command,rm -f $@ && $(SHELL)
$(SRC_PATH)/scripts/feature_to_c.sh $@
$(TARGET_XML_FILES),"GEN","$(TARGET_DIR)$@")
-hmp-commands.h: $(SRC_PATH)/hmp-commands.hx $(SRC_PATH)/scripts/hxtool
- $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< >
$@,"GEN","$(TARGET_DIR)$@")
-
-hmp-commands-info.h: $(SRC_PATH)/hmp-commands-info.hx
$(SRC_PATH)/scripts/hxtool
- $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< >
$@,"GEN","$(TARGET_DIR)$@")
-
clean: clean-target
rm -f *.a *~ $(PROGS)
rm -f $(shell find . -name '*.[od]')
diff --git a/meson.build b/meson.build
index fe2be8f..892bb62 100644
--- a/meson.build
+++ b/meson.build
@@ -138,6 +138,7 @@ have_block = have_system or have_tools
# Generators
genh = []
+hxtool = find_program('scripts/hxtool')
shaderinclude = find_program('scripts/shaderinclude.pl')
qapi_gen = find_program('scripts/qapi-gen.py')
qapi_gen_depends = [ meson.source_root() / 'scripts/qapi/__init__.py',
@@ -169,6 +170,26 @@ qemu_version = custom_target('qemu-version.h',
build_always_stale: true)
genh += qemu_version
+hxdep = []
+hx_headers = [
+ ['qemu-options.hx', 'qemu-options.def'],
+ ['qemu-img-cmds.hx', 'qemu-img-cmds.h'],
+]
+if have_system
+ hx_headers += [
+ ['hmp-commands.hx', 'hmp-commands.h'],
+ ['hmp-commands-info.hx', 'hmp-commands-info.h'],
+ ]
+endif
+foreach d : hx_headers
+ custom_target(d[1],
+ input: files(d[0]),
+ output: d[1],
+ capture: true,
+ build_by_default: true, # to be removed when added to a target
+ command: [hxtool, '-h', '@INPUT0@'])
+endforeach
+
# Collect sourcesets.
util_ss = ss.source_set()
diff --git a/scripts/hxtool b/scripts/hxtool
old mode 100644
new mode 100755
index 7b1452f..80516b9
--- a/scripts/hxtool
+++ b/scripts/hxtool
@@ -19,6 +19,6 @@ hxtoh()
case "$1" in
"-h") hxtoh ;;
*) exit 1 ;;
-esac
+esac < "$2"
exit 0
--
1.8.3.1
- Re: [PATCH 037/143] meson: add qemu-bridge-helper, (continued)
[PATCH 038/143] meson: add qemu-keymap, Paolo Bonzini, 2020/08/06
[PATCH 039/143] meson: add qemu-edid, Paolo Bonzini, 2020/08/06
[PATCH 040/143] meson: add virtfs-proxy-helper, Paolo Bonzini, 2020/08/06
[PATCH 041/143] meson: keymap-gen, Paolo Bonzini, 2020/08/06
[PATCH 042/143] meson: generate qemu-version.h, Paolo Bonzini, 2020/08/06
[PATCH 043/143] meson: generate shader headers, Paolo Bonzini, 2020/08/06
[PATCH 044/143] meson: generate hxtool files,
Paolo Bonzini <=
[PATCH 045/143] meson: uncompress edk2 bios, Paolo Bonzini, 2020/08/06
[PATCH 046/143] meson: convert check-decodetree, Paolo Bonzini, 2020/08/06
[PATCH 049/143] meson: convert qom directory to Meson (tools part), Paolo Bonzini, 2020/08/06
[PATCH 050/143] meson: convert authz directory to Meson, Paolo Bonzini, 2020/08/06
[PATCH 047/143] meson: convert tests/fp and check-softfloat, Paolo Bonzini, 2020/08/06
[PATCH 048/143] meson: convert check-qapi-schema, Paolo Bonzini, 2020/08/06
[PATCH 051/143] meson: convert crypto directory to Meson, Paolo Bonzini, 2020/08/06
[PATCH 052/143] meson: convert io directory to Meson, Paolo Bonzini, 2020/08/06
[PATCH 053/143] meson: convert target/s390x/gen-features.h, Paolo Bonzini, 2020/08/06