#!/bin/bash cat < #include #include const char gelfand_version[] = ! echo -n '"' echo -n `git describe` echo -n ' HEAD commit = ' head=`git rev-parse HEAD` echo -n $head echo -n ' dated ' echo -n `git show -s --format=%ci $head` echo -n ' compiled on ' `date` 'at' `hostname` 'by' `whoami` #the argument is the DEBUGOPT and the COMPLEXOPT of the build (Makefile) case "$1" in *DEBUG*) echo -n ' (debug build';; *) echo -n ' (production build';; esac #and the COMPLEXOPT case "$1" in *COMPLEX*) echo -n ', complex version)';; *) echo -n ')';; esac echo -n '"' echo ';' cat <0?r:0]=0; //readlink does not terminate the string const char *dir=get_current_dir_name(); //NULL in the stream would silence all further output const char *user=cuserid(NULL); out <<"Executed as "<