Skip to content
Snippets Groups Projects
Commit 0417c50c authored by Matthias Schmiddunser's avatar Matthias Schmiddunser
Browse files

Adding shellskript for gitversion creation

parent 866a5c9d
No related branches found
No related tags found
No related merge requests found
......@@ -111,6 +111,10 @@ $(BIN): version subdirs $(OBJECTS)
install:
mv -f $(BIN) ../bin
.PHONY: installtaito
installtaito:
mv -f $(BIN) ~/appl_taito/DOUAR/latest
.PHONY: version
version:
@echo "Updating git commit in source"
......@@ -140,7 +144,7 @@ distclean: objclean
cd NN; make $@
cd OCTREE; make $@
cd RESAMPLE; make $@
rm -f $(BIN) $(BIN).link.stdout $(BIN).link.stderr
rm -f $(BIN) $(BIN).link.stdout $(BIN).link.stderr module_gitversion.f90
.PHONY: more-output
more-output:
......
#!/bin/bash
#
# update_git_version.sh - A script to get the current commit information and
# write the information to module_gitversion.f90
# For info on the format options, check table 2-1 at
# http://git-scm.com/book/it/v2/Git-Basics-Viewing-the-Commit-History
#
# mschmiddunser 01/15
#get commit information
githash=`git log --pretty=format:"%H" -n 1 HEAD`
githashshort=`git log --pretty=format:"%h" -n 1 HEAD`
gitauthor=`git log --pretty=format:"%an" -n 1 HEAD`
gitdate=`git log --pretty=format:"%ad" -n 1 HEAD`
# Generate new module_gitversion.f90
echo "module gitversion" > module_gitversion.f90
echo "" >> module_gitversion.f90
echo " character('${#githash}'), parameter :: githash = '$githash'" >> module_gitversion.f90
echo " character('${#githashshort}'), parameter :: githashshort = '$githashshort'" >> module_gitversion.f90
echo " character('${#gitauthor}'), parameter :: gitauthor = '$gitauthor'" >> module_gitversion.f90
echo " character('${#gitdate}'), parameter :: gitdate = '$gitdate'" >> module_gitversion.f90
echo "" >> module_gitversion.f90
echo "end module gitversion" >> module_gitversion.f90
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment