aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2021-10-07 15:08:28 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2021-10-14 09:50:57 +0200
commit61d63097bec3a11f64e14a05a81401f9af7cea11 (patch)
treed6ec5765517fd4302f33e74c9056174cc194e6e0 /Makefile
parent03a3c0b3c59e93beeb7ca72cba632f78eb060253 (diff)
configure: prepare for auto-generated option parsing
Prepare the configure script and Makefile for automatically generated help and parsing. Because we need to run the script to generate the full help, we cannot rely on the user supplying the path to a Python interpreter with --python; therefore, the introspection output is parsed into shell functions and stored in scripts/. The converter is written in Python as standard for QEMU, and this commit contains a stub. Tested-by: Thomas Huth <thuth@redhat.com> Message-Id: <20211007130829.632254-18-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 401c623a65..fe9415ac64 100644
--- a/Makefile
+++ b/Makefile
@@ -87,7 +87,7 @@ x := $(shell rm -rf meson-private meson-info meson-logs)
endif
# 1. ensure config-host.mak is up-to-date
-config-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/pc-bios $(SRC_PATH)/VERSION
+config-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/scripts/meson-buildoptions.sh $(SRC_PATH)/pc-bios $(SRC_PATH)/VERSION
@echo config-host.mak is out-of-date, running configure
@if test -f meson-private/coredata.dat; then \
./config.status --skip-meson; \
@@ -124,6 +124,12 @@ ifneq ($(MESON),)
Makefile.mtest: build.ninja scripts/mtest2make.py
$(MESON) introspect --targets --tests --benchmarks | $(PYTHON) scripts/mtest2make.py > $@
-include Makefile.mtest
+
+.PHONY: update-buildoptions
+all update-buildoptions: $(SRC_PATH)/scripts/meson-buildoptions.sh
+$(SRC_PATH)/scripts/meson-buildoptions.sh: $(SRC_PATH)/meson_options.txt
+ $(MESON) introspect --buildoptions $(SRC_PATH)/meson.build | $(PYTHON) \
+ scripts/meson-buildoptions.py > $@.tmp && mv $@.tmp $@
endif
# 4. Rules to bridge to other makefiles