1 | # !kmk_ash
|
---|
2 | # $Id: gen-slickedit-workspace.sh 37821 2011-07-07 14:18:26Z vboxsync $
|
---|
3 | ## @file
|
---|
4 | # Script for generating a SlickEdit workspace.
|
---|
5 | #
|
---|
6 |
|
---|
7 | #
|
---|
8 | # Copyright (C) 2009-2011 Oracle Corporation
|
---|
9 | #
|
---|
10 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | # available from http://www.virtualbox.org. This file is free software;
|
---|
12 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | # General Public License (GPL) as published by the Free Software
|
---|
14 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | #
|
---|
18 |
|
---|
19 | #
|
---|
20 | # Some constants.
|
---|
21 | #
|
---|
22 | MY_CAT="kmk_cat"
|
---|
23 | MY_MKDIR="kmk_mkdir"
|
---|
24 | MY_MV="kmk_mv"
|
---|
25 | MY_SED="kmk_sed"
|
---|
26 | MY_RM="kmk_rm"
|
---|
27 | MY_SLEEP="kmk_sleep"
|
---|
28 | MY_EXPR="kmk_expr"
|
---|
29 | MY_SVN="svn"
|
---|
30 |
|
---|
31 | #MY_SORT="kmk_cat"
|
---|
32 | MY_SORT="sort"
|
---|
33 |
|
---|
34 | #
|
---|
35 | # Globals.
|
---|
36 | #
|
---|
37 | MY_PROJECT_FILES=""
|
---|
38 | MY_OUT_DIRS="\
|
---|
39 | out/${KBUILD_TARGET}.${KBUILD_TARGET_ARCH}/${KBUILD_TYPE} \
|
---|
40 | out/${BUILD_TARGET}.${BUILD_TARGET_ARCH}/${BUILD_TYPE} \
|
---|
41 | out/${KBUILD_TARGET}.${KBUILD_TARGET_ARCH}/debug \
|
---|
42 | out/${BUILD_TARGET}.${BUILD_TARGET_ARCH}/debug \
|
---|
43 | out/${KBUILD_TARGET}.${KBUILD_TARGET_ARCH}/release \
|
---|
44 | out/${BUILD_TARGET}.${BUILD_TARGET_ARCH}/release \
|
---|
45 | out/linux.amd64/debug \
|
---|
46 | out/linux.x86/debug \
|
---|
47 | out/win.amd64/debug \
|
---|
48 | out/win.x86/debug \
|
---|
49 | out/darwin.amd64/debug \
|
---|
50 | out/darwin.x86/debug \
|
---|
51 | out/solaris.amd64/debug \
|
---|
52 | out/solaris.x86/debug";
|
---|
53 |
|
---|
54 |
|
---|
55 | #
|
---|
56 | # Parameters w/ defaults.
|
---|
57 | #
|
---|
58 | MY_ROOT_DIR=".."
|
---|
59 | MY_OUT_DIR="SlickEdit"
|
---|
60 | MY_PRJ_PRF="VBox-"
|
---|
61 | MY_WS_NAME="VirtualBox.vpw"
|
---|
62 | MY_DBG=""
|
---|
63 | MY_WINDOWS_HOST=""
|
---|
64 | MY_OPT_MINIMAL=""
|
---|
65 |
|
---|
66 | #MY_KBUILD_PATH="${KBUILD_PATH}"
|
---|
67 | #test -z "${MY_KBUILD_PATH}" && MY_KBUILD_PATH="${PATH_KBUILD}"
|
---|
68 | #MY_KBUILD=""
|
---|
69 |
|
---|
70 |
|
---|
71 | ##
|
---|
72 | # Gets the absolute path to an existing directory.
|
---|
73 | #
|
---|
74 | # @param $1 The path.
|
---|
75 | my_abs_dir()
|
---|
76 | {
|
---|
77 | if test -n "${PWD}"; then
|
---|
78 | MY_ABS_DIR=`cd ${MY_ROOT_DIR}/${1} && echo ${PWD}`
|
---|
79 | else
|
---|
80 | # old cygwin shell has no PWD and need adjusting.
|
---|
81 | MY_ABS_DIR=`cd ${MY_ROOT_DIR}/${1} && pwd | ${MY_SED} -e 's,^/cygdrive/\(.\)/,\1:/,'`
|
---|
82 | fi
|
---|
83 | if test -z "${MY_ABS_DIR}"; then
|
---|
84 | MY_ABS_DIR="${1}"
|
---|
85 | fi
|
---|
86 | }
|
---|
87 |
|
---|
88 | ##
|
---|
89 | # Gets the file name part of a path.
|
---|
90 | #
|
---|
91 | # @param $1 The path.
|
---|
92 | my_get_name()
|
---|
93 | {
|
---|
94 | SAVED_IFS=$IFS
|
---|
95 | IFS=":/ "
|
---|
96 | set $1
|
---|
97 | while test $# -gt 1 -a -n "${2}";
|
---|
98 | do
|
---|
99 | shift;
|
---|
100 | done
|
---|
101 |
|
---|
102 | IFS=$SAVED_IFS
|
---|
103 | #echo "$1"
|
---|
104 | export MY_GET_NAME=$1
|
---|
105 | }
|
---|
106 |
|
---|
107 | ##
|
---|
108 | # Generate file entry for the specified file if it was found to be of interest.
|
---|
109 | #
|
---|
110 | # @param $1 The output file name base.
|
---|
111 | # @param $2 The file name.
|
---|
112 | my_file()
|
---|
113 | {
|
---|
114 | # sort and filter by file type.
|
---|
115 | case "$2" in
|
---|
116 | # drop these.
|
---|
117 | *.kup|*~|*.pyc|*.exe|*.sys|*.dll|*.o|*.obj|*.lib|*.a|*.ko)
|
---|
118 | return 0
|
---|
119 | ;;
|
---|
120 |
|
---|
121 | # by prefix or directory component.
|
---|
122 | tst*|*/testcase/*)
|
---|
123 | MY_FOLDER="$1-Testcases.lst"
|
---|
124 | ;;
|
---|
125 |
|
---|
126 | # by extension.
|
---|
127 | *.c|*.cpp|*.m|*.mm|*.pl|*.py|*.as|*.c.h|*.cpp.h)
|
---|
128 | MY_FOLDER="$1-Sources.lst"
|
---|
129 | ;;
|
---|
130 |
|
---|
131 | *.h|*.hpp|*.mm)
|
---|
132 | MY_FOLDER="$1-Headers.lst"
|
---|
133 | ;;
|
---|
134 |
|
---|
135 | *.asm|*.s|*.S|*.inc|*.mac)
|
---|
136 | MY_FOLDER="$1-Assembly.lst"
|
---|
137 | ;;
|
---|
138 |
|
---|
139 | *)
|
---|
140 | MY_FOLDER="$1-Others.lst"
|
---|
141 | ;;
|
---|
142 | esac
|
---|
143 |
|
---|
144 | ## @todo only files which are in subversion.
|
---|
145 | # if ${MY_SVN} info "${2}" > /dev/null 2>&1; then
|
---|
146 | my_get_name "${2}"
|
---|
147 | echo ' <!-- sortkey: '"${MY_GET_NAME}"' --> <F N="'"${2}"'"/>' >> "${MY_FOLDER}"
|
---|
148 | # fi
|
---|
149 | }
|
---|
150 |
|
---|
151 | ##
|
---|
152 | # Generate file entries for the specified sub-directory tree.
|
---|
153 | #
|
---|
154 | # @param $1 The output filename.
|
---|
155 | # @param $2 The sub-directory.
|
---|
156 | my_sub_tree()
|
---|
157 | {
|
---|
158 | if test -n "$MY_DBG"; then echo "dbg: my_sub_tree: ${2}"; fi
|
---|
159 |
|
---|
160 | # Skip .svn directories.
|
---|
161 | case "$2" in
|
---|
162 | */.svn|*/.svn)
|
---|
163 | return 0
|
---|
164 | ;;
|
---|
165 | esac
|
---|
166 |
|
---|
167 | # Process the files in the directory.
|
---|
168 | for f in $2/*;
|
---|
169 | do
|
---|
170 | if test -d "${f}";
|
---|
171 | then
|
---|
172 | my_sub_tree "${1}" "${f}"
|
---|
173 | else
|
---|
174 | my_file "${1}" "${f}"
|
---|
175 | fi
|
---|
176 | done
|
---|
177 | return 0;
|
---|
178 | }
|
---|
179 |
|
---|
180 |
|
---|
181 | ##
|
---|
182 | # Generate folders for the specified directories and files.
|
---|
183 | #
|
---|
184 | # @param $1 The output (base) file name.
|
---|
185 | # @param $2+ The files and directories to traverse.
|
---|
186 | my_generate_folder()
|
---|
187 | {
|
---|
188 | MY_FILE="$1"
|
---|
189 | shift
|
---|
190 |
|
---|
191 | # Zap existing file collections.
|
---|
192 | > "${MY_FILE}-Sources.lst"
|
---|
193 | > "${MY_FILE}-Headers.lst"
|
---|
194 | > "${MY_FILE}-Assembly.lst"
|
---|
195 | > "${MY_FILE}-Testcases.lst"
|
---|
196 | > "${MY_FILE}-Others.lst"
|
---|
197 |
|
---|
198 | # Traverse the directories and files.
|
---|
199 | while test $# -ge 1 -a -n "${1}";
|
---|
200 | do
|
---|
201 | for f in ${MY_ROOT_DIR}/$1;
|
---|
202 | do
|
---|
203 | if test -d "${f}";
|
---|
204 | then
|
---|
205 | my_sub_tree "${MY_FILE}" "${f}"
|
---|
206 | else
|
---|
207 | my_file "${MY_FILE}" "${f}"
|
---|
208 | fi
|
---|
209 | done
|
---|
210 | shift
|
---|
211 | done
|
---|
212 |
|
---|
213 | # Generate the folders.
|
---|
214 | if test -s "${MY_FILE}-Sources.lst";
|
---|
215 | then
|
---|
216 | echo ' <Folder Name="Sources" Filters="*.c;*.cpp;*.cpp.h;*.c.h;*.m;*.mm;*.pl;*.py;*.as">' >> "${MY_FILE}"
|
---|
217 | ${MY_SORT} "${MY_FILE}-Sources.lst" | ${MY_SED} -e 's/<!-- sortkey: [^>]*>/ /' >> "${MY_FILE}"
|
---|
218 | echo ' </Folder>' >> "${MY_FILE}"
|
---|
219 | fi
|
---|
220 | if test -s "${MY_FILE}-Headers.lst";
|
---|
221 | then
|
---|
222 | echo ' <Folder Name="Headers" Filters="*.h;*.hpp">' >> "${MY_FILE}"
|
---|
223 | ${MY_SORT} "${MY_FILE}-Headers.lst" | ${MY_SED} -e 's/<!-- sortkey: [^>]*>/ /' >> "${MY_FILE}"
|
---|
224 | echo ' </Folder>' >> "${MY_FILE}"
|
---|
225 | fi
|
---|
226 | if test -s "${MY_FILE}-Assembly.lst";
|
---|
227 | then
|
---|
228 | echo ' <Folder Name="Assembly" Filters="*.asm;*.s;*.S;*.inc;*.mac">' >> "${MY_FILE}"
|
---|
229 | ${MY_SORT} "${MY_FILE}-Assembly.lst" | ${MY_SED} -e 's/<!-- sortkey: [^>]*>/ /' >> "${MY_FILE}"
|
---|
230 | echo ' </Folder>' >> "${MY_FILE}"
|
---|
231 | fi
|
---|
232 | if test -s "${MY_FILE}-Testcases.lst";
|
---|
233 | then
|
---|
234 | echo ' <Folder Name="Testcases" Filters="tst*;">' >> "${MY_FILE}"
|
---|
235 | ${MY_SORT} "${MY_FILE}-Testcases.lst" | ${MY_SED} -e 's/<!-- sortkey: [^>]*>/ /' >> "${MY_FILE}"
|
---|
236 | echo ' </Folder>' >> "${MY_FILE}"
|
---|
237 | fi
|
---|
238 | if test -s "${MY_FILE}-Others.lst";
|
---|
239 | then
|
---|
240 | echo ' <Folder Name="Others" Filters="">' >> "${MY_FILE}"
|
---|
241 | ${MY_SORT} "${MY_FILE}-Others.lst" | ${MY_SED} -e 's/<!-- sortkey: [^>]*>/ /' >> "${MY_FILE}"
|
---|
242 | echo ' </Folder>' >> "${MY_FILE}"
|
---|
243 | fi
|
---|
244 |
|
---|
245 | # Cleanup
|
---|
246 | ${MY_RM} "${MY_FILE}-Sources.lst" "${MY_FILE}-Headers.lst" "${MY_FILE}-Assembly.lst" "${MY_FILE}-Testcases.lst" "${MY_FILE}-Others.lst"
|
---|
247 | }
|
---|
248 |
|
---|
249 |
|
---|
250 | ##
|
---|
251 | # Function generating a project.
|
---|
252 | #
|
---|
253 | # @param $1 The project file name.
|
---|
254 | # @param $2 The project working directory.
|
---|
255 | # @param $3 Dummy separator.
|
---|
256 | # @param $4+ Include directories.
|
---|
257 | # @param $N --end-includes
|
---|
258 | # @param $N+1 Directory sub-trees and files to include in the project.
|
---|
259 | #
|
---|
260 | my_generate_project()
|
---|
261 | {
|
---|
262 | MY_FILE="${MY_PRJ_PRF}${1}.vpj";
|
---|
263 | echo "Generating ${MY_FILE}..."
|
---|
264 | MY_WRK_DIR="${2}"
|
---|
265 | shift
|
---|
266 | shift
|
---|
267 | shift
|
---|
268 |
|
---|
269 | # Add it to the project list for workspace construction later on.
|
---|
270 | MY_PROJECT_FILES="${MY_PROJECT_FILES} ${MY_FILE}"
|
---|
271 |
|
---|
272 |
|
---|
273 | #
|
---|
274 | # Generate the head bits.
|
---|
275 | #
|
---|
276 | echo '<!DOCTYPE Project SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpj.dtd">' > "${MY_FILE}"
|
---|
277 | echo '<Project' >> "${MY_FILE}"
|
---|
278 | echo ' Version="10.0"' >> "${MY_FILE}"
|
---|
279 | echo ' VendorName="SlickEdit"' >> "${MY_FILE}"
|
---|
280 | echo ' VCSProject="Subversion:"' >> "${MY_FILE}"
|
---|
281 | # echo ' Customized="1"' >> "${MY_FILE}"
|
---|
282 | # echo ' WorkingDir="."' >> "${MY_FILE}"
|
---|
283 | my_abs_dir "${MY_WRK_DIR}" >> "${MY_FILE}"
|
---|
284 | echo ' WorkingDir="'"${MY_ABS_DIR}"'"' >> "${MY_FILE}"
|
---|
285 | echo ' >' >> "${MY_FILE}"
|
---|
286 | echo ' <Config Name="Release" OutputFile="" CompilerConfigName="Latest Version">' >> "${MY_FILE}"
|
---|
287 | echo ' <Menu>' >> "${MY_FILE}"
|
---|
288 | echo ' <Target Name="Compile" MenuCaption="&Compile" CaptureOutputWith="ProcessBuffer"' >> "${MY_FILE}"
|
---|
289 | echo ' SaveOption="SaveCurrent" RunFromDir="%p" ClearProcessBuffer="1">' >> "${MY_FILE}"
|
---|
290 | echo ' <Exec CmdLine="'"${MY_KMK_INVOCATION}"' -C %p %n.o"/>' >> "${MY_FILE}"
|
---|
291 | echo ' </Target>' >> "${MY_FILE}"
|
---|
292 | echo ' <Target Name="Build" MenuCaption="&Build"CaptureOutputWith="ProcessBuffer"' >> "${MY_FILE}"
|
---|
293 | echo ' SaveOption="SaveWorkspaceFiles" RunFromDir="%rw" ClearProcessBuffer="1">' >> "${MY_FILE}"
|
---|
294 | echo ' <Exec CmdLine="'"${MY_KMK_INVOCATION}"'"/>' >> "${MY_FILE}"
|
---|
295 | echo ' </Target>' >> "${MY_FILE}"
|
---|
296 | echo ' <Target Name="Rebuild" MenuCaption="&Rebuild" CaptureOutputWith="ProcessBuffer"' >> "${MY_FILE}"
|
---|
297 | echo ' SaveOption="SaveWorkspaceFiles" RunFromDir="%rw" ClearProcessBuffer="1">' >> "${MY_FILE}"
|
---|
298 | echo ' <Exec CmdLine="'"${MY_KMK_INVOCATION}"' rebuild"/>' >> "${MY_FILE}"
|
---|
299 | echo ' </Target>' >> "${MY_FILE}"
|
---|
300 | echo ' <Target Name="Debug" MenuCaption="&Debug" SaveOption="SaveNone" RunFromDir="%rw">' >> "${MY_FILE}"
|
---|
301 | echo ' <Exec/>' >> "${MY_FILE}"
|
---|
302 | echo ' </Target>' >> "${MY_FILE}"
|
---|
303 | echo ' <Target Name="Execute" MenuCaption="E&xecute" SaveOption="SaveNone" RunFromDir="%rw">' >> "${MY_FILE}"
|
---|
304 | echo ' <Exec/>' >> "${MY_FILE}"
|
---|
305 | echo ' </Target>' >> "${MY_FILE}"
|
---|
306 | echo ' </Menu>' >> "${MY_FILE}"
|
---|
307 |
|
---|
308 | #
|
---|
309 | # Include directories.
|
---|
310 | #
|
---|
311 | echo ' <Includes>' >> "${MY_FILE}"
|
---|
312 | while test $# -ge 1 -a "${1}" != "--end-includes";
|
---|
313 | do
|
---|
314 | for f in $1;
|
---|
315 | do
|
---|
316 | my_abs_dir ${f}
|
---|
317 | echo ' <Include Dir="'"${MY_ABS_DIR}/"'"/>' >> "${MY_FILE}"
|
---|
318 | done
|
---|
319 | shift
|
---|
320 | done
|
---|
321 | shift
|
---|
322 | echo ' </Includes>' >> "${MY_FILE}"
|
---|
323 | echo ' </Config>' >> "${MY_FILE}"
|
---|
324 |
|
---|
325 |
|
---|
326 | #
|
---|
327 | # Process directories+files and create folders.
|
---|
328 | #
|
---|
329 | echo ' <Files>' >> "${MY_FILE}"
|
---|
330 | my_generate_folder "${MY_FILE}" $*
|
---|
331 | echo ' </Files>' >> "${MY_FILE}"
|
---|
332 |
|
---|
333 | #
|
---|
334 | # The tail.
|
---|
335 | #
|
---|
336 | echo '</Project>' >> "${MY_FILE}"
|
---|
337 |
|
---|
338 | return 0
|
---|
339 | }
|
---|
340 |
|
---|
341 |
|
---|
342 | ##
|
---|
343 | # Generate the workspace
|
---|
344 | #
|
---|
345 | my_generate_workspace()
|
---|
346 | {
|
---|
347 | MY_FILE="${MY_WS_NAME}"
|
---|
348 | echo "Generating ${MY_FILE}..."
|
---|
349 | echo '<!DOCTYPE Workspace SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpw.dtd">' > "${MY_FILE}"
|
---|
350 | echo '<Workspace Version="10.0" VendorName="SlickEdit">' >> "${MY_FILE}"
|
---|
351 | echo ' <Projects>' >> "${MY_FILE}"
|
---|
352 | for i in ${MY_PROJECT_FILES};
|
---|
353 | do
|
---|
354 | echo ' <Project File="'"${i}"'" />' >> "${MY_FILE}"
|
---|
355 | done
|
---|
356 | echo ' </Projects>' >> "${MY_FILE}"
|
---|
357 | echo '</Workspace>' >> "${MY_FILE}"
|
---|
358 | return 0;
|
---|
359 | }
|
---|
360 |
|
---|
361 |
|
---|
362 | ###### end of functions ####
|
---|
363 |
|
---|
364 |
|
---|
365 | #
|
---|
366 | # Parse arguments.
|
---|
367 | #
|
---|
368 | while test $# -ge 1;
|
---|
369 | do
|
---|
370 | ARG=$1
|
---|
371 | shift
|
---|
372 | case "$ARG" in
|
---|
373 |
|
---|
374 | --rootdir)
|
---|
375 | if test $# -eq 0; then
|
---|
376 | echo "error: missing --rootdir argument." 1>&2
|
---|
377 | exit 1;
|
---|
378 | fi
|
---|
379 | MY_ROOT_DIR="$1"
|
---|
380 | shift
|
---|
381 | ;;
|
---|
382 |
|
---|
383 | --outdir)
|
---|
384 | if test $# -eq 0; then
|
---|
385 | echo "error: missing --outdir argument." 1>&2
|
---|
386 | exit 1;
|
---|
387 | fi
|
---|
388 | MY_OUT_DIR="$1"
|
---|
389 | shift
|
---|
390 | ;;
|
---|
391 |
|
---|
392 | --project-base)
|
---|
393 | if test $# -eq 0; then
|
---|
394 | echo "error: missing --project-base argument." 1>&2
|
---|
395 | exit 1;
|
---|
396 | fi
|
---|
397 | MY_PRJ_PRF="$1"
|
---|
398 | shift
|
---|
399 | ;;
|
---|
400 |
|
---|
401 | --workspace)
|
---|
402 | if test $# -eq 0; then
|
---|
403 | echo "error: missing --workspace argument." 1>&2
|
---|
404 | exit 1;
|
---|
405 | fi
|
---|
406 | MY_WS_NAME="$1"
|
---|
407 | shift
|
---|
408 | ;;
|
---|
409 |
|
---|
410 | --windows-host)
|
---|
411 | MY_WINDOWS_HOST=1
|
---|
412 | ;;
|
---|
413 |
|
---|
414 | --minimal)
|
---|
415 | MY_OPT_MINIMAL=1
|
---|
416 | ;;
|
---|
417 |
|
---|
418 | # usage
|
---|
419 | --h*|-h*|-?|--?)
|
---|
420 | echo "usage: $0 [--rootdir <rootdir>] [--outdir <outdir>] [--project-base <prefix>] [--workspace <name>] [--minimal]"
|
---|
421 | echo ""
|
---|
422 | echo "If --outdir is specified, you must specify a --rootdir relative to it as well."
|
---|
423 | exit 1;
|
---|
424 | ;;
|
---|
425 |
|
---|
426 | # default
|
---|
427 | *)
|
---|
428 | echo "error: Invalid parameter '$ARG'" 1>&2
|
---|
429 | exit 1;
|
---|
430 |
|
---|
431 | esac
|
---|
432 | done
|
---|
433 |
|
---|
434 |
|
---|
435 | #
|
---|
436 | # From now on everything *MUST* succeed.
|
---|
437 | #
|
---|
438 | set -e
|
---|
439 |
|
---|
440 |
|
---|
441 | #
|
---|
442 | # Make sure the output directory exists, is valid and clean.
|
---|
443 | #
|
---|
444 | ${MY_RM} -f \
|
---|
445 | "${MY_OUT_DIR}/${MY_PRJ_PRF}"*.vpj \
|
---|
446 | "${MY_OUT_DIR}/${MY_WS_NAME}" \
|
---|
447 | "${MY_OUT_DIR}/`echo ${MY_WS_NAME} | ${MY_SED} -e 's/\.vpw$/.vtg/'`"
|
---|
448 | ${MY_MKDIR} -p "${MY_OUT_DIR}"
|
---|
449 | cd "${MY_OUT_DIR}"
|
---|
450 |
|
---|
451 |
|
---|
452 | #
|
---|
453 | # Determine the invocation to conjure up kmk.
|
---|
454 | #
|
---|
455 | my_abs_dir "tools"
|
---|
456 | if test -n "${MY_WINDOWS_HOST}"; then
|
---|
457 | MY_KMK_INVOCATION="${MY_ABS_DIR}/win.x86/bin/rexx.exe ${MY_ABS_DIR}/envSub.cmd kmk.exe"
|
---|
458 | else
|
---|
459 | MY_KMK_INVOCATION="${MY_ABS_DIR}/env.sh --quiet kmk"
|
---|
460 | fi
|
---|
461 |
|
---|
462 |
|
---|
463 | #
|
---|
464 | # Generate the projects and workspace.
|
---|
465 | #
|
---|
466 | # Note! The configs aren't optimal yet, lots of adjustment wrt headers left to be done.
|
---|
467 | #
|
---|
468 |
|
---|
469 | # src/VBox/Runtime
|
---|
470 | my_generate_project "IPRT" "src/VBox/Runtime" --begin-incs "include" "src/VBox/Runtime/include" --end-includes "include/iprt" "src/VBox/Runtime"
|
---|
471 |
|
---|
472 | # src/VBox/VMM
|
---|
473 | my_generate_project "VMM" "src/VBox/VMM" --begin-incs "include" "src/VBox/VMM" --end-includes "src/VBox/VMM" \
|
---|
474 | "include/VBox/vmm/cfgm.h" \
|
---|
475 | "include/VBox/vmm/cpum.*" \
|
---|
476 | "include/VBox/vmm/dbgf.h" \
|
---|
477 | "include/VBox/vmm/em.h" \
|
---|
478 | "include/VBox/vmm/gmm.*" \
|
---|
479 | "include/VBox/vmm/gvm.*" \
|
---|
480 | "include/VBox/vmm/hw*.*" \
|
---|
481 | "include/VBox/vmm/iom.h" \
|
---|
482 | "include/VBox/vmm/mm.h" \
|
---|
483 | "include/VBox/vmm/patm.*" \
|
---|
484 | "include/VBox/vmm/pdm*.h" \
|
---|
485 | "include/VBox/vmm/pgm.*" \
|
---|
486 | "include/VBox/vmm/rem.h" \
|
---|
487 | "include/VBox/vmm/selm.*" \
|
---|
488 | "include/VBox/vmm/ssm.h" \
|
---|
489 | "include/VBox/vmm/stam.*" \
|
---|
490 | "include/VBox/vmm/tm.h" \
|
---|
491 | "include/VBox/vmm/trpm.*" \
|
---|
492 | "include/VBox/vmm/vm.*" \
|
---|
493 | "include/VBox/vmm/vmm.*"
|
---|
494 |
|
---|
495 | # src/recompiler
|
---|
496 | my_generate_project "REM" "src/recompiler" --begin-incs \
|
---|
497 | "include" \
|
---|
498 | "src/recompiler" \
|
---|
499 | "src/recompiler/target-i386" \
|
---|
500 | "src/recompiler/tcg/i386" \
|
---|
501 | "src/recompiler/Sun/crt" \
|
---|
502 | --end-includes \
|
---|
503 | "src/recompiler" \
|
---|
504 | "src/VBox/VMM/REMInternal.h" \
|
---|
505 | "src/VBox/VMM/VMMAll/REMAll.cpp"
|
---|
506 |
|
---|
507 | # src/VBox/Additions
|
---|
508 | my_generate_project "Add-freebsd" "src/VBox/Additions/freebsd" --begin-incs "include" "src/VBox/Additions/freebsd" --end-includes "src/VBox/Additions/freebsd"
|
---|
509 | my_generate_project "Add-linux" "src/VBox/Additions/linux" --begin-incs "include" "src/VBox/Additions/linux" --end-includes "src/VBox/Additions/linux"
|
---|
510 | my_generate_project "Add-os2" "src/VBox/Additions/os2" --begin-incs "include" "src/VBox/Additions/os2" --end-includes "src/VBox/Additions/os2"
|
---|
511 | my_generate_project "Add-solaris" "src/VBox/Additions/solaris" --begin-incs "include" "src/VBox/Additions/solaris" --end-includes "src/VBox/Additions/solaris"
|
---|
512 | my_generate_project "Add-win" "src/VBox/Additions/WINNT" --begin-incs "include" "src/VBox/Additions/WINNT" --end-includes "src/VBox/Additions/WINNT"
|
---|
513 | test -z "$MY_OPT_MINIMAL" && \
|
---|
514 | my_generate_project "Add-x11" "src/VBox/Additions/x11" --begin-incs "include" "src/VBox/Additions/x11" --end-includes "src/VBox/Additions/x11"
|
---|
515 | my_generate_project "Add-Control" "src/VBox/Additions/common/VBoxControl" --begin-incs "include" "src/VBox/Additions/common/VBoxControl" --end-includes "src/VBox/Additions/common/VBoxControl"
|
---|
516 | my_generate_project "Add-GuestDrv" "src/VBox/Additions/common/VBoxGuest" --begin-incs "include" "src/VBox/Additions/common/VBoxGuest" --end-includes "src/VBox/Additions/common/VBoxGuest" "include/VBox/VBoxGuest*.*"
|
---|
517 | my_generate_project "Add-Lib" "src/VBox/Additions/common/VBoxGuestLib" --begin-incs "include" "src/VBox/Additions/common/VBoxGuestLib" --end-includes "src/VBox/Additions/common/VBoxGuestLib" "include/VBox/VBoxGuest*.*"
|
---|
518 | my_generate_project "Add-Service" "src/VBox/Additions/common/VBoxService" --begin-incs "include" "src/VBox/Additions/common/VBoxService" --end-includes "src/VBox/Additions/common/VBoxService"
|
---|
519 | test -z "$MY_OPT_MINIMAL" && \
|
---|
520 | my_generate_project "Add-crOpenGL" "src/VBox/Additions/common/crOpenGL" --begin-incs "include" "src/VBox/Additions/common/crOpenGL" --end-includes "src/VBox/Additions/common/crOpenGL"
|
---|
521 |
|
---|
522 | # src/VBox/Debugger
|
---|
523 | my_generate_project "Debugger" "src/VBox/Debugger" --begin-incs "include" "src/VBox/Debugger" --end-includes "src/VBox/Debugger" "include/VBox/dbggui.h" "include/VBox/dbg.h"
|
---|
524 |
|
---|
525 | # src/VBox/Devices
|
---|
526 | my_generate_project "Devices" "src/VBox/Devices" --begin-incs "include" "src/VBox/Devices" --end-includes "src/VBox/Devices" "include/VBox/pci.h" "include/VBox/pdm*.h"
|
---|
527 | ## @todo split this up.
|
---|
528 |
|
---|
529 | # src/VBox/Disassembler
|
---|
530 | my_generate_project "DIS" "src/VBox/Disassembler" --begin-incs "include" "src/VBox/Disassembler" --end-includes "src/VBox/Disassembler" "include/VBox/dis*.h"
|
---|
531 |
|
---|
532 | # src/VBox/Frontends
|
---|
533 | my_generate_project "FE-VBoxManage" "src/VBox/Frontends/VBoxManage" --begin-incs "include" "src/VBox/Frontends/VBoxManage" --end-includes "src/VBox/Frontends/VBoxManage"
|
---|
534 | my_generate_project "FE-VBoxHeadless" "src/VBox/Frontends/VBoxHeadless" --begin-incs "include" "src/VBox/Frontends/VBoxHeadless" --end-includes "src/VBox/Frontends/VBoxHeadless"
|
---|
535 | my_generate_project "FE-VBoxSDL" "src/VBox/Frontends/VBoxSDL" --begin-incs "include" "src/VBox/Frontends/VBoxSDL" --end-includes "src/VBox/Frontends/VBoxSDL"
|
---|
536 | my_generate_project "FE-VBoxShell" "src/VBox/Frontends/VBoxShell" --begin-incs "include" "src/VBox/Frontends/VBoxShell" --end-includes "src/VBox/Frontends/VBoxShell"
|
---|
537 | # noise - my_generate_project "FE-VBoxBFE" "src/VBox/Frontends/VBoxBFE" --begin-incs "include" "src/VBox/Frontends/VBoxBFE" --end-includes "src/VBox/Frontends/VBoxBFE"
|
---|
538 | FE_VBOX_WRAPPERS=""
|
---|
539 | for d in ${MY_OUT_DIRS};
|
---|
540 | do
|
---|
541 | if test -d "${MY_ROOT_DIR}/${d}/obj/VirtualBox/include"; then
|
---|
542 | FE_VBOX_WRAPPERS="${d}/obj/VirtualBox/include"
|
---|
543 | break
|
---|
544 | fi
|
---|
545 | done
|
---|
546 | if test -n "${FE_VBOX_WRAPPERS}"; then
|
---|
547 | my_generate_project "FE-VirtualBox" "src/VBox/Frontends/VirtualBox" --begin-incs "include" "${FE_VBOX_WRAPPERS}" --end-includes "src/VBox/Frontends/VirtualBox" "${FE_VBOX_WRAPPERS}/COMWrappers.cpp" "${FE_VBOX_WRAPPERS}/COMWrappers.h"
|
---|
548 | else
|
---|
549 | my_generate_project "FE-VirtualBox" "src/VBox/Frontends/VirtualBox" --begin-incs "include" --end-includes "src/VBox/Frontends/VirtualBox"
|
---|
550 | fi
|
---|
551 |
|
---|
552 | # src/VBox/GuestHost
|
---|
553 | my_generate_project "HGSMI-GH" "src/VBox/GuestHost/HGSMI" --begin-incs "include" --end-includes "src/VBox/GuestHost/HGSMI"
|
---|
554 | test -z "$MY_OPT_MINIMAL" && \
|
---|
555 | my_generate_project "OpenGL-GH" "src/VBox/GuestHost/OpenGL" --begin-incs "include" "src/VBox/GuestHost/OpenGL" --end-includes "src/VBox/GuestHost/OpenGL"
|
---|
556 | my_generate_project "ShClip-GH" "src/VBox/GuestHost/SharedClipboard" --begin-incs "include" --end-includes "src/VBox/GuestHost/SharedClipboard"
|
---|
557 |
|
---|
558 | # src/VBox/HostDrivers
|
---|
559 | my_generate_project "SUP" "src/VBox/HostDrivers/Support" --begin-incs "include" "src/VBox/HostDrivers/Support" --end-includes "src/VBox/HostDrivers/Support" "include/VBox/sup.h" "include/VBox/sup.mac"
|
---|
560 | my_generate_project "VBoxNetAdp" "src/VBox/HostDrivers/VBoxNetAdp" --begin-incs "include" "src/VBox/HostDrivers/VBoxNetAdp" --end-includes "src/VBox/HostDrivers/VBoxNetAdp" "include/VBox/intnet.h"
|
---|
561 | my_generate_project "VBoxNetFlt" "src/VBox/HostDrivers/VBoxNetFlt" --begin-incs "include" "src/VBox/HostDrivers/VBoxNetFlt" --end-includes "src/VBox/HostDrivers/VBoxNetFlt" "include/VBox/intnet.h"
|
---|
562 | my_generate_project "VBoxUSB" "src/VBox/HostDrivers/VBoxUSB" --begin-incs "include" "src/VBox/HostDrivers/VBoxUSB" --end-includes "src/VBox/HostDrivers/VBoxUSB" "include/VBox/usblib*.h" "include/VBox/usbfilter.h"
|
---|
563 |
|
---|
564 | # src/VBox/HostServices
|
---|
565 | my_generate_project "GuestProps" "src/VBox/HostServices/GuestProperties" --begin-incs "include" "src/VBox/HostServices/GuestProperties" --end-includes "src/VBox/HostServices/GuestProperties"
|
---|
566 | my_generate_project "ShClip-HS" "src/VBox/HostServices/SharedClipboard" --begin-incs "include" "src/VBox/HostServices/SharedClipboard" --end-includes "src/VBox/HostServices/SharedClipboard"
|
---|
567 | my_generate_project "SharedFolders" "src/VBox/HostServices/SharedFolders" --begin-incs "include" "src/VBox/HostServices/SharedFolders" --end-includes "src/VBox/HostServices/SharedFolders" "include/VBox/shflsvc.h"
|
---|
568 | my_generate_project "OpenGL-HS" "src/VBox/HostServices/SharedOpenGL" --begin-incs "include" "src/VBox/HostServices/SharedOpenGL" --end-includes "src/VBox/HostServices/SharedOpenGL"
|
---|
569 |
|
---|
570 | # src/VBox/ImageMounter
|
---|
571 | my_generate_project "ImageMounter" "src/VBox/ImageMounter" --begin-incs "include" "src/VBox/ImageMounter" --end-includes "src/VBox/ImageMounter"
|
---|
572 |
|
---|
573 | # src/VBox/Installer
|
---|
574 | my_generate_project "Installers" "src/VBox/Installer" --begin-incs "include" --end-includes "src/VBox/Installer"
|
---|
575 |
|
---|
576 | # src/VBox/Main
|
---|
577 | my_generate_project "Main" "src/VBox/Main" --begin-incs "include" "src/VBox/Main/include" --end-includes "src/VBox/Main" "include/VBox/com" "include/VBox/settings.h"
|
---|
578 | ## @todo seperate webservices and Main. pick the right headers. added generated headers.
|
---|
579 |
|
---|
580 | # src/VBox/Network
|
---|
581 | my_generate_project "Net-DHCP" "src/VBox/NetworkServices/DHCP" --begin-incs "include" "src/VBox/NetworkServices/NetLib" --end-includes "src/VBox/NetworkServices/DHCP"
|
---|
582 | my_generate_project "Net-NAT" "src/VBox/NetworkServices/NAT" --begin-incs "include" "src/VBox/NetworkServices/NAT" --end-includes "src/VBox/NetworkServices/NAT" "src/VBox/Devices/Network/slirp"
|
---|
583 | my_generate_project "Net-NetLib" "src/VBox/NetworkServices/NetLib" --begin-incs "include" "src/VBox/NetworkServices/NetLib" --end-includes "src/VBox/NetworkServices/NetLib"
|
---|
584 |
|
---|
585 | # src/VBox/RDP
|
---|
586 | my_generate_project "RDP-Client" "src/VBox/RDP/client" --begin-incs "include" "src/VBox/RDP/client" --end-includes "src/VBox/RDP/client"
|
---|
587 | my_generate_project "RDP-Server" "src/VBox/RDP/server" --begin-incs "include" "src/VBox/RDP/server" --end-includes "src/VBox/RDP/server"
|
---|
588 | my_generate_project "RDP-WebClient" "src/VBox/RDP/webclient" --begin-incs "include" "src/VBox/RDP/webclient" --end-includes "src/VBox/RDP/webclient"
|
---|
589 | my_generate_project "RDP-Misc" "src/VBox/RDP" --begin-incs "include" --end-includes "src/VBox/RDP/auth" "src/VBox/RDP/tscpasswd" "src/VBox/RDP/x11server"
|
---|
590 |
|
---|
591 | # src/VBox/Testsuite
|
---|
592 | my_generate_project "Testsuite" "src/VBox/Testsuite" --begin-incs "include" --end-includes "src/VBox/Testsuite"
|
---|
593 |
|
---|
594 | # src/apps/adpctl - misplaced.
|
---|
595 | my_generate_project "adpctl" "src/apps/adpctl" --begin-incs "include" --end-includes "src/apps/adpctl"
|
---|
596 |
|
---|
597 | # src/bldprogs
|
---|
598 | my_generate_project "bldprogs" "src/bldprogs" --begin-incs "include" --end-includes "src/bldprogs"
|
---|
599 |
|
---|
600 | # A few things from src/lib
|
---|
601 | my_generate_project "zlib" "src/libs/zlib-1.2.1" --begin-incs "include" --end-includes "src/libs/zlib-1.2.1/*.c" "src/libs/zlib-1.2.1/*.h"
|
---|
602 | my_generate_project "liblzf" "src/libs/liblzf-3.4" --begin-incs "include" --end-includes "src/libs/liblzf-3.4"
|
---|
603 | my_generate_project "libpng" "src/libs/libpng-1.2.8" --begin-incs "include" --end-includes "src/libs/libpng-1.2.8/*.c" "src/libs/libpng-1.2.8/*.h"
|
---|
604 | my_generate_project "openssl" "src/libs/openssl-0.9.8p" --begin-incs "include" "src/libs/openssl-0.9.8p/crypto" --end-includes "src/libs/openssl-0.9.8p"
|
---|
605 |
|
---|
606 |
|
---|
607 | # include/VBox
|
---|
608 | my_generate_project "VBoxHeaders" "include" --begin-incs "include" --end-includes "include/VBox"
|
---|
609 |
|
---|
610 | # Misc
|
---|
611 | my_generate_project "misc" "src/testcase" --begin-incs "include" --end-includes \
|
---|
612 | "src/testcase" \
|
---|
613 | "configure" \
|
---|
614 | "configure.vbs" \
|
---|
615 | "Config.kmk" \
|
---|
616 | "Makefile.kmk" \
|
---|
617 | "src/Makefile.kmk" \
|
---|
618 | "src/VBox/Makefile.kmk"
|
---|
619 |
|
---|
620 |
|
---|
621 | # out/x.y/z/bin/sdk/bindings/xpcom
|
---|
622 | XPCOM_INCS="src/libs/xpcom18a4"
|
---|
623 | for d in \
|
---|
624 | "out/${KBUILD_TARGET}.${KBUILD_TARGET_ARCH}/${KBUILD_TYPE}/dist/sdk/bindings/xpcom" \
|
---|
625 | "out/${BUILD_TARGET}.${BUILD_TARGET_ARCH}/${BUILD_TYPE}/dist/sdk/bindings/xpcom" \
|
---|
626 | "out/${KBUILD_TARGET}.${KBUILD_TARGET_ARCH}/${KBUILD_TYPE}/bin/sdk/bindings/xpcom" \
|
---|
627 | "out/${BUILD_TARGET}.${BUILD_TARGET_ARCH}/${BUILD_TYPE}/bin/sdk/bindings/xpcom" \
|
---|
628 | "out/linux.amd64/debug/bin/sdk/bindings/xpcom" \
|
---|
629 | "out/linux.x86/debug/bin/sdk/bindings/xpcom" \
|
---|
630 | "out/darwin.amd64/debug/dist/sdk/bindings/xpcom" \
|
---|
631 | "out/darwin.x86/debug/bin/dist/bindings/xpcom" \
|
---|
632 | "out/solaris.amd64/debug/bin/sdk/bindings/xpcom" \
|
---|
633 | "out/solaris.x86/debug/bin/sdk/bindings/xpcom";
|
---|
634 | do
|
---|
635 | if test -d "${MY_ROOT_DIR}/${d}"; then
|
---|
636 | my_generate_project "SDK-xpcom" "${d}" --begin-incs "include" "${d}/include" --end-includes "${d}"
|
---|
637 | XPCOM_INCS="${d}/include"
|
---|
638 | break
|
---|
639 | fi
|
---|
640 | done
|
---|
641 |
|
---|
642 | # lib/xpcom
|
---|
643 | my_generate_project "xpcom" "src/libs/xpcom18a4" --begin-incs "include" "${XPCOM_INCS}" --end-includes "src/libs/xpcom18a4"
|
---|
644 |
|
---|
645 | my_generate_workspace
|
---|
646 |
|
---|
647 |
|
---|
648 | #
|
---|
649 | # Update the history file if present.
|
---|
650 | #
|
---|
651 | MY_FILE="${MY_WS_NAME}histu"
|
---|
652 | if test -f "${MY_FILE}"; then
|
---|
653 | echo "Updating ${MY_FILE}..."
|
---|
654 | ${MY_MV} -f "${MY_FILE}" "${MY_FILE}.old"
|
---|
655 | ${MY_SED} -n \
|
---|
656 | -e '/PROJECT_CACHE/d' \
|
---|
657 | -e '/\[TreeExpansion2\]/d' \
|
---|
658 | -e '/^\[/p' \
|
---|
659 | -e '/: /p' \
|
---|
660 | -e '/^CurrentProject/p' \
|
---|
661 | "${MY_FILE}.old" > "${MY_FILE}"
|
---|
662 | fi
|
---|
663 |
|
---|
664 | echo "done"
|
---|
665 |
|
---|