CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/android/git-version-gen.sh
Views: 1401
#!/bin/bash1## Copyright (c) 2012- PPSSPP Project.23## This program is free software: you can redistribute it and/or modify4## it under the terms of the GNU General Public License as published by5## the Free Software Foundation, version 2.0 or later versions.67## This program is distributed in the hope that it will be useful,8## but WITHOUT ANY WARRANTY; without even the implied warranty of9## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10## GNU General Public License 2.0 for more details.1112## A copy of the GPL 2.0 should have been included with the program.13## If not, see http://www.gnu.org/licenses/1415## Official git repository and contact information can be found at16## https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.1718GIT_VERSION_FILE=$(dirname $0)/../git-version.cpp1920if [ -e "$GIT_VERSION_FILE" ]; then21# Skip updating the file if PPSSPP_GIT_VERSION_NO_UPDATE is 1.22results=$(grep '^#define PPSSPP_GIT_VERSION_NO_UPDATE 1' "$GIT_VERSION_FILE")23if [ "$results" != "" ]; then24exit 025fi26fi2728GIT_VERSION=$(git describe --always)29if [ "$GIT_VERSION" == "" ]; then30echo "Unable to update git-version.cpp, git not on path." 1>&23132echo "// This is a generated file." > "$GIT_VERSION_FILE"33echo >> "$GIT_VERSION_FILE"34echo 'const char *PPSSPP_GIT_VERSION = "unknown";' >> "$GIT_VERSION_FILE"35exit 036fi3738# Don't modify the file if it already has the current version.39if [ -e "$GIT_VERSION_FILE" ]; then40results=$(grep "$GIT_VERSION" "$GIT_VERSION_FILE")41if [ "$results" != "" ]; then42exit 043fi44fi4546echo "// This is a generated file." > "$GIT_VERSION_FILE"47echo >> "$GIT_VERSION_FILE"48echo 'const char *PPSSPP_GIT_VERSION = "'"$GIT_VERSION"'";' >> "$GIT_VERSION_FILE"49echo >> "$GIT_VERSION_FILE"50echo "// If you don't want this file to update/recompile, change to 1." >> "$GIT_VERSION_FILE"51echo "#define PPSSPP_GIT_VERSION_NO_UPDATE 0" >> "$GIT_VERSION_FILE"525354