[Openvpn-devel] msvc: always regenerate config-msvc.h

Message ID 20221111111619.21415-1-frank@lichtenheld.com
State Superseded
Headers show
Series [Openvpn-devel] msvc: always regenerate config-msvc.h | expand

Commit Message

Frank Lichtenheld Nov. 11, 2022, 11:16 a.m. UTC
There is no easy way to detect whether this information
is outdated. One possible optimisation would be in the
Python code to actually only rewrite the file if it has
changed. Although VC is already pretty good in detecting
whether the code has actually changed so this might not
be worth the additional complexity.

While here, change some leading whitespace to tabs as
expected in Makefile.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
---
 build/msvc/msvc-generate/Makefile.mak | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Note: this patch applies to both master and release/2.5 cleanly and
should be pushed to both.

Patch

diff --git a/build/msvc/msvc-generate/Makefile.mak b/build/msvc/msvc-generate/Makefile.mak
index ae8b0842..1c1c4bab 100644
--- a/build/msvc/msvc-generate/Makefile.mak
+++ b/build/msvc/msvc-generate/Makefile.mak
@@ -51,10 +51,13 @@  $(OUTPUT_PLUGIN): $(INPUT_PLUGIN) $(OUTPUT_PLUGIN_CONFIG)
 	cscript //nologo msvc-generate.js --config="$(OUTPUT_PLUGIN_CONFIG)" --input="$(INPUT_PLUGIN)" --output="$(OUTPUT_PLUGIN)"
 
 $(OUTPUT_MAN): $(INPUT_MAN)
-    -FOR /F %i IN ('where rst2html.py') DO python %i "$(INPUT_MAN)" "$(OUTPUT_MAN)"
+	-FOR /F %i IN ('where rst2html.py') DO python %i "$(INPUT_MAN)" "$(OUTPUT_MAN)"
 
-$(OUTPUT_MSVC_GIT_CONFIG):
-    python git-version.py $(SOLUTIONDIR)
+# Force regeneration because we can't detect whether it is outdated
+$(OUTPUT_MSVC_GIT_CONFIG): FORCE
+	python git-version.py $(SOLUTIONDIR)
+
+FORCE:
 
 clean:
 	-del "$(OUTPUT_MSVC_VER)"