4 declare -g -A LANG_EXT_NAME
20 # build sub-cmd map to step.
33 STEP_SRC="STEP_BUILD_DEST"
47 ###########################################################
49 ##########################################################
62 # steps before dest-constructing.
63 STEP_TOOLCHAIN_CHK="toolchain_chk()"
64 STEP_DEV_ENV_CHK="dev_env_chk()"
65 STEP_DEP_LIB_CHK="dep_lib_chk()"
66 STEP_DEP_SYSHDR_CHK="dep_syshdr_chk()"
68 STEP_CONFIG_GEN="config_gen()"
69 STEP_VERSION_GEN="version_gen()"
72 ###########################################################
73 # main compile build step
74 ###########################################################
78 # @ append second parameter with item in first list.
82 STEP_ONE_DEST_INIT="step_one_dest_init()"
83 STEP_BUILD_ONE_DEST="step_build_one_dest()"
84 # STEP_CONSTRUCT_INIT="construct_init()"
85 STEP_HOSTUTILS_LN2HOST="step_hostutils_ln2host()"
86 STEP_HOSTUTILS_PREV_INIT="step_hostutils_prev_init()"
87 STEP_HOSTUTILS_POST_INIT="step_hostutils_post_init()"
91 STEP_PRI_PREV_CONSTRUCT
92 TASKLIST(DEST_LIST_Y, STEP_BUILD_ONE_DEST)
93 STEP_PRI_POST_CONSTRUCT"
96 STEP_ONE_DEST_INIT(DEST_NAME)
97 STEP_PRI_PREV_DEST_BUILD
98 # STEP_DEST_CHK(DEST_NAME)
99 TASKLIST(LANG_LIST_Y, STEP_LANG_SRC_TPCHK)
100 TASKLIST(LANG_LIST_Y, STEP_LANG_CMPL)
101 STEP_LINK(OBJ_LIST, DEST_FILENAME)
102 # put this step into STEP_LINK
103 # STEP_PROGINFO(DEBUG)
104 STEP_PRI_POST_DEST_BUILD"
106 # TBD: append corresponding dest steps,
107 # some of them need STRIP in non DEBUG version.
111 # STEP_OBJLIST2SRCLIST=objlist2srclist
113 STEP_EXE_DEST="STEP_DEFAULT_DEST
115 STEP_DLL_DEST="STEP_DEFAULT_DEST
117 STEP_LIB_DEST="STEP_DEFAULT_DEST"
118 STEP_LIBDLL_DEST="STEP_DEFAULT_DEST"
119 STEP_DRV_DEST="STEP_DEFAULT_DEST
121 STEP_LA_DEST="STEP_DEFAULT_DEST"
122 STEP_LO_DEST="STEP_DEFAULT_DEST"
123 STEP_OBJ_DEST="STEP_DEFAULT_DEST"
126 STEP_ONE_DEST_INIT(DEST_NAME)
127 STEP_PRI_PREV_DEST_BUILD
128 TASKLIST(LANG_LIST_Y, STEP_LANG_SRC_TPCHK)
129 TASKLIST(LANG_LIST_Y, STEP_LANG_CMPL)
130 STEP_LINK(OBJ_LIST, DEST_FILENAME)
131 TASKLIST(LANG_LIST_Y, STEP_LANG_SRC2UNITSRC)
132 TASKLIST(LANG_LIST_Y, STEP_LANG_SRC_TPCHK)
133 TASKLIST(LANG_LIST_Y, STEP_LANG_CMPL)
134 STEP_LINK(OBJ_LIST, DEST_FILENAME)
135 # TASKLIST(LANG_LIST_Y, STEP_STRIP(DEBUG))
136 STEP_PRI_POST_DEST_BUILD"
140 TASKLIST(LANG_LIST_Y, STEP_LANG_CMPL)"
143 STEP_ONE_DEST_INIT(DEST_NAME)
144 STEP_PRI_PREV_DEST_BUILD
145 # TASKLIST(LANG_LIST_Y, STEP_LANG_SRC_TPCHK)
146 TASKLIST(LANG_LIST_Y, STEP_LANG_SRC2EXE)
147 # TASKLIST(LANG_LIST_Y, STEP_STRIP(DEBUG))
148 STEP_PRI_POST_DEST_BUILD"
150 STEP_HOSTUTILS_DEST="
151 STEP_ONE_DEST_INIT(DEST_NAME)
152 STEP_PRI_PREV_DEST_BUILD
153 STEP_HOSTUTILS_PREV_INIT
154 # TASKLIST(LANG_LIST_Y, STEP_LANG_SRC_TPCHK)
155 TASKLIST(LANG_LIST_Y, STEP_LANG_SRC2EXE)
156 # TASKLIST(LANG_LIST_Y, STEP_STRIP(DEBUG))
157 # STEP_HOSTUTILS_LN2HOST
158 STEP_HOSTUTILS_POST_INIT
159 STEP_PRI_POST_DEST_BUILD"
162 STEP_HEX_DEST="STEP_DEFAULT_DEST STEP_EXE2HEX"
163 STEP_BIN_DEST="STEP_DEFAULT_DEST STEP_EXE2BIN"
166 ###########################################################
168 ###########################################################
170 # TBD: have not been implemented.
172 TASKLIST(HELPER_DOC_LIST, STEP_DOC_BUILD)
173 TASKLIST(UMDOC_LIST, STEP_DOC_BUILD)
174 TASKLIST(WEBDOC_LIST, STEP_DOC_BUILD)"
177 ###########################################################
179 ###########################################################
181 TASKLIST="step_tasklist()"
182 STEP_STRIP="progstrip()"
183 STEP_PROGINFO="prog_sizeinfo()"
185 STEP_LANG_SRC_TPCHK="step_lang_src_tpchk()"
186 STEP_LANG_CMPL="step_one_lang_cmpl()"
188 STEP_LANG_SRC2EXE="step_lang_src2exe()"
189 STEP_LANG_SRC2UNITSRC="step_lang_src2unitsrc()"
192 ###############################################
197 # dest names are named as "exe/dll/lib/drv", it'scan
198 # the short name of output file, it doesn't means
199 # that it uses windows sytle name. if it use 'elf' for
200 # a executable file, it's not general in various env.
203 # C_SRC_LIST defined in .list file
204 STEP_C_LANG_CMPL="TASKLIST(C_SRC_CMPL_LIST, STEP_C_SRC_CMPL)"
212 # CXX_SRC_LIST defined in .list file
213 STEP_CXX_LANG_CMPL="TASKLIST(CXX_SRC_CMPL_LIST, STEP_CXX_SRC_CMPL)"
221 # CPP_SRC_LIST defined in .list file
222 STEP_CPP_LANG_CMPL="TASKLIST(CPP_SRC_CMPL_LIST, STEP_CPP_SRC_CMPL)"
230 # ASM_SRC_LIST defined in .list file
231 STEP_ASM_LANG_CMPL="TASKLIST(ASM_SRC_CMPL_LIST, STEP_ASM_SRC_CMPL)"
239 # SH_SRC_LIST defined in .list file
240 STEP_SH_LANG_CMPL="TASKLIST(SH_SRC_CMPL_LIST, STEP_SH_SRC_CMPL)"
248 ###############################################
252 # C_SRC_FILE_LIST_Y defined in .list file
253 STEP_C_LANG_SRC2EXE="TASKLIST(C_SRC_FILE_LIST_Y, STEP_C_SRC2EXE)"
263 # CXX_SRC_FILE_LIST_Y defined in .list file
264 STEP_CXX_LANG_SRC2EXE="TASKLIST(CXX_SRC_FILE_LIST_Y, STEP_CXX_SRC2EXE)"
274 # CPP_SRC_FILE_LIST_Y defined in .list file
275 STEP_CPP_LANG_SRC2EXE="TASKLIST(CPP_SRC_FILE_LIST_Y, STEP_CPP_SRC2EXE)"
285 # ASM_SRC_FILE_LIST_Y defined in .list file
286 STEP_ASM_LANG_SRC2EXE="TASKLIST(ASM_SRC_FILE_LIST_Y, STEP_ASM_SRC2EXE)"
296 # SH_SRC_FILE_LIST_Y defined in .list file
297 STEP_SH_LANG_SRC2EXE="TASKLIST(SH_SRC_FILE_LIST_Y, STEP_SH_SRC2EXE)"
307 ###############################################
312 STEP_LINK="step_link()"
314 # build steps below is setted accroding DEST_TYPE in dest.imi
343 STEP_UNITLIBDLL_LINK="
389 ###############################################
391 # those proc functions are defined in <srcpkg>.shlib,
392 # it's a privaate function for a srcpkg.
395 # private steps in a dest-constructing.
396 STEP_PRI_PREV_CONSTRUCT="on_prev_construct()"
397 STEP_PRI_POST_CONSTRUCT="on_post_construct()"
398 STEP_PRI_PREV_DEST_BUILD="on_prev_dest_build()"
399 STEP_PRI_POST_DEST_BUILD="on_post_dest_build()"
400 STEP_PRI_PREV_CMPL="on_prev_cmpl()"
401 STEP_PRI_POST_CMPL="on_post_cmpl()"
402 STEP_PRI_PREV_LINK="on_prev_link()"
403 STEP_PRI_POST_LINK="on_post_link()"
404 STEP_PRI_PREV_INSTPKG_GEN="on_prev_instpkg_gen()"
405 STEP_PRI_POST_INSTPKG_GEN="on_post_instpkg_gen()"
406 STEP_PRI_PREV_ARCH_BUILD="on_prev_arch_build()"
407 STEP_PRI_POST_ARCH_BUILD="on_post_arch_build()"
410 #################################################################
415 "[STEP_TEX_2_MAN STEP_TEX_2_TXT STEP_TEX_2_PDF STEP_TEX_2_HTML STEP_MD_2_HTML STEP_HTML_2_CHM ]"
443 STEP_DOC_GEN="TASKLIST(GEN_DOC_TYPE_LIST, doc_gen())"
445 STEP_INFO_2_MAN="info_2_man()"
446 STEP_INFO_2_HTML="info_2_html()"
447 STEP_INFO_2_PDF="info_2_pdf()"
448 STEP_TEX_2_MAN="tex_2_man()"
449 STEP_TEX_2_INFO="tex_2_info()"
450 STEP_TEX_2_TXT="tex_2_txt()"
451 STEP_TEX_2_PDF="tex_2_pdf()"
452 STEP_TEX_2_HTML="tex_2_html()"
453 STEP_TEX_2_DVI="tex_2_dvi()"
454 STEP_TEX_2_DOCBOOK="tex_2_docbook()"
455 STEP_DOCBOOK_2_TXT="docbook_2_txt()"
456 STEP_DOCBOOK_2_PDF="docbook_2_pdf()"
457 STEP_DOCBOOK_2_HTML="docbook_2_html()"
458 STEP_DOCBOOK_2_DVI="docbook_2_dvi()"
460 STEP_MD_2_HTML="md2html()"
461 STEP_RST_2_HTML="rst2html()"
462 STEP_HTML_2_CHM="html2chm()"
465 STEP_APIDOC_GEN="apidocgen()"
466 STEP_GRAPHVIZE_GEN="graphvize()"
468 #################################################################
471 STEP_INTL_GEN="intl()"
496 ###############################################
498 # hdrtpchk() is included in tpchk().
499 # this step decrease files to be compiled.
500 # in compile step, it will run tpchk() and hdrtpchk()
504 # <LANG>_SRC_FILE_LIST_Y defined in .list file
505 STEP_C_LANG_SRC_TPCHK="c_lang_src_tpchk()"
506 STEP_CXX_LANG_SRC_TPCHK="cxx_lang_src_tpchk()"
507 STEP_CPP_LANG_SRC_TPCHK="cpp_lang_src_tpchk()"
508 STEP_ASM_LANG_SRC_TPCHK="asm_lang_src_tpchk()"
509 STEP_SH_LANG_SRC_TPCHK="sh_lang_src_tpchk()"