diff --git a/rust/Makefile.am b/rust/Makefile.am index a751bb85a3..a258003a8a 100644 --- a/rust/Makefile.am +++ b/rust/Makefile.am @@ -108,7 +108,7 @@ vendor: update-bindings: if HAVE_BINDGEN $(BINDGEN) \ - -o sys/src/sys.rs \ + -o sys/src/sys.rs.tmp \ --rust-target 1.68 \ --no-layout-tests \ --disable-header-comment \ @@ -120,7 +120,9 @@ if HAVE_BINDGEN $(abs_top_srcdir)/src/bindgen.h \ -- \ -DHAVE_CONFIG_H -I../src -I../rust/gen $(CPPFLAGS) - sed -i '1i\// This file is automatically generated. Do not edit.\n' sys/src/sys.rs + printf "// This file is automatically generated. Do not edit.\n\n" > sys/src/sys.rs + cat sys/src/sys.rs.tmp >> sys/src/sys.rs + rm -f sys/src/sys.rs.tmp else @echo "error: bindgen not installed, can't update bindings" exit 1