We already insert the values of some make variables into
files in MAKE/*. We can therefore build a simple pattern
rule for converting such a value into a C string in a header
file, which can then be included and used as normal.
The new system is demonstrated on version.c, where it can
replace the
Jeff King p...@peff.net writes:
diff --git a/script/mkcstring b/script/mkcstring
new file mode 100644
index 000..c01f430
--- /dev/null
+++ b/script/mkcstring
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+name=$1; shift
+
+c_quote() {
+ sed 's/\\//g; s//\\/'
No 'g' for the second one?
On Wed, Feb 05, 2014 at 11:17:13AM -0800, Junio C Hamano wrote:
Jeff King p...@peff.net writes:
diff --git a/script/mkcstring b/script/mkcstring
new file mode 100644
index 000..c01f430
--- /dev/null
+++ b/script/mkcstring
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+name=$1; shift
+
3 matches
Mail list logo