mirror of
https://github.com/EnergyMech/energymech.git
synced 2025-12-17 15:36:50 +00:00
version githash
This commit is contained in:
parent
9529ba3317
commit
db4842c42e
9
.gitignore
vendored
9
.gitignore
vendored
@ -6,6 +6,7 @@ src/Makefile
|
||||
src/config.h
|
||||
src/mcmd.h
|
||||
src/usercombo.h
|
||||
src/githash.h
|
||||
trivia/*.index
|
||||
|
||||
# compiled files
|
||||
@ -28,6 +29,8 @@ mech.pid
|
||||
mech.session
|
||||
root.zone*
|
||||
trick.conf
|
||||
mech.trivscore
|
||||
trivia/megatrivia.txt
|
||||
|
||||
# developer files
|
||||
.use_size
|
||||
@ -36,3 +39,9 @@ debug*
|
||||
*.log
|
||||
*.stats
|
||||
github
|
||||
|
||||
src/calc.c
|
||||
src/x
|
||||
src/y
|
||||
src/z
|
||||
|
||||
|
||||
3
VERSIONS
3
VERSIONS
@ -1,5 +1,6 @@
|
||||
3.0.99p4 -- WORK IN PROGRESS (~March, 2018)
|
||||
3.1 -- WORK IN PROGRESS (~April, 2018)
|
||||
|
||||
* Added: Git version hash included in version string if git environment is found.
|
||||
* Added: RAND command (toybox). Usage: RAND [[min[-| ]]max|"nick"|"luser"]
|
||||
* Added: Energymech can now link with libmusl (--with-libmusl[=/PATH/TO/musl-gcc])
|
||||
* Added: (ALPHA) Perl scripting support (PERL, PERLSCRIPT)
|
||||
|
||||
5
configure
vendored
5
configure
vendored
@ -1094,8 +1094,12 @@ fi
|
||||
#
|
||||
# is this a git environment
|
||||
#
|
||||
def_git='#undef HAVE_GIT'
|
||||
echo $ac_n "checking for git ... "$ac_c
|
||||
GITEXE=`config/which git`
|
||||
if [ -x $GITEXE -a -r .git ]; then
|
||||
def_git='#define HAVE_GIT'
|
||||
fi
|
||||
echo $ac_t "$GITEXE"
|
||||
|
||||
#
|
||||
@ -1469,6 +1473,7 @@ s|@DEF_URLCAPTURE@|$def_urlcapture|;
|
||||
s|@DEF_WEB@|$def_web|;
|
||||
s|@DEF_WINGATE@|$def_wingate|;
|
||||
|
||||
s|@DEF_GIT@|$def_git|;
|
||||
s|@LIT_END@|$LIT_END|;
|
||||
s|@BIG_END@|$BIG_END|;
|
||||
s|@DEF_CRYPT_FUNCTION@|$CRYPT_FUNCTION|;
|
||||
|
||||
@ -75,21 +75,24 @@ mcmd.h: gencmd
|
||||
usercombo.h: gencmd
|
||||
./gencmd usercombo.h
|
||||
|
||||
githash.h: gencmd
|
||||
./gencmd githash.h
|
||||
|
||||
install: $(INSTALLNAME)
|
||||
$(CHMOD) $(INSTALLMODE) $(INSTALLNAME)
|
||||
$(MV) $(INSTALLNAME) $(INSTALLDIR)
|
||||
|
||||
clean:
|
||||
$(RM) $(INSTALLNAME) gencmd mcmd.h usercombo.h core $(TESTFILES) $(OFILES)
|
||||
$(RM) $(INSTALLNAME) gencmd mcmd.h usercombo.h githash.h core $(TESTFILES) $(OFILES)
|
||||
|
||||
$(INSTALLNAME): $(OFILES)
|
||||
$(CROSS_COMPILE)$(CC) $(LFLAGS) -o $(INSTALLNAME) $(OFILES) $(LPROF) $(LIBS) $(LDSCRIPT) $(L_PERL)
|
||||
@oc@ $(CROSS_COMPILE)objcopy -R .note -R .comment -R .got -R .got.plt $(INSTALLNAME)
|
||||
#@oc@ $(CROSS_COMPILE)objcopy -R .note -R .comment -R .got -R .got.plt $(INSTALLNAME)
|
||||
@sz@ size $(INSTALLNAME)
|
||||
|
||||
$(INSTALLNAME)-static: $(OFILES)
|
||||
$(CROSS_COMPILE)$(CC) $(LFLAGS) -o $(INSTALLNAME) $(OFILES) $(LPROF) $(LIBS) $(LDSCRIPT) $(L_PERL) -static
|
||||
@oc@ $(CROSS_COMPILE)objcopy -R .note -R .comment -R .got -R .got.plt $(INSTALLNAME)
|
||||
#@oc@ $(CROSS_COMPILE)objcopy -R .note -R .comment -R .got -R .got.plt $(INSTALLNAME)
|
||||
@sz@ size $(INSTALLNAME)
|
||||
|
||||
|
||||
@ -105,12 +108,12 @@ mega-install: mega $(SRCFILES) $(INCS) usage.h
|
||||
|
||||
mega: $(SRCFILES) $(INCS) usage.h
|
||||
$(CROSS_COMPILE)$(CC) $(CFLAGS) -o $(INSTALLNAME) mega.c -DGENDATE="`./gencmd date`" -I. $(LPROF) $(LIBS) $(LDSCRIPT) $(PYINCLUDE) $(TCLINCLUDE) $(I_PERL) $(L_PERL)
|
||||
@oc@ $(CROSS_COMPILE)objcopy -R .note -R .comment $(INSTALLNAME)
|
||||
#@oc@ $(CROSS_COMPILE)objcopy -R .note -R .comment $(INSTALLNAME)
|
||||
@sz@ size $(INSTALLNAME)
|
||||
|
||||
mega-static: $(SRCFILES) $(INCS) usage.h
|
||||
$(CROSS_COMPILE)$(CC) $(CFLAGS) -o $(INSTALLNAME) mega.c -DGENDATE="`./gencmd date`" -I. $(LPROF) $(LIBS) $(LDSCRIPT) $(PYINCLUDE) $(TCLINCLUDE) $(I_PERL) $(L_PERL) -static
|
||||
@oc@ $(CROSS_COMPILE)objcopy -R .note -R .comment $(INSTALLNAME)
|
||||
#@oc@ $(CROSS_COMPILE)objcopy -R .note -R .comment $(INSTALLNAME)
|
||||
@sz@ size $(INSTALLNAME)
|
||||
|
||||
#
|
||||
@ -185,7 +188,7 @@ irc.o: irc.c $(INCS)
|
||||
kicksay.o: kicksay.c $(INCS)
|
||||
$(CROSS_COMPILE)$(CC) $(CFLAGS) -c $< $(CPROF)
|
||||
|
||||
main.o: main.c $(INCS)
|
||||
main.o: main.c $(INCS) githash.h
|
||||
$(CROSS_COMPILE)$(CC) $(CFLAGS) -c $< -DGENDATE="`./gencmd date`" $(CPROF) $(PYINCLUDE)
|
||||
|
||||
net.o: net.c $(INCS)
|
||||
|
||||
@ -239,6 +239,12 @@
|
||||
#define SCRIPTING
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* define for git environments
|
||||
*/
|
||||
@DEF_GIT@
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
23
src/gencmd.c
23
src/gencmd.c
@ -510,20 +510,33 @@ void datestamp(void)
|
||||
t->tm_year + 1900,hourampm[t->tm_hour],t->tm_min,(t->tm_hour <= 11) ? "am" : "pm");
|
||||
}
|
||||
|
||||
void githash(void)
|
||||
{
|
||||
#ifdef HAVE_GIT
|
||||
system("git log -n 1 | grep commit | sed -r 's/^commit (.{7}).*/#define GITHASH \" (git:\\1)\"/g;' > githash.h");
|
||||
#else
|
||||
system("echo '#define GITHASH \"\"' > githash.h");
|
||||
#endif
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
|
||||
if (argv[1] && strcmp(argv[1],"usercombo.h") == 0)
|
||||
if (argv[1])
|
||||
{
|
||||
if (strcmp(argv[1],"usercombo.h") == 0)
|
||||
make_usercombo();
|
||||
|
||||
if (argv[1] && strcmp(argv[1],"mcmd.h") == 0)
|
||||
if (strcmp(argv[1],"mcmd.h") == 0)
|
||||
make_mcmd();
|
||||
|
||||
if (argv[1] && strcmp(argv[1],"testhelp") == 0)
|
||||
if (strcmp(argv[1],"testhelp") == 0)
|
||||
test_help();
|
||||
|
||||
if (argv[1] && strcmp(argv[1],"date") == 0)
|
||||
if (strcmp(argv[1],"date") == 0)
|
||||
datestamp();
|
||||
|
||||
if (strcmp(argv[1],"githash.h") == 0)
|
||||
githash();
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
@ -33,6 +33,8 @@
|
||||
|
||||
#endif /* MAIN_C */
|
||||
|
||||
#include "githash.h"
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
@ -40,8 +42,8 @@
|
||||
#define DEFAULTCMDCHAR '-'
|
||||
#define MECHUSERLOGIN "v3.energymech.net"
|
||||
|
||||
BEG const char VERSION[] MDEF("3.0.99p4");
|
||||
BEG const char SRCDATE[] MDEF("March 13th, 2018");
|
||||
BEG const char VERSION[] MDEF("3.1p" GITHASH);
|
||||
BEG const char SRCDATE[] MDEF("April 14th, 2018");
|
||||
#ifdef __CYGWIN__
|
||||
BEG const char BOTCLASS[] MDEF("WinMech");
|
||||
#else /* ! CYGWIN */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user