-
Notifications
You must be signed in to change notification settings - Fork 452
/
Copy pathMakefile
219 lines (162 loc) · 5.05 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# build RTB
ROOT = ~/code/rvc
BUILD = tmp
MANUAL = $(BUILD)/manual/robot.pdf
SRC = $(ROOT)/robot
ROBOT = rvctools/robot
COMMON = rvctools/common
CONTRIB = rvctools/contrib
LIB = ~/lib/matlab
release: build doco zipit
doco: pdf markup
build: tmp allfuncs.txt
tmp:
# clean up
mkdir tmp
# recurse
$(MAKE) -C tmp -f ../Makefile $(MFLAGS) _build
_build:
# make a temp directory to hold the files
mkdir -p $(BUILD) rvctools/robot rvctools/simulink rvctools/common rvctools/contrib
# create the Manifest
buildcontent -r `cat ../../RELEASE` --rtb ../allfuncs.txt
# copy all m-files and classes listed in the Manifest
mancp --verbose Manifest $(SRC) $(ROBOT)
mancp --verbose Manifest $(ROOT)/common $(COMMON)
# copy any contrib files that will be included
#cp -r $(ROOT)/contrib/paretofront rvctools/contrib
cp -r $(ROOT)/contrib/pHRIWARE $(CONTRIB)
cp $(LIB)/arrow3.m $(CONTRIB)
# copy any GUIDE files
cp ../../*.fig $(ROBOT)
# copy Java source code and jar file
(cd $(SRC)/java; make)
cp -r $(SRC)/java $(ROBOT)
# copy extra packages
cp -r $(SRC)/+ETS* $(ROBOT)
# copy model files
cp -r $(SRC)/models $(ROBOT)
# copy examples and data files
cp -r $(SRC)/examples $(ROBOT)
cp -r $(SRC)/data $(ROBOT)
cp -r $(SRC)/demos $(ROBOT)
cp -r $(SRC)/mex $(ROBOT)
# copy RST examples
cp -r $(SRC)/RST $(ROBOT)
# copy symbolic examples
cp -r $(SRC)/symbolic $(ROBOT)
# copy Apps
mkdir $(ROBOT)/Apps
cp -r $(SRC)/Apps/tripleangle_App.mlapp $(ROBOT)/Apps
# copy simulink models
cp $(SRC)/simulink/*.slx rvctools/simulink
cp $(SRC)/simulink/*.m rvctools/simulink
cp $(SRC)/simulink/*.txt rvctools/simulink
rm rvctools/simulink/makeoldversions.m
cp -r $(SRC)/simulink/R2015a rvctools/simulink
#cp -r $(SRC)/Octave $(ROBOT) causes the package builder to fail
# copy interfaces
cp -r ../../interfaces $(ROBOT)
# copy misc documentation files
cp $(SRC)/RELEASE $(ROBOT)
-cp $(SRC)/CHANGES $(ROBOT)
cp $(SRC)/README $(ROBOT)
cp $(SRC)/CONTRIB $(ROBOT)
cp $(SRC)/CITATION $(ROBOT)
cp $(SRC)/LGPL-LICENCE.txt $(ROBOT)
cp $(SRC)/startup_rtb.m $(ROBOT)
#cp $(ROOT)/common/*.m rvctools/common
cp $(ROOT)/startup_rvc.m rvctools
# remove all SVN and Simulink project files from rvctools and below
find rvctools -name .svn -type d | xargs rm -rf
find rvctools -name slprj -type d | xargs rm -rf
pdf: tmp $(MANUAL)
$(MANUAL):
# recurse
$(MAKE) -C tmp -f ../Makefile $(MFLAGS) _pdf
_pdf:
-echo "---------build the manual"
-\rm -rf tmpdoc
-mkdir tmpdoc
-cp -r rvctools/robot/* tmpdoc
-cp rvctools/common/* tmpdoc
-rm tmpdoc/HiddenFigure.m
# add a couple of things from interfaces
-cp rvctools/robot/interfaces/VREP/*.m tmpdoc
-cp rvctools/robot/interfaces/Arbotix.m tmpdoc
-cp rvctools/robot/models/*.m tmpdoc
# copy over the manual skeleton, we will work here
cp -r $(ROOT)/robot/doc/manual .
# generate LaTeX code for all functions in there
(cd tmpdoc; help3.py -v -l --include @* *.m; mv all.tex ../manual)
# copy over the index generator support
-mv funcidx* manual
# build the PDF manual
(cd manual; make)
cp manual/robot.pdf rvctools/robot
open -a pdfreduce rvctools/robot
# and let's take a look
open rvctools/robot/robot.pdf
CMD = '/INSERT_HERE/ {\
r helpfuncbycat.xml\
d\
}'
markup: $(MANUAL)
# rely on pdf code to build all the temp files
# recurse
$(MAKE) -C tmp -f ../Makefile $(MFLAGS) _markup
_markup:
# build the XML/info stuff for matlab help browser system
# build it in info, info/html
-mkdir -p info/html
cp -r $(SRC)/doc/info/robot_product_page.html info
(cd tmpdoc; help3.py --rtb -m @* *.m; mv *.html ../info/html)
# copy over the autogen files
cp contents.html info
cp contents_alpha.html info
cp contents_toc.html info
# create the helptoc.xml file
cp $(SRC)/doc/info/helptoc.xml info
#sed '/<!--INSERT_HERE-->/r helpfuncbycat.xml' < $(SRC)/info/helptoc.xml > info/helptoc.xml
# copy invariant files from the distro
cp $(SRC)/doc/info/*.html info
cp $(SRC)/doc/info/*.css info
#cp -r $(SRC)/info/icons info
#cp manual/figs/rtb-montage.png info
# build the web/HTML doco
-mkdir html
(cd tmpdoc; help3.py --rtb -w @* *.m; mv *.html ../html)
cp index.html html
cp index_alpha.html html
# classical matlab toolbox index
cp Contents.m rvctools/robot
# install it all
cp -r info rvctools
cp $(SRC)/doc/info.xml rvctools
zipit:
# build the distrib archives
(cd tmp; zip -rq ../robot-`cat ../../RELEASE`.zip ./rvctools)
#tar zcf robot.tgz ./rvctools
test: zipit
(cd $(ROOT); unzip $(ROOT)/robot/distrib/robot.zip)
flat: tmp pdf
$(MAKE) -C tmp -f ../Makefile $(MFLAGS) _flat
_flat:
-\rm -rf flat
mkdir flat
-cp rvctools/robot/* flat
cp rvctools/common/*.m flat
cp -r rvctools/robot/@SerialLink flat
cp -r rvctools/robot/demos flat
cp -r rvctools/robot/examples flat
cp -r rvctools/robot/mex flat
dropbox:
cp -r ./{robot,simulink,common} $(HOME)/Dropbox
install:
scp -C robot-`cat ../RELEASE`.zip geek:www/RTB/r9
#scp -C robot.zip robot.tgz geek:www/RTB/r9
scp -Cr html geek:www/RTB/r9
scp -C rvctools/robot/robot.pdf geek:www/RTB/r9
ssh geek chmod -R a+rX www/RTB/r9
clean:
@-\rm -rf tmp *.zip *.mltbx