From: Ian Jackson Date: Sun, 9 Jan 2011 14:02:41 +0000 (+0000) Subject: hostside: include autoversion and print it in a couple of relevant places X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=71d7455170fee35dc79a6f5dfe42111465142907;p=trains.git hostside: include autoversion and print it in a couple of relevant places --- diff --git a/hostside/.gitignore b/hostside/.gitignore index f796ab5..7238cd8 100644 --- a/hostside/.gitignore +++ b/hostside/.gitignore @@ -21,6 +21,7 @@ record-y.[ch] +persist* .lock +*.log +*+autoversion.c +realtime.stderr *+dflags.h *.new diff --git a/hostside/Makefile b/hostside/Makefile index 7cb9e52..4124cd5 100644 --- a/hostside/Makefile +++ b/hostside/Makefile @@ -54,6 +54,12 @@ REALTIME_CORE= realtime startup safety trackloc \ REALTIME_CORE_OBJS= $(addsuffix .o, $(REALTIME_CORE)) realtime: $(REALTIME_CORE_OBJS) $(LIBOOP_OBJS) -lm + ../.git-revid C >$@+autoversion.c.new + @set -x; if ! cmp $@+autoversion.c.new $@+autoversion.c; then \ + mv $@+autoversion.c.new $@+autoversion.c; \ + $(CC) $(CFLAGS) -c $@+autoversion.c; \ + fi + $(CC) $(LDFLAGS) $@+autoversion.o $^ $(LDLIBS) -o $@ #---------- other targets ---------- diff --git a/hostside/TODO b/hostside/TODO index d44360d..dec646e 100644 --- a/hostside/TODO +++ b/hostside/TODO @@ -1,7 +1,6 @@ multiplex should have restart loop limiting why did removing +persist.* not fix it -version number should be reported / preserved somehow should expire dumps, eventually want realtime kernel for bessar diff --git a/hostside/persist.c b/hostside/persist.c index 83aa147..7e67d99 100644 --- a/hostside/persist.c +++ b/hostside/persist.c @@ -375,6 +375,8 @@ void persist_entrails_run_converter(void) { SEG_IV; MovPosComb report; + printf("# %s\n", autoversion); + persist_mapread(); FOR_SEG { diff --git a/hostside/realtime.c b/hostside/realtime.c index e56b4cf..46f6c06 100644 --- a/hostside/realtime.c +++ b/hostside/realtime.c @@ -577,6 +577,7 @@ int main(int argc, const char **argv) { sys_events= 0; } + ouprintf("info version : %s\n", autoversion); persist_entrails_interpret(); records_parse(argv); realtime_priority(); diff --git a/hostside/realtime.h b/hostside/realtime.h index 3624c75..02635a0 100644 --- a/hostside/realtime.h +++ b/hostside/realtime.h @@ -19,6 +19,7 @@ #include #include +#include "../.git-revid-autoversion.h" #include "../layout/layout-data.h" #include "realtime+dflags.h"