From: ian Date: Wed, 5 Jul 2006 17:42:25 +0000 (+0000) Subject: autogenerate some error codes; add "autogenerated" note to top of all .gen-generated... X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=a721851675261b07daf12ffa9dc31ddb1754e166;p=trains.git autogenerate some error codes; add "autogenerated" note to top of all .gen-generated files in the Makefile rather than in each .gen script --- diff --git a/hostside/.cvsignore b/hostside/.cvsignore index 34d7554..7ef68e1 100644 --- a/hostside/.cvsignore +++ b/hostside/.cvsignore @@ -9,4 +9,5 @@ proto-expanded auproto-* gui-plan-bot selectors.h +errorcodes.h retransmit-table.h diff --git a/hostside/Makefile b/hostside/Makefile index 8908f19..b145464 100644 --- a/hostside/Makefile +++ b/hostside/Makefile @@ -45,8 +45,8 @@ auproto-pic.c auproto-pic.h: auproto-%: \ layoutinfo.h: ../layout/ours.layout-data.c Makefile sed -e '/^#include/,$$d' $< $o -selectors.h retransmit-table.h: %: %.gen - ./$< $o +selectors.h retransmit-table.h errorcodes.h: %: %.gen + (echo "/*autogenerated*/" && ./$<) $o safety: safety.o utils.o trackloc.o ../layout/ours.layout-data.o $(LINK) diff --git a/hostside/errorcodes.h.gen b/hostside/errorcodes.h.gen new file mode 100755 index 0000000..f624b0e --- /dev/null +++ b/hostside/errorcodes.h.gen @@ -0,0 +1,10 @@ +#!/usr/bin/perl +print "typedef enum {\n" or die $!; +foreach $f (qw( + OK + Safety + )) { + $_= $f; s/\-//g; + printf " EC_%s,\n", $_; +} +print "} ErrorCode;\n" or die $!; diff --git a/hostside/retransmit-table.h.gen b/hostside/retransmit-table.h.gen index 781bd26..469d230 100755 --- a/hostside/retransmit-table.h.gen +++ b/hostside/retransmit-table.h.gen @@ -5,7 +5,6 @@ $exp= 1.3; $first= 1.0; print <