chiark / gitweb /
realtime: movpos: debug output: exclude some more stuff from the default movpos output
[trains.git] / hostside / Makefile
1 #
2
3 TRAINS=         santafe shinkansen bavarian
4
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
8
9 CLIENT_TARGETS= gui-plan-bot topology-dump evdev-manip
10
11 TARGETS=        adhoc-test realtime                                     \
12                 $(CLIENT_TARGETS)                                       \
13                 $(addsuffix .speeds.ps, $(TRAINS))                      \
14                 $(addsuffix .speeds.record, $(TRAINS))
15
16 INPUT_H=        /usr/include/linux/input.h
17
18 LIBOOP_OBJS=    __oop-read-copy.o -loop
19 LAYOUT_DATA=    ../layout/ours.layout-data
20
21 include ../common.make
22 include ../cprogs.make
23
24 default:        all
25 recurse:        all
26 for-pic:
27 all:            $(TARGETS)
28 client:         $(CLIENT_TARGETS)
29
30 #---------- executables ----------
31
32 adhoc-test:     serialio.o nmra.o adhoc-test.o encode.o utils.o
33                 $(LINK)
34
35 topology-dump:  topology-dump.o utils.o $(LAYOUT_DATA).o
36
37 evdev-manip:    evdev-manip.o utils.o $(LIBOOP_OBJS)
38
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
43
44 #---------- realtime (executable) ----------
45
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                       \
52                 $(LAYOUT_DATA)
53
54 REALTIME_CORE_OBJS= $(addsuffix .o, $(REALTIME_CORE))
55
56 realtime:       $(REALTIME_CORE_OBJS) $(LIBOOP_OBJS) -lm
57
58 #---------- other targets ----------
59
60 %.speeds.ps %.speeds.record: ./analyse-speeds \
61         ../layout/ours.redacted.shellvars %.manual
62                 ./$< $*
63
64 #---------- autogenerated input files ----------
65
66 proto-expanded: ../cebpic/README.protocol
67                 expand <$< $o
68
69 auproto-pic.c auproto-pic.h: auproto-%: \
70                         parse-proto-spec proto-expanded skelproto-%
71                 ./$+ $o
72
73 record-y.h: record-y.c
74 record-l.h: record-l.c
75
76 layoutinfo.h:   ../layout/ours.layout-data.c Makefile
77                 sed -e '/^#include/,$$d' $< $(ocmp)
78
79 retransmit-table.h errorcodes.h stastate.h: %: %.gen
80                 (echo "/*autogenerated*/" && ./$<) $o
81
82 realtime+dflags.h: debug-extractor $(addsuffix .c, $(REALTIME_CORE))
83                 ./$^ $(ocmp)
84
85 input-codes.h:  extract-input-codes $(INPUT_H)
86                 ./$^ $o
87
88 %:              %.gen
89                 ./$^ $o
90
91 #---------- administrative pseudo targets ----------
92
93 tidy:
94                 rm -rf ./+dump.* ./+persist.* ./+realtime.log
95
96 clean:
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
100
101 realclean:      clean tidy
102
103 #---------- installing things as root bessar ----------
104
105 BESSAR_PROGRAMS=        evdev-manip eventrun
106 BESSAR_ETC_FILES=       bessar-root.eventrun evdev-manip-bessar
107
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/
111
112 #---------- copying things to bessar (obsolete?) ----------
113
114 BESSAR=bessar:things/trains-bessar/hostside/.
115
116 SPECIAL_CFLAGS_record-l= $(FLEXCFLAGS)
117
118 on-bessar:      $(TARGETS)
119                 RSYNC_RSH=fsh rsync $(TARGETS) $(BESSAR)
120
121 %.on-bessar:    %
122                 RSYNC_RSH=fsh rsync $^ $(BESSAR)
123
124
125 include $(wildcard *.d)