first version.
[build-srcpkg.git] / bushcmpl.sh
blob87c9c0aec8dac452079be5165c6318d0d2934496
2 . tools/build-srcpkg/shlib/incfile.shlib
4 # TBD: write value in tmp, it should be generated by _EVL
5 SRCPKG_DIR_FULL=$PWD
7 #loadimi ${SRCPKG_DIR_FULL}/tools/build-srcpkg/info/SrcPkgDirs.imi
8 loadimi tools/build-srcpkg/info/SrcPkgDirs.imi
10 inc tools/build-srcpkg/shlib/worklist.shlib
12 inc tools/build-srcpkg/shlib/cmdline.shlib
13 #inc build/shlib/pre_build.shlib
16 SRCBAK_DIR="../dvar-n-doc/$(date +%Y-%m)"
18 scriptversion=v0.1.0-231025
19 version="build.sh $scriptversion
21 Copyright 2020 Free Software Foundation, Inc.
22 There is NO warranty. You may redistribute this software
23 under the terms of the GNU General Public License.
24 For more information about these matters, see the files named COPYING."
26 usage="Usage: $prog [OPTION]
28 It's a file of compile.
29 https://repo.or.cz/devutils.git
31 Options:
32 -f force to re-compile again even if code is compiled before.
33 -v version info.
34 -h help info.
36 sub-cmd:
37 clean clean output files.
38 bak clean and backup a tarball in the upper dir.
40 --help display help info in detail.
41 --version display version information in detail.
43 Simple example:
44 $ $prog -f
45 $ $prog
46 $ $prog clean
47 $ $prog bak
49 Email bug reports or enhancement requests to skeletone@126.com .
52 cmd_opt "$@"
55 # ***********************************************************
56 # * *
57 # * GNU bush, version 5.1.0(1)-release (i686-pc-linux-gnu) *
58 # * *
59 # ***********************************************************
63 ###############################################################################
64 # compile dir of 'src'.
65 ###############################################################################
67 # export OUTDIR=build/output
68 # export DEST_TYPE=exe
69 # export DEST_NAME=bush
71 ################################################
72 # for single exe build by dest func.
73 ################################################
74 if false; then
76 build_dest_dbg ()
78 DEST_NAME=$1
79 # for parameters loading ...
80 one_dest_init $1
81 echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxx ${DEST_NAME[0]}
82 echo OUTDIR=$OUTDIR
83 echo OBJDIR=$OBJDIR
85 # dirbuild "$@"
86 compile C $1
87 # srclist
88 DST_LIST="FixedAlloc_test"
89 link
90 # staticlib
91 # dynamiclib
92 # link > link.txt 2>&1
95 # dbgout_opt=inc_info,inc_dbgout
96 build_dest_dbg libSQLTGA
98 aaa ()
100 # c2o src/general.c
101 c2o ./src/version.c
102 c2o ./support/bushversion.c
103 SRC_FILE=( $CMPL_OBJ_LIST )
104 echo SRC_FILE=${SRC_FILE[@]}
106 o2exe "" $DEST_NAME
109 exit
113 ################################################
114 # for single exe build by func in cmpl.sh.
115 ################################################
116 if false; then
118 # DEST_NAME=libSQLTGA
120 # verbose_mode=y
122 # dbgout_switch+=" buildstep"
123 # dbgout_switch+=" tasklist"
125 # dbgout_switch+=" taskstep"
126 # dbgout_switch+=" taskfunc"
128 construct_init
129 # echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxx DEST_NAME=${DEST_NAME[0]}
131 TASK_RUNNING "STEP_EXELIST_DEST" hostutils
132 [[ $? == 2 ]] && exit
134 # TASK_RUNNING "STEP_LIBDLL_DEST" libSQLTGA
135 TASK_RUNNING "STEP_UNITLIB_DEST" libSQLTGA
136 [[ $? == 2 ]] && exit
137 TASK_RUNNING "STEP_EXELIST_DEST" SQLTGATester
138 [[ $? == 2 ]] && exit
139 TASK_RUNNING "STEP_DEFAULT_DEST" liblanguage
140 [[ $? == 2 ]] && exit
141 TASK_RUNNING "STEP_DEFAULT_DEST" libreglxgmr
142 [[ $? == 2 ]] && exit
144 TASK_RUNNING "STEP_DEFAULT_DEST" reglxgmr
145 [[ $? == 2 ]] && exit
147 exit
152 ################################################
153 # for single exe build by func in cmpl.sh.
154 ################################################
155 if false; then
157 construct_init
158 echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxx ${DEST_NAME[0]}
160 TASK_RUNNING "STEP_BUILD_DEST"
162 exit
167 ################################################
168 # for single exe build by func in cmpl.sh.
169 ################################################
170 if false; then
172 build_proc
174 exit
179 ################################################
180 # for single exe build by func in cmpl.sh.
181 ################################################
182 if false; then
184 one_dest_init hostutils
185 echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxx ${DEST_NAME[0]}
187 dest_cmpl hostutils
188 link
190 # build_dest hostutils
192 exit
213 ################################################
214 # for cross compiler info testing.
215 ################################################
216 if false; then
218 # ARCH/OS/VENDOR/CROSS
219 # TARGET_ARCH/TARGET_OS/TARGET_VENDOR/TARGET_CROSS
220 # BUILD_ARCH/BUILD_OS/BUILD_VENDOR/BUILD_CROSS
221 # HOST_ARCH/HOST_OS/HOST_VENDOR/HOST_CROSS
224 # for testing:
226 # TARGET_MACHINE=arm TARGET_OS=linux TARGET_VENDOR=gnueabi ./bushcmpl.sh
227 # BUILD_MACHINE=arm BUILD_OS=linux BUILD_VENDOR=gnueabi ./bushcmpl.sh
228 # HOST_MACHINE=arm HOST_OS=linux HOST_VENDOR=gnueabi ./bushcmpl.sh
230 echo CC=$CC
232 set_cmplr TARGET
233 echo TARGET_CC=$CC
235 set_cmplr BUILD
236 echo BUILD_CC=$CC
238 set_cmplr HOST
239 echo HOST_CC=$CC
241 echo CC=$CC
243 exit
247 ################################################
248 # for init load testing
250 # text below shows the info with indent in curr code.
252 # loadimi (/mnt/hgfs/workspace/tmp/srcpkg/bush/tools/build-srcpkg/info/SrcPkgDirs.imi)
253 # loadimi (/mnt/hgfs/workspace/tmp/srcpkg/bush/build/toolchain-cfg.imi)
254 # loadimi (/mnt/hgfs/workspace/tmp/srcpkg/bush/tools/build-srcpkg/platform/toolchain_info.imi)
255 # inc (host_info.imi)
256 # inc (platform.imi)
257 # inc (toolchain/NULL.imi)
258 # inc (toolchain/gcc.imi)
259 # inc (build_info.imi)
260 # inc (platform.imi)
261 # inc (toolchain/NULL.imi)
262 # inc (toolchain/gcc.imi)
263 # inc (target_info.imi)
264 # inc (platform.imi)
265 # inc (toolchain/NULL.imi)
266 # inc (toolchain/gcc.imi)
267 # loadimi (./build/dest/dest-general/ARFLAGS.imi)
268 # loadlist (./build/dest/dest-general/CFLAGS-DEF.list)
269 # loadlist (./build/dest/dest-general/CFLAGS-INCPATH.list)
270 # loadimi (./build/dest/dest-general/CFLAGS.imi)
271 # loadlist (./build/dest/dest-general/dep-pkg.list)
272 # loadlist (./build/dest/dest-general/LDFLAGS-LIB.list)
273 # loadlist (./build/dest/dest-general/LDFLAGS-LIBPATH.list)
274 # loadimi (./build/dest/dest-general/LDFLAGS.imi)
275 # loadimi (./build/dest/dest-general/paramters.imi)
276 # loadimi (./build/dest/dest-hostutils/dest.imi)
277 # inc (/mnt/hgfs/workspace/tmp/srcpkg/bush/tools/build-srcpkg/info/extname.imi)
278 ################################################
279 if false; then
282 # add dbgout option.
283 # it will show the inc/loadimi/loadlist info below.
285 dbgout_opt+=,inc_info
287 # for parameters loading ...
288 one_dest_init hostutils
289 echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxx ${DEST_NAME[0]}
291 echo OUTDIR=$OUTDIR
293 exit
297 ################################################
298 # for single exe build by cmd/func in toolchain.shlib.
299 ################################################
300 if false; then
302 # build_init
304 # for parameters loading ...
305 one_dest_init hostutils
306 echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxx ${DEST_NAME[0]}
308 echo OUTDIR=$OUTDIR
310 # c2o src/general.c
311 c2o ./src/version.c
312 c2o ./support/bushversion.c
313 SRC_FILE=( $CMPL_OBJ_LIST )
314 echo SRC_FILE=${SRC_FILE[@]}
316 o2exe "" $DEST_NAME
318 exit
322 ################################################
323 # for toolchain path info testing.
324 ################################################
325 if false; then
327 echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
328 echo "testing get_toolchain_info() ..."
329 get_toolchain_info
331 echo "===== get include path ====="
332 echo INC_PATHS:
333 echo ${INC_PATHS[@]}
335 echo "===== get lib path ====="
336 echo LIB_PATHS:
337 echo ${LIB_PATHS[@]}
339 echo "===== get libs ====="
340 echo LINKED_LIBS:
341 echo ${LINKED_LIBS[@]}
343 exit
347 ################################################
348 # for all dest build by func in cmpl.sh.
349 ################################################
350 if false; then
352 build_proc "$@"
354 exit