3 # Output a version_pm3.c file that includes information about the current build
5 # pure sh POSIX as now even on Windows we use WSL or ProxSpace with sh available
7 # Clear environment locale so that git will not use localized strings
11 # if you are making your own fork, change this line to reflect your fork-name
12 fullgitinfo
="RRG/Iceman"
13 # GIT status 0 = dirty, 1 = clean , 2 = undecided
16 # Do we have acces to git command?
19 if [ "$commandGIT" != "" ]; then
21 # now avoiding the "fatal: No names found, cannot describe anything." error by fallbacking to abbrev hash in such case
22 gitversion
=$
(git describe
--dirty --always)
23 gitbranch
=$
(git rev-parse
--abbrev-ref HEAD
)
24 if [ "$1" != "--undecided" ]; then
25 if [ "$gitversion" != "${gitversion%-dirty}" ]; then
31 if [ "$gitbranch" != "" ] && [ "$gitversion" != "" ]; then
32 fullgitinfo
="${fullgitinfo}/${gitbranch}/${gitversion}"
33 ctime
="$(date '+%Y-%m-%d %H:%M:%S')"
35 fullgitinfo
="${fullgitinfo}/master/release (git)"
38 fullgitinfo
="${fullgitinfo}/master/release (no_git)"
39 dl_time
=$
(stat
--printf="%y" ..
/README.md
)
44 # Crop so it fits within 50 characters C string, so max 49 chars
46 fullgitinfoextra
="${fullgitinfo#??????????????????????????????????????????????}"
47 if [ "$fullgitinfoextra" != "$fullgitinfo" ]; then
48 fullgitinfo46
="${fullgitinfo%"${fullgitinfoextra}"}"
49 fullgitinfo
="${fullgitinfo46}..."
53 /* Generated file, do not edit */
57 #define SECTVERSINFO __attribute__((section(".version_information")))
60 const struct version_information SECTVERSINFO version_information = {
61 VERSION_INFORMATION_MAGIC,