]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix a comment and add several more
authordrjaska <drjaska83@gmail.com>
Thu, 22 Aug 2024 05:34:30 +0000 (08:34 +0300)
committerdrjaska <drjaska83@gmail.com>
Thu, 22 Aug 2024 05:34:30 +0000 (08:34 +0300)
qcsrc/tools/genmod.sh

index 142ca8287f905d9b30ca2814d805921490e17bff..4a6cfdc8c2292b40ca05c78588d87086e27427fd 100755 (executable)
@@ -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.q{c,h}>
+               #
+               # 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 <file.q{c,h}>
                # #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