mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-04 20:00:04 +02:00
added updateversion into makefile while compiling
This commit is contained in:
parent
56645a48af
commit
7a8d0b8dad
@ -21,7 +21,7 @@ OBJS = $(SRCS:%.c=%.o)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
all: clean $(PROGS)
|
all: clean updateVersion $(PROGS)
|
||||||
|
|
||||||
boot: $(OBJS)
|
boot: $(OBJS)
|
||||||
|
|
||||||
@ -41,7 +41,8 @@ romfs:
|
|||||||
clean:
|
clean:
|
||||||
rm -rf $(PROGS) *.o *.gdb
|
rm -rf $(PROGS) *.o *.gdb
|
||||||
|
|
||||||
|
updateVersion:
|
||||||
|
./updateGitVersion.sh
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
35
slsDetectorSoftware/gotthardDetectorServer/updateGitVersion.sh
Executable file
35
slsDetectorSoftware/gotthardDetectorServer/updateGitVersion.sh
Executable file
@ -0,0 +1,35 @@
|
|||||||
|
SERVER=gotthardDetectorServer
|
||||||
|
TMPFILE=gitInfoGotthardTmp.h
|
||||||
|
INCLFILE=gitInfoGotthard.h
|
||||||
|
|
||||||
|
WD=slsDetectorSoftware/$SERVER
|
||||||
|
|
||||||
|
GITREPO1='git remote -v'
|
||||||
|
GITREPO2=" | grep \"fetch\" | cut -d' ' -f1"
|
||||||
|
BRANCH1='git branch -v'
|
||||||
|
BRANCH2=" | grep '*' | cut -d' ' -f2"
|
||||||
|
REPUID1='git log --pretty=format:"%H" -1'
|
||||||
|
AUTH1_1='git log --pretty=format:"%cn" -1'
|
||||||
|
AUTH1_2=" | cut -d' ' -f1"
|
||||||
|
AUTH2_1='git log --pretty=format:"%cn" -1'
|
||||||
|
AUTH2_2=" | cut -d' ' -f2"
|
||||||
|
FOLDERREV1='git log --oneline . ' #used for all the individual server folders
|
||||||
|
FOLDERREV2=" | wc -l" #used for all the individual server folders
|
||||||
|
REV1='git log --oneline '
|
||||||
|
REV2=" | wc -l"
|
||||||
|
RDATE1='git log --pretty=format:"%ci" -1'
|
||||||
|
|
||||||
|
GITREPO=`eval $GITREPO1 $GITREPO2`
|
||||||
|
BRANCH=`eval $BRANCH1 $BRANCH2`
|
||||||
|
REPUID=`eval $REPUID1`
|
||||||
|
AUTH1=`eval $AUTH1_1 $AUTH1_2`
|
||||||
|
AUTH2=`eval $AUTH2_1 $AUTH2_2`
|
||||||
|
REV=`eval $REV1 $REV2`
|
||||||
|
FOLDERREV=`eval $FOLDERREV1 $FOLDERREV2`
|
||||||
|
RDATE=`eval $RDATE1`
|
||||||
|
echo Path: slsDetectorsPackage/$WD $'\n'URL: ${GITREPO}/$SERVER $'\n'Repository Root: ${GITREPO} $'\n'Repsitory UUID: ${REPUID} $'\n'Revision: ${FOLDERREV} $'\n'Branch: ${BRANCH} $'\n'Last Changed Author: ${AUTH1}_${AUTH2} $'\n'Last Changed Rev: ${REV} $'\n'Last Changed Date: ${RDATE} > gitInfo.txt
|
||||||
|
cd ../../
|
||||||
|
./genVersionHeader.sh $WD/gitInfo.txt $WD/$TMPFILE $WD/$INCLFILE
|
||||||
|
echo "Revision Updated"
|
||||||
|
cd $WD
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user