cannam@162: #!/bin/bash cannam@162: # cannam@162: # Write the Git commit SHA to an include file. cannam@162: # This should be run before compiling code on Linux or Macintosh. cannam@162: # cannam@162: revision_filename=src/common/pa_gitrevision.h cannam@162: cannam@162: # Run git first to make sure it is installed before corrupting the cannam@162: # include file. cannam@162: git rev-parse HEAD cannam@162: cannam@162: # Update the include file with the current Git revision. cannam@162: echo -n "#define PA_GIT_REVISION " > ${revision_filename} cannam@162: git rev-parse HEAD >> ${revision_filename} cannam@162: cannam@162: echo ${revision_filename} now contains cannam@162: cat ${revision_filename}