From: ian Date: Sun, 15 Jun 2008 11:35:58 +0000 (+0000) Subject: Tidy up the Makefile and get rid of some obsolete stuff X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=7046e43dd20be8981009d9768e6f70ec53ad7bef;p=trains.git Tidy up the Makefile and get rid of some obsolete stuff --- diff --git a/hostside/.cvsignore b/hostside/.cvsignore index 5fc004d..7528cb5 100644 --- a/hostside/.cvsignore +++ b/hostside/.cvsignore @@ -1,7 +1,6 @@ realtime hostside-old hostside -safety topology-dump t u @@ -14,7 +13,6 @@ layoutinfo.h proto-expanded auproto-* gui-plan-bot -selectors.h errorcodes.h stastate.h retransmit-table.h diff --git a/hostside/Makefile b/hostside/Makefile index 7942d75..91badc9 100644 --- a/hostside/Makefile +++ b/hostside/Makefile @@ -2,16 +2,20 @@ TRAINS= santafe shinkansen -AUTOINCS= auproto-pic.h layoutinfo.h selectors.h retransmit-table.h \ - errorcodes.h stastate.h record-y.h record-l.h \ +AUTOINCS= auproto-pic.h layoutinfo.h retransmit-table.h \ + errorcodes.h stastate.h record-y.h record-l.h \ realtime+dflags.h input-codes.h -TARGETS= hostside-old gui-plan-bot realtime topology-dump \ - evdev-manip hiddev-test \ - $(addsuffix .speeds.ps, $(TRAINS)) \ + +TARGETS= hostside-old gui-plan-bot topology-dump \ + evdev-manip hiddev-test realtime \ + $(addsuffix .speeds.ps, $(TRAINS)) \ $(addsuffix .speeds.record, $(TRAINS)) INPUT_H= /usr/include/linux/input.h +LIBOOP_OBJS= __oop-read-copy.o -loop +LAYOUT_DATA= ../layout/ours.layout-data + include ../common.make include ../cprogs.make @@ -20,45 +24,45 @@ recurse: all for-pic: all: $(TARGETS) +#---------- executables ---------- + hostside-old: serialio.o nmra.o main.o encode.o utils.o - $(LINK) -BESSAR=bessar:things/trains-bessar/hostside/. +topology-dump: topology-dump.o utils.o $(LAYOUT_DATA).o -SPECIAL_CFLAGS_record-l= $(FLEXCFLAGS) +evdev-manip: evdev-manip.o utils.o $(LIBOOP_OBJS) -on-bessar: $(TARGETS) - RSYNC_RSH=fsh rsync $(TARGETS) $(BESSAR) +hiddev-test: hiddev-test.o utils.o -%.on-bessar: % - RSYNC_RSH=fsh rsync $^ $(BESSAR) +gui-plan-bot: gui-plan-%: gui-plan.o utils.o parseutils.o obc.o \ + ../layout/ours.dgram-%.plandata.o \ + $(LAYOUT_DATA).o $(LIBOOP_OBJS) + $(LINK) -L/usr/X11R6/lib -lXpm -lX11 -REALTIME_CORE= realtime startup safety trackloc \ - speed actual retransmit persist resolve \ - cmdinput commands obc eventhelp simulate \ - record record-l record-y \ - utils serialio parseutils auproto-pic \ - nmra encode movpos rtprio \ - ../layout/ours.layout-data +#---------- realtime (executable) ---------- -LIBOOP_OBJS= __oop-read-copy.o -loop +REALTIME_CORE= realtime startup safety trackloc \ + speed actual retransmit persist resolve \ + cmdinput commands obc eventhelp simulate \ + record record-l record-y \ + utils serialio parseutils auproto-pic \ + nmra encode movpos rtprio \ + $(LAYOUT_DATA) REALTIME_CORE_OBJS= $(addsuffix .o, $(REALTIME_CORE)) realtime: $(REALTIME_CORE_OBJS) $(LIBOOP_OBJS) -lm - $(LINK) -proto-expanded: ../cebpic/README.protocol - expand <$< $o +#---------- other targets ---------- -topology-dump: topology-dump.o utils.o ../layout/ours.layout-data.o - $(LINK) +%.speeds.ps %.speeds.record: ./analyse-speeds \ + ../layout/ours.redacted.shellvars %.manual + ./$< $* -gui-plan-bot: gui-plan-%: gui-plan.o utils.o parseutils.o obc.o \ - ../layout/ours.dgram-%.plandata.o \ - ../layout/ours.layout-data.o \ - $(LIBOOP_OBJS) - $(LINK) -L/usr/X11R6/lib -lXpm -lX11 +#---------- autogenerated input files ---------- + +proto-expanded: ../cebpic/README.protocol + expand <$< $o auproto-pic.c auproto-pic.h: auproto-%: \ parse-proto-spec proto-expanded skelproto-% @@ -68,38 +72,41 @@ record-y.h: record-y.c record-l.h: record-l.c layoutinfo.h: ../layout/ours.layout-data.c Makefile - sed -e '/^#include/,$$d' $< $o + sed -e '/^#include/,$$d' $< $(ocmp) -selectors.h retransmit-table.h errorcodes.h stastate.h: %: %.gen +retransmit-table.h errorcodes.h stastate.h: %: %.gen (echo "/*autogenerated*/" && ./$<) $o realtime+dflags.h: debug-extractor $(addsuffix .c, $(REALTIME_CORE)) - ./$^ >$@.new - cmp $@ $@.new || mv -f $@.new $@ - -evdev-manip: evdev-manip.o utils.o $(LIBOOP_OBJS) - -hiddev-test: hiddev-test.o utils.o - -safety: safety.o utils.o trackloc.o ../layout/ours.layout-data.o - $(LINK) + ./$^ $(ocmp) input-codes.h: extract-input-codes $(INPUT_H) ./$^ $o -%.speeds.ps %.speeds.record: ./analyse-speeds \ - ../layout/ours.redacted.shellvars %.manual - ./$< $* - %: %.gen ./$^ $o +#---------- administrative pseudo targets ---------- + tidy: rm -rf ./+dump.* clean: tidy - rm -f *.o *.d $(TARGETS) selectors.h + rm -f *.o *.d $(TARGETS) $(AUTOINCS) rm -f auproto-pic.h *~ core proto-expanded rm -f record-[yl].[ch] +#---------- copying things to bessar (obsolete?) ---------- + +BESSAR=bessar:things/trains-bessar/hostside/. + +SPECIAL_CFLAGS_record-l= $(FLEXCFLAGS) + +on-bessar: $(TARGETS) + RSYNC_RSH=fsh rsync $(TARGETS) $(BESSAR) + +%.on-bessar: % + RSYNC_RSH=fsh rsync $^ $(BESSAR) + + include $(wildcard *.d) diff --git a/hostside/selectors.h.gen b/hostside/selectors.h.gen deleted file mode 100755 index 5950668..0000000 --- a/hostside/selectors.h.gen +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/perl -foreach $f (qw( - picio - picioh - picdebug - )) { - printf "#define sel_%-10s 0x%08lxLU\n", $f, $bit - or die $!; - $bit <<= 1; -}