[PATCH 11/13] Makefile: auto-build C strings from make variables

2014-02-05 Thread Jeff King
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

Re: [PATCH 11/13] Makefile: auto-build C strings from make variables

2014-02-05 Thread Junio C Hamano
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?

Re: [PATCH 11/13] Makefile: auto-build C strings from make variables

2014-02-05 Thread Jeff King
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 +