Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STJr
SRB2
Commits
dc02339c
Commit
dc02339c
authored
2 years ago
by
Eidolon
Browse files
Options
Downloads
Plain Diff
Merge branch 'comptime-no-fail' into 'master'
Minor comptime refactoring. See merge request
!1776
parents
c008dc4d
b7711b2b
Branches
Branches containing commit
Tags
Tags containing commit
Loading
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
comptime.sh
+22
-32
22 additions, 32 deletions
comptime.sh
src/Makefile
+2
-2
2 additions, 2 deletions
src/Makefile
with
24 additions
and
34 deletions
comptime.sh
+
22
−
32
View file @
dc02339c
#!/bin/
bash -e
#!/bin/
sh
path
=
"."
path
=
"."
if
[
x
"
$1
"
!=
x
]
;
then
if
[
x
"
$1
"
!=
x
]
;
then
path
=
"
$1
"
path
=
"
$1
"
fi
fi
versiongit
()
{
version
()
{
gitbranch
=
`
git rev-parse
--abbrev-ref
HEAD
`
cat
<<
EOF
> "
$path
/comptime.h"
gitversion
=
`
git rev-parse HEAD
`
cat
<<
EOF
>
$path
/comptime.h
// Do not edit! This file was autogenerated
// Do not edit! This file was autogenerated
// by the
$0
script with git
// by the
$0
script with git
//
//
const char* compbranch = "
$
gitbranch
";
const char* compbranch = "
$
1
";
const char* comprevision = "
$
{
gitversion
:0:8
}
";
const char* comprevision = "
$
2
";
EOF
EOF
}
versiongit
()
{
gitbranch
=
"
$(
git rev-parse
--abbrev-ref
HEAD
)
"
gitversion
=
"
$(
git rev-parse HEAD |
cut
-c
-8
)
"
version
"
$gitbranch
"
"
$gitversion
"
;
exit
0
exit
0
}
}
versionsvn
()
{
versionsvn
()
{
svnrevision
=
`
svnversion
-n
$1
`
svnrevision
=
"
$(
svnversion
-n
"
$1
"
)
"
cat
<<
EOF
>
$path
/comptime.h
version
"Subversion"
"r
$svnrevision
"
;
// Do not edit! This file was autogenerated
// by the
$0
script with subversion
//
const char* compbranch = "Subversion";
const char* comprevision = "r
$svnrevision
";
EOF
exit
0
exit
0
}
}
versionfake
()
{
versionfake
()
{
cat
<<
EOF
>
$path
/comptime.h
version
"Unknown"
"illegal"
;
// Do not edit! This file was autogenerated
// by the
$0
script with an unknown or nonexist SCM
//
const char* compbranch = "Unknown";
const char* comprevision = "illegal";
EOF
}
}
compversion
()
{
compversion
()
{
touch
$path
/comptime.c
touch
"
$path
/comptime.c
"
versionfake
versionfake
test
-d
$path
/.svn
&&
versionsvn
[
-d
"
$path
/.svn
"
]
&&
versionsvn
"
$@
"
test
-d
$path
/../.git
&&
versiongit
[
-d
"
$path
/../.git
"
]
&&
versiongit
exit
1
exit
1
}
}
test
-f
$path
/comptime.c
&&
compversion
[
-f
"
$path
/comptime.c
"
]
&&
compversion
"
$@
"
exit
2
exit
2
This diff is collapsed.
Click to expand it.
src/Makefile
+
2
−
2
View file @
dc02339c
...
@@ -357,9 +357,9 @@ $(dbg).txt : $(dbg)
...
@@ -357,9 +357,9 @@ $(dbg).txt : $(dbg)
# this really updates comptime.h
# this really updates comptime.h
comptime.c
::
comptime.c
::
ifdef
WINDOWSHELL
ifdef
WINDOWSHELL
$(
.
)
..
\c
omptime.bat .
-
$(
.
)
..
\c
omptime.bat .
else
else
$(
.
)
../comptime.sh .
-
$(
.
)
../comptime.sh .
endif
endif
# I wish I could make dependencies out of rc files :(
# I wish I could make dependencies out of rc files :(
...
...
This diff is collapsed.
Click to expand it.
Eidolon
@ShaderWraith
mentioned in commit
e6780f2b
·
2 years ago
mentioned in commit
e6780f2b
mentioned in commit e6780f2bee69aec3770066ee6ba91c3b3c656f1e
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment