improve of cmpl.
[bush.git] / bushcmpl.sh
blob7c54b0b2ea0976991f2e157858f7f9aca28a0117
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 # include tools/build-srcpkg/shlib/build.imi
11 inc tools/build-srcpkg/shlib/cmplib.shlib
12 #inc build/shlib/pre_build.shlib
14 SRCBAK_DIR="../../dvar-n-doc/$(date +%Y-%m)"
16 scriptversion=v0.1.0-231025
17 version="build.sh $scriptversion
19 Copyright 2020 Free Software Foundation, Inc.
20 There is NO warranty. You may redistribute this software
21 under the terms of the GNU General Public License.
22 For more information about these matters, see the files named COPYING."
24 usage="Usage: $prog [OPTION]
26 It's a file of compile.
27 https://repo.or.cz/devutils.git
29 Options:
30 -f force to re-compile again even if code is compiled before.
31 -v version info.
32 -h help info.
34 sub-cmd:
35 clean clean output files.
36 bak clean and backup a tarball in the upper dir.
38 --help display help info in detail.
39 --version display version information in detail.
41 Simple example:
42 $ $prog -f
43 $ $prog
44 $ $prog clean
45 $ $prog bak
47 Email bug reports or enhancement requests to skeletone@126.com .
50 cmd_opt "$@"
53 # ***********************************************************
54 # * *
55 # * GNU bush, version 5.1.0(1)-release (i686-pc-linux-gnu) *
56 # * *
57 # ***********************************************************
61 ###############################################################################
62 # compile dir of 'src'.
63 ###############################################################################
65 export OUTDIR=build/output
66 export DEST_TYPE=exe
67 export DEST_NAME=bush
69 ################################################
70 # for cross compiler info testing.
71 ################################################
72 if false; then
74 # ARCH/OS/VENDOR/CROSS
75 # TARGET_ARCH/TARGET_OS/TARGET_VENDOR/TARGET_CROSS
76 # BUILD_ARCH/BUILD_OS/BUILD_VENDOR/BUILD_CROSS
77 # HOST_ARCH/HOST_OS/HOST_VENDOR/HOST_CROSS
80 # for testing:
82 # TARGET_MACHINE=arm TARGET_OS=linux TARGET_VENDOR=gnueabi ./bushcmpl.sh
83 # BUILD_MACHINE=arm BUILD_OS=linux BUILD_VENDOR=gnueabi ./bushcmpl.sh
84 # HOST_MACHINE=arm HOST_OS=linux HOST_VENDOR=gnueabi ./bushcmpl.sh
86 echo CC=$CC
88 set_cmplr TARGET
89 echo TARGET_CC=$CC
91 set_cmplr BUILD
92 echo BUILD_CC=$CC
94 set_cmplr HOST
95 echo HOST_CC=$CC
97 echo CC=$CC
99 exit
103 ################################################
104 # for init load testing
106 # text below shows the info with indent in curr code.
108 # loadimi (/mnt/hgfs/workspace/tmp/srcpkg/bush/tools/build-srcpkg/info/SrcPkgDirs.imi)
109 # loadimi (/mnt/hgfs/workspace/tmp/srcpkg/bush/build/toolchain-cfg.imi)
110 # loadimi (/mnt/hgfs/workspace/tmp/srcpkg/bush/tools/build-srcpkg/platform/toolchain_info.imi)
111 # inc (host_info.imi)
112 # inc (platform.imi)
113 # inc (toolchain/NULL.imi)
114 # inc (toolchain/gcc.imi)
115 # inc (build_info.imi)
116 # inc (platform.imi)
117 # inc (toolchain/NULL.imi)
118 # inc (toolchain/gcc.imi)
119 # inc (target_info.imi)
120 # inc (platform.imi)
121 # inc (toolchain/NULL.imi)
122 # inc (toolchain/gcc.imi)
123 # loadimi (./build/dest/dest-general/ARFLAGS.imi)
124 # loadlist (./build/dest/dest-general/CFLAGS-DEF.list)
125 # loadlist (./build/dest/dest-general/CFLAGS-INCPATH.list)
126 # loadimi (./build/dest/dest-general/CFLAGS.imi)
127 # loadlist (./build/dest/dest-general/dep-pkg.list)
128 # loadlist (./build/dest/dest-general/LDFLAGS-LIB.list)
129 # loadlist (./build/dest/dest-general/LDFLAGS-LIBPATH.list)
130 # loadimi (./build/dest/dest-general/LDFLAGS.imi)
131 # loadimi (./build/dest/dest-general/paramters.imi)
132 # loadimi (./build/dest/dest-hostutils/dest.imi)
133 # inc (/mnt/hgfs/workspace/tmp/srcpkg/bush/tools/build-srcpkg/info/extname.imi)
134 ################################################
135 if false; then
138 # add dbgout option.
139 # it will show the inc/loadimi/loadlist info below.
141 dbgout_opt+=,inc_info
143 # for parameters loading ...
144 one_dest_init hostutils
145 echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxx ${DEST_NAME[0]}
147 echo OUTDIR=$OUTDIR
149 exit
153 ################################################
154 # for single exe build by cmd/func in toolchain.shlib.
155 ################################################
156 if true; then
158 # build_init
160 # for parameters loading ...
161 one_dest_init hostutils
162 echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxx ${DEST_NAME[0]}
164 echo OUTDIR=$OUTDIR
166 # c2o src/general.c
167 c2o ./src/version.c
168 c2o ./support/bushversion.c
169 SRC_FILE=( $CMPL_OBJ_LIST )
170 echo SRC_FILE=${SRC_FILE[@]}
172 o2exe "" $DEST_NAME
174 exit
178 ################################################
179 # for toolchain path info testing.
180 ################################################
181 if false; then
183 echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
184 echo "testing get_toolchain_info() ..."
185 get_toolchain_info
187 echo "===== get include path ====="
188 echo INC_PATHS:
189 echo ${INC_PATHS[@]}
191 echo "===== get lib path ====="
192 echo LIB_PATHS:
193 echo ${LIB_PATHS[@]}
195 echo "===== get libs ====="
196 echo LINKED_LIBS:
197 echo ${LINKED_LIBS[@]}
199 exit
203 ################################################
204 # for single exe build by dest func.
205 ################################################
206 if false; then
208 build_dest_dbg ()
210 # src_param_init
211 build_init
212 update_param
213 # srclist
214 dirbuild "$@"
215 compile
216 link
217 # link > link.txt 2>&1
220 build_dest_dbg
222 exit
226 ################################################
227 # for single exe build by func in cmpl.sh.
228 ################################################
229 if true; then
231 one_dest_init hostutils
232 echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxx ${DEST_NAME[0]}
234 multiple_dest hostutils
235 link
237 # build_dest hostutils
239 exit
243 ################################################
244 # for all dest build by func in cmpl.sh.
245 ################################################
246 if false; then
248 build_proc "$@"
250 exit