Import PicoSAT-913
[cl-satwrap.git] / backends / picosat / mkconfig
blobd0c8fa8352235635a9b6f9436b05f6ae5df1e1ba
1 #!/bin/sh
3 die () {
4 echo "*** mkconfig: $*" 1>&2
5 exit 1
8 [ -f makefile ] || die "can not find 'makefile'"
10 sed \
11 -e '/^C[A-Z]*=/!d' \
12 -e 's,^,#define PICOSAT_,' \
13 -e 's,= *, ",' \
14 -e 's,$,",' \
15 makefile
17 id=""
18 if [ -d .git -a -f .git/HEAD ]
19 then
20 head="`awk 'NF == 1' .git/HEAD`"
21 if [ x"$head" = x ]
22 then
23 head="`awk '{print $2}' .git/HEAD`"
24 if [ ! x"$head" = x -a -f ".git/$head" ]
25 then
26 id=" `cat .git/$head`"
28 else
29 id=" $head"
33 echo "#define PICOSAT_VERSION \"`cat VERSION`$id\""
35 exit 0