Makefile: ifneq ($(wildcard .svn),) OPENPBXVERSIONNUM=999999 ifneq ($(wildcard .svn/entries),) OPENPBXVERSION=$(shell grep revision .svn/entries | head -n 1 | sed 's:^.*"\([0-9]\+\)".*:\1:') else OPENPBXVERSION=SVN TRUNK endif else OPENPBXVERSIONNUM=000000 endif result: /* * version.h * Automatically generated */ #define OPENPBX_VERSION "270" #define OPENPBX_VERSION_NUM 999999