]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Put files generated by settings/generate.py into tarball
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 19 Sep 2023 12:43:42 +0000 (14:43 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 22 Sep 2023 13:10:20 +0000 (15:10 +0200)
So dists do not have to run python to generate them. Previously python
was a hidden dependency.

pdns/recursordist/settings/Makefile.am

index 536dc712e706e60977262e0f3d2bdd86a8e5a942..08e05e10a167fb52bf68a69be147a517f2445cf0 100644 (file)
@@ -1,25 +1,30 @@
+# It's a bit dirty that this Makefile also generates a file inside rust/src (lib.rs). 
+
 EXTRA_DIST = \
+       cxxsettings-generated.cc \
        cxxsettings-private.hh \
        cxxsettings.hh \
-       docs-old-preamble-in.rst \
        docs-new-preamble-in.rst \
+       docs-old-preamble-in.rst \
        generate.py \
        rust-bridge-in.rs \
        rust-preamble-in.rs \
-       table.py
+       table.py \
+       rust/src/lib.rs
 
-all: cxxsettings-generated.cc
+all: cxxsettings-generated.cc rust/src/lib.rs
 
-BUILT_SOURCES=cxxsettings-generated.cc
+BUILT_SOURCES=cxxsettings-generated.cc rust/src/lib.rs
 
-# It's a bit dirty that this target also generates a file inside rust/src (lib.rs). Also, we need to
-# clean in the Rust dir, as in some cases the Serde/CXX derive/generate code does not get re-run by
-# cargo after rust/src/lib.rs changed because of a generate.py run. In that case we end up with an
-# rust/src/lib.rs.h that does not contain e.g. field name or field type changes.
-cxxsettings-generated.cc: table.py generate.py rust-preamble-in.rs rust-bridge-in.rs docs-old-preamble-in.rst docs-new-preamble-in.rst
+# We need to clean in the Rust dir, as in some cases the Serde/CXX derive/generate code does not get
+# re-run by cargo after rust/src/lib.rs changed because of a generate.py run. In that case we end up
+# with an rust/src/lib.rs.h that does not contain e.g. field name or field type changes.
+#
+# Use patterns to avoid having two instances of generate run simultaneously, a well know hack for GNU make
+cxxsettings-generated%cc rust/src/lib%rs: table.py generate.py rust-preamble-in.rs rust-bridge-in.rs docs-old-preamble-in.rst docs-new-preamble-in.rst
        $(MAKE) -C rust clean
        $(PYTHON) generate.py
 
 clean-local:
-       rm -f cxxsettings-generated.cc settings-old-generated.rst
+       rm -f cxxsettings-generated.cc rust/src/lib.rs