14 # use context to work around cmake issue #12619
16 oldHashC=$(hash ${MOD}.inc)
17 oldTimeC=$(stat -c "%Y" ${MOD}.inc)
18 oldHashH=$(hash ${MOD}.qh)
19 oldTimeH=$(stat -c "%Y" ${MOD}.qh)
20 echo '// generated file; do not modify' > ${MOD}.inc
21 echo '// generated file; do not modify' > ${MOD}.qh
22 for f in $(ls | sort -k 1,1 -t .); do
23 if [[ "$f" == cl_* ]]; then f="${f#cl_}"; if [[ -f "$f" ]]; then continue; fi
24 elif [[ "$f" == sv_* ]]; then f="${f#sv_}"; if [[ -f "$f" ]]; then continue; fi
25 elif [[ "$f" == ui_* ]]; then f="${f#ui_}"; if [[ -f "$f" ]]; then continue; fi
27 if [[ "$f" == *.qc ]]; then
28 if [[ -f "$f" ]]; then echo -e "#include <${CTX}$f>" >> ${MOD}.inc; fi
29 if [[ -f "${f%.qc}.qh" ]]; then echo -e "#include <${CTX}${f%.qc}.qh>" >> ${MOD}.qh; fi
30 if [[ -f "cl_$f" ]]; then echo -e "#ifdef CSQC\n #include <${CTX}cl_$f>\n#endif" >> ${MOD}.inc; fi
31 if [[ -f "cl_${f%.qc}.qh" ]]; then echo -e "#ifdef CSQC\n #include <${CTX}cl_${f%.qc}.qh>\n#endif" >> ${MOD}.qh; fi
32 if [[ -f "sv_$f" ]]; then echo -e "#ifdef SVQC\n #include <${CTX}sv_$f>\n#endif" >> ${MOD}.inc; fi
33 if [[ -f "sv_${f%.qc}.qh" ]]; then echo -e "#ifdef SVQC\n #include <${CTX}sv_${f%.qc}.qh>\n#endif" >> ${MOD}.qh; fi
34 if [[ -f "ui_$f" ]]; then echo -e "#ifdef MENUQC\n #include <${CTX}ui_$f>\n#endif" >> ${MOD}.inc; fi
35 if [[ -f "ui_${f%.qc}.qh" ]]; then echo -e "#ifdef MENUQC\n #include <${CTX}ui_${f%.qc}.qh>\n#endif" >> ${MOD}.qh; fi
39 if [[ -f "_all.inc" ]]; then rec=0; fi
40 for f in *; do if [ -d "$f" ]; then
41 (cd -- "$f" && genmod)
42 if [[ $rec == 1 ]]; then
47 if [[ $rec != 0 ]]; then
49 if [[ -f "$f/_all.inc" ]]; then mod=_all; fi
50 echo "#include <${CTX}$f/${mod}.inc>" >> ${MOD}.inc
51 echo "#include <${CTX}$f/${mod}.qh>" >> ${MOD}.qh
54 newHashC=$(hash ${MOD}.inc)
55 if [[ $newHashC == $oldHashC ]]; then touch -d @$oldTimeC ${MOD}.inc; fi
56 newHashH=$(hash ${MOD}.qh)
57 if [[ $newHashH == $oldHashH ]]; then touch -d @$oldTimeH ${MOD}.qh; fi