From a098dc6474e9b093ad86dd6357e77c76ad1e6dfd Mon Sep 17 00:00:00 2001 From: drjaska Date: Thu, 22 Aug 2024 08:34:30 +0300 Subject: [PATCH] Fix a comment and add several more --- qcsrc/tools/genmod.sh | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/qcsrc/tools/genmod.sh b/qcsrc/tools/genmod.sh index 142ca8287..4a6cfdc8c 100755 --- a/qcsrc/tools/genmod.sh +++ b/qcsrc/tools/genmod.sh @@ -40,22 +40,37 @@ function genmod() { # Dr. Jaska: find without some configuration would prefix everything with ./ which is likely unwanted for f in $(ls | sed -e "s/^cl_//" -e "s/^sv_//" -e "s/^ui_//" | sort -u) do - # skip .qc files + # skip all files which aren't .qc files if [[ "$f" != *.qc ]]; then continue; fi - # #include <"$1"> + # Print the following line: + # + # #include + # + # file.qc into _mod.inc + # file.qh into _mod.qh if [[ -f "$f" ]]; then printf "#include <%s>\n" "${CTX}$f" >> ${MOD}.inc; fi if [[ -f "${f%.qc}.qh" ]]; then printf "#include <%s>\n" "${CTX}${f%.qc}.qh" >> ${MOD}.qh; fi # Print the following template: # - # #ifdef "$1" - # #include <"$2"> + # #ifdef {CS,SV,MENU}QC + # #include # #endif + # + # CSQC + # cl_file.qc into _mod.inc + # cl_file.qh into _mod.qh if [[ -f "cl_$f" ]]; then printf "#ifdef %s\n\t#include <%s>\n#endif\n" CSQC "${CTX}cl_$f" >> ${MOD}.inc; fi if [[ -f "cl_${f%.qc}.qh" ]]; then printf "#ifdef %s\n\t#include <%s>\n#endif\n" CSQC "${CTX}cl_${f%.qc}.qh" >> ${MOD}.qh; fi + # SVQC + # cl_file.qc into _mod.inc + # cl_file.qh into _mod.qh if [[ -f "sv_$f" ]]; then printf "#ifdef %s\n\t#include <%s>\n#endif\n" SVQC "${CTX}sv_$f" >> ${MOD}.inc; fi if [[ -f "sv_${f%.qc}.qh" ]]; then printf "#ifdef %s\n\t#include <%s>\n#endif\n" SVQC "${CTX}sv_${f%.qc}.qh" >> ${MOD}.qh; fi + # MENUQC + # cl_file.qc into _mod.inc + # cl_file.qh into _mod.qh if [[ -f "ui_$f" ]]; then printf "#ifdef %s\n\t#include <%s>\n#endif\n" MENUQC "${CTX}ui_$f" >> ${MOD}.inc; fi if [[ -f "ui_${f%.qc}.qh" ]]; then printf "#ifdef %s\n\t#include <%s>\n#endif\n" MENUQC "${CTX}ui_${f%.qc}.qh" >> ${MOD}.qh; fi done -- 2.39.2