You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
654 B
22 lines
654 B
#!/bin/bash
|
|
rm -f version.h
|
|
|
|
CURRENTDIR=$(dirname $0)
|
|
|
|
if [ -d $CURRENTDIR/.git ]; then
|
|
COMMIT_INFO=$(cd $CURRENTDIR && \
|
|
git log -1 --oneline --date=short --pretty=format:"%h date: %cd author: %<|(20)%an")
|
|
else
|
|
COMMIT_INFO="e504f0e date: 2021-06-08 author: Meiyou Chen"
|
|
fi
|
|
|
|
MPI_MMZ_VERSION="git-$COMMIT_INFO"
|
|
|
|
#Only when compiling with CMAKE in linux, will the current directory generate version.h.
|
|
if [ $TARGET_PRODUCT ];then
|
|
cat $CURRENTDIR/version.h.template | sed "s/\$FULL_VERSION/$MPI_MMZ_VERSION/g"
|
|
else
|
|
cat $CURRENTDIR/version.h.template | sed "s/\$FULL_VERSION/$MPI_MMZ_VERSION/g" > $(dirname $0)/version.h
|
|
echo "Generated version.h"
|
|
fi
|