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