[master] 0796b6c6d build: Add a .vsc.rst suffix rule to vsc.am
Dridi Boukelmoune
dridi.boukelmoune at gmail.com
Wed Jun 7 14:32:10 UTC 2023
commit 0796b6c6d4a264101708329140af1b9a23d7e0fe
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date: Mon May 22 15:29:05 2023 +0200
build: Add a .vsc.rst suffix rule to vsc.am
Suggested by @nigoroll.
diff --git a/vsc.am b/vsc.am
index 49fe25e43..b3d7c4bdb 100644
--- a/vsc.am
+++ b/vsc.am
@@ -1,11 +1,18 @@
# Generic rule to generate C code from VSC files. VSC files must be listed
# in the $(VSC_SRC) variable. The $(VSCTOOL) variable must point to the
# location of vsctool.py, normally set up by varnish.m4 at configure time.
-# The resulting $(VSC_GEN) variable must be added to $(BUILT_SOURCES).
+# The resulting $(VSC_GEN) variable must be added to $(BUILT_SOURCES). The
+# $(VSC_RST) variable references RST file names for manual pages includes.
VSC_GEN = $(VSC_SRC:.vsc=.c) $(VSC_SRC:.vsc=.h)
-$(VSC_GEN): $(VSCTOOL)
+VSC_RST = $(VSC_SRC:.vsc=.rst)
+
+_VSC_RST = $(VSC_SRC:.vsc=.rst_)
+
+$(VSC_GEN) $(VSC_RST): $(VSCTOOL)
+
+SUFFIXES = .vsc .c .h .rst
.vsc.c:
$(AM_V_GEN) $(PYTHON) $(VSCTOOL) -c $<
@@ -13,7 +20,11 @@ $(VSC_GEN): $(VSCTOOL)
.vsc.h:
$(AM_V_GEN) $(PYTHON) $(VSCTOOL) -h $<
+.vsc.rst:
+ $(AM_V_GEN) $(PYTHON) $(VSCTOOL) -r $< >${@}_
+ @mv ${@}_ $@
+
clean-local: vsc-clean
vsc-clean:
- rm -f $(VSC_GEN)
+ rm -f $(VSC_GEN) $(VSC_RST) $(_VSC_RST)
More information about the varnish-commit
mailing list