Initial commit of latest functional SDKHooks extension.
4 * by the SourceMod Development Team (adapted from AMX Mod X's compiler tool)
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software Foundation,
19 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 * In addition, as a special exception, the author gives permission to
22 * link the code of this program with the Half-Life Game Engine ("HL
23 * Engine") and Modified Game Libraries ("MODs") developed by Valve,
24 * L.L.C ("Valve"). You must obey the GNU General Public License in all
25 * respects for all of the code used other than the HL Engine and MODs
26 * from Valve. If you modify this file, you may extend this exception
27 * to your version of the file, but you are not obligated to do so. If
28 * you do not wish to do so, delete this exception statement from your
39 SysUtils, Classes, IniFiles,
47 WriteLn('//SourceMod Batch Compiler');
48 WriteLn('// by the SourceMod Dev Team');
51 if not FileExists(ExtractFilePath(ParamStr(0))+COMPILER_EXE) then
53 WriteLn('// Could not find '+COMPILER_EXE);
57 cfg := TIniFile.Create(ExtractFilePath(ParamStr(0)) + 'compiler.ini');
58 outdir := cfg.ReadString('Main', 'Output', '');
59 if (outdir <> '') then begin
60 if (DirectoryExists(outdir)) then
61 outdir := IncludeTrailingPathDelimiter(outdir)
62 else if (DirectoryExists(ExtractFilePath(ParamStr(0)) + outdir)) then
63 outdir := ExtractFilePath(ParamStr(0)) + IncludeTrailingPathDelimiter(outdir);
69 if (outdir = '') and (not DirectoryExists(ExtractFilePath(ParamStr(0))+'compiled')) then
70 CreateDir(ExtractFilePath(ParamStr(0))+'compiled');
72 if ( ParamCount > 0 ) then
74 for i := 1 to ParamCount do
76 if FileExists(ParamStr(i)) then
77 CompilePlugin(ParamStr(i), outdir)
81 WriteLn('// File not found.');
87 if ( FindFirst('*.sp',faAnyFile,sr) = 0 ) then
90 CompilePlugin(sr.Name, outdir);
91 until ( FindNext(sr) <> 0 );
95 WriteLn('// No file found.');