Added git SHA1 hash on output through Makefile symbol.

This commit is contained in:
Paul Romano 2012-03-23 08:42:03 -04:00
parent aee6beb01a
commit 2c24c3d405
2 changed files with 10 additions and 1 deletions

View file

@ -22,6 +22,12 @@ OPTIMIZE = no
USE_MPI = no
USE_HDF5 = no
#===============================================================================
# Add git SHA-1 hash
#===============================================================================
GIT_SHA1 = $(shell git log -1 | head -n 1 | awk '{print $$2}')
#===============================================================================
# GNU Fortran compiler options
#===============================================================================
@ -212,7 +218,7 @@ neat:
.PHONY: all xml-fortran clean neat distclean
%.o: %.F90
$(F90) $(F90FLAGS) -Ixml-fortran -Ixml-fortran/templates -c $<
$(F90) $(F90FLAGS) -DGIT_SHA1="\"$(GIT_SHA1)\"" -Ixml-fortran -Ixml-fortran/templates -c $<
#===============================================================================
# Dependencies

View file

@ -50,6 +50,9 @@ contains
' Developed At: Massachusetts Institute of Technology'
write(UNIT=OUTPUT_UNIT, FMT='(6X,"Version:",7X,I1,".",I1,".",I1)') &
VERSION_MAJOR, VERSION_MINOR, VERSION_RELEASE
#ifdef GIT_SHA1
write(UNIT=OUTPUT_UNIT, FMT='(6X,"Git SHA1:",6X,A)') GIT_SHA1
#endif
! Write the date and time
call get_today(today_date, today_time)