There are a lot of existing systems that #include non-existent files. So, to
[asterisk-bristuff.git] / build_tools / prep_moduledeps
blob333e8853e8e5c6e99be71fdd3447891c952852cf
1 #!/bin/sh
3 get_description() {
4 TDESC=`${GREP} -e AST_MODULE_INFO ${1} | head -n 1 | cut -d '"' -f 2`
7 process_dir() {
8 dir=${1}
9 prefix=${2}_
10 catsuffix=${3}
11 displayname=${4}
13 printf "\t<category name=\"MENUSELECT_${catsuffix}\" displayname=\"${displayname}\" remove_on_change=\"${dir}/modules.link\">\n"
14 for file in `ls ${dir}/${prefix}*.c ${dir}/${prefix}*.cc 2> /dev/null | sort`
16 if [ ! -f ${file} ]; then
17 continue
19 fname=`basename ${file} .c`
20 fname=`basename ${fname} .cc`
21 get_description ${file}
22 desc=${TDESC}
23 printf "\t\t<member name=\"${fname}\" displayname=\"${desc}\" remove_on_change=\"${dir}/${fname}.o ${dir}/${fname}.oo ${dir}/${fname}.so\">\n"
24 awk -f build_tools/get_moduleinfo ${file}
25 printf "\t\t</member>\n"
26 awk -f build_tools/get_makeopts ${file} >> .makeoptstmp
27 done
28 printf "\t</category>\n"
31 echo "<?xml version=\"1.0\"?>"
32 echo
33 echo "<menu name=\"Asterisk Module Selection\">"
34 rm -f .makeoptstmp
35 process_dir apps app APPS Applications
36 process_dir cdr cdr CDR "Call Detail Recording"
37 process_dir channels chan CHANNELS "Channel Drivers"
38 process_dir codecs codec CODECS "Codec Translators"
39 process_dir formats format FORMATS "Format Interpreters"
40 process_dir funcs func FUNCS "Dialplan Functions"
41 process_dir pbx pbx PBX "PBX Modules"
42 process_dir res res RES "Resource Modules"
43 cat .makeoptstmp
44 cat build_tools/cflags.xml
45 cat build_tools/embed_modules.xml
46 cat sounds/sounds.xml
47 rm -f .makeoptstmp
48 echo "</menu>"