mirror of
https://github.com/EnergyMech/energymech.git
synced 2025-12-29 16:14:43 +00:00
version githash
This commit is contained in:
@@ -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@
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
31
src/gencmd.c
31
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])
|
||||
{
|
||||
if (strcmp(argv[1],"usercombo.h") == 0)
|
||||
make_usercombo();
|
||||
|
||||
if (argv[1] && strcmp(argv[1],"usercombo.h") == 0)
|
||||
make_usercombo();
|
||||
if (strcmp(argv[1],"mcmd.h") == 0)
|
||||
make_mcmd();
|
||||
|
||||
if (argv[1] && strcmp(argv[1],"mcmd.h") == 0)
|
||||
make_mcmd();
|
||||
if (strcmp(argv[1],"testhelp") == 0)
|
||||
test_help();
|
||||
|
||||
if (argv[1] && strcmp(argv[1],"testhelp") == 0)
|
||||
test_help();
|
||||
|
||||
if (argv[1] && strcmp(argv[1],"date") == 0)
|
||||
datestamp();
|
||||
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 */
|
||||
|
||||
Reference in New Issue
Block a user