3 TRAINS= santafe shinkansen bavarian
5 AUTOINCS= auproto-pic.h layoutinfo.h retransmit-table.h \
6 errorcodes.h stastate.h record-y.h record-l.h \
7 realtime+dflags.h input-codes.h
9 CLIENT_TARGETS= gui-plan-bot topology-dump evdev-manip
11 TARGETS= adhoc-test realtime \
13 $(addsuffix .speeds.ps, $(TRAINS)) \
14 $(addsuffix .speeds.record, $(TRAINS))
16 INPUT_H= /usr/include/linux/input.h
18 LIBOOP_OBJS= __oop-read-copy.o -loop
19 LAYOUT_DATA= ../layout/ours.layout-data
21 include ../common.make
22 include ../cprogs.make
28 client: $(CLIENT_TARGETS)
30 #---------- executables ----------
32 adhoc-test: serialio.o nmra.o adhoc-test.o encode.o utils.o
35 topology-dump: topology-dump.o utils.o $(LAYOUT_DATA).o
37 evdev-manip: evdev-manip.o utils.o $(LIBOOP_OBJS)
39 gui-plan-bot: gui-plan-%: gui-plan.o utils.o parseutils.o obc.o \
40 ../layout/ours.dgram-%.plandata.o \
41 $(LAYOUT_DATA).o $(LIBOOP_OBJS)
42 $(LINK) -L/usr/X11R6/lib -lXpm -lX11
44 #---------- realtime (executable) ----------
46 REALTIME_CORE= realtime startup safety trackloc \
47 speed actual retransmit persist resolve \
48 cmdinput commands obc eventhelp simulate \
49 record record-l record-y \
50 utils serialio parseutils auproto-pic \
51 nmra encode movpos rtprio \
54 REALTIME_CORE_OBJS= $(addsuffix .o, $(REALTIME_CORE))
56 realtime: $(REALTIME_CORE_OBJS) $(LIBOOP_OBJS) -lm
58 #---------- other targets ----------
60 %.speeds.ps %.speeds.record: ./analyse-speeds \
61 ../layout/ours.redacted.shellvars %.manual
64 #---------- autogenerated input files ----------
66 proto-expanded: ../cebpic/README.protocol
69 auproto-pic.c auproto-pic.h: auproto-%: \
70 parse-proto-spec proto-expanded skelproto-%
73 record-y.h: record-y.c
74 record-l.h: record-l.c
76 layoutinfo.h: ../layout/ours.layout-data.c Makefile
77 sed -e '/^#include/,$$d' $< $(ocmp)
79 retransmit-table.h errorcodes.h stastate.h: %: %.gen
80 (echo "/*autogenerated*/" && ./$<) $o
82 realtime+dflags.h: debug-extractor $(addsuffix .c, $(REALTIME_CORE))
85 input-codes.h: extract-input-codes $(INPUT_H)
91 #---------- administrative pseudo targets ----------
94 rm -rf ./+dump.* ./+persist.* ./+realtime.log
97 rm -f *.o *.d t u v $(TARGETS) $(AUTOINCS)
98 rm -f auproto-pic.[ch] *~ .*~ core proto-expanded
99 rm -f record-[yl].[ch] *.tmp *.new
101 realclean: clean tidy
103 #---------- installing things as root bessar ----------
105 BESSAR_PROGRAMS= evdev-manip eventrun
106 BESSAR_ETC_FILES= bessar-root.eventrun evdev-manip-bessar
108 install-bessar-root: $(BESSAR_PROGRAMS) $(BESSAR_ETC_FILES)
109 rsync -vP $(BESSAR_PROGRAMS) davenant:/usr/local/bin/
110 rsync -vP $(BESSAR_ETC_FILES) davenant:/u/ian/things/Bessar/etc/
112 #---------- copying things to bessar (obsolete?) ----------
114 BESSAR=bessar:things/trains-bessar/hostside/.
116 SPECIAL_CFLAGS_record-l= $(FLEXCFLAGS)
118 on-bessar: $(TARGETS)
119 RSYNC_RSH=fsh rsync $(TARGETS) $(BESSAR)
122 RSYNC_RSH=fsh rsync $^ $(BESSAR)
125 include $(wildcard *.d)