new makefiles

This commit is contained in:
David Anderson 2004-08-22 10:37:00 +00:00
parent 141336817e
commit e94e4ce068
15 changed files with 1440 additions and 24 deletions

176
dlls/dod2/dodfun/Makefile.pl Executable file
View File

@ -0,0 +1,176 @@
#!/usr/bin/perl
#(C)2004 AMX Mod X Development Team
# by David "BAILOPAN" Anderson
# output will occur in bin.x.proc
# where x is debug or opt and proc is ix86 or amd64
# You must use this script from the project src dir
#options =
# debug - enable gdb debugging
# amd64 - compile for AMD64
# proc=ix86 - assumed not amd64
# clean - clean the specifications above
$PROJECT = "dodfun_amxx";
$sdk = "../../../hlsdk/SourceCode";
$mm = "../../../metamod/metamod";
@CPP_SOURCE_FILES = ("CMisc.cpp", "NPD.cpp", "NBase.cpp", "Utils.cpp", "moduleconfig.cpp", "usermsg.cpp", "amxxmodule.cpp");
@C_SOURCE_FILES = ();
my %OPTIONS, %OPT;
$OPT{"debug"} = "-g -ggdb";
$OPT{"opt"} = "-O2 -ffast-math -funroll-loops -fomit-frame-pointer -s -DNDEBUG -Wall -Wno-unknown-pragmas -DOPT_TYPE=\"optimized\"";
$OPTIONS{"include"} = "-I$sdk -I. -I$mm -I$sdk/engine -I$sdk/common -I$sdk/pm_shared -I$sdk/dlls";
while ($cmd = shift)
{
if ($cmd =~ /amd64/) {
$OPTIONS{"amd64"} = 1;
} elsif ($cmd =~ /debug/) {
$OPTIONS{"debug"} = 1;
} elsif ($cmd =~ /proc=i(\d)86/) {
$proc = $1;
if ($OPTIONS{"amd64"})
{
die "You cannot compile for i".$proc."86 and AMD64.\n";
} else {
$OPTIONS{"proc"} = "i".$proc."86";
}
} elsif ($cmd =~ /clean/) {
$OPTIONS{"clean"} = 1;
}
}
$gcc = `g++ --version`;
if ($gcc =~ /2\.9/)
{
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
} else {
$OPT{"opt"} .= " -falign-loops=2 -falign-jumps=2 -falign-functions=2";
}
if ($OPTIONS{"debug"})
{
$cflags = $OPT{"debug"};
} else {
if (!$OPTIONS{"amd64"})
{
$proc = $OPTIONS{"proc"};
if (!$proc)
{
$proc = 3;
}
$cflags = "-march=i".$proc."86 ".$OPT{"opt"};
} else {
$cflags = $OPT{"opt"};
}
}
if ($OPTIONS{"amd64"})
{
$cflags .= "-m64 -DSMALL_CELLSIZE=64 $cflags";
}
if ($OPTIONS{"debug"})
{
$outdir = "bin.debug";
} else {
$outdir = "bin.opt";
}
if ($OPTIONS{"amd64"})
{
$outdir .= ".amd64";
$bin = $PROJECT."_amd64.so";
} else {
$proc = $OPTIONS{"proc"};
if ($proc)
{
$outdir .= ".i".$proc."86";
$bin = $PROJECT."_i".$proc."86.so";
} else {
$outdir .= ".i386";
$bin = $PROJECT."_i386.so";
}
}
if ($OPTIONS{"clean"})
{
`rm $outdir/*.o`;
`rm $outdir/$bin`;
die("Project cleaned.\n");
}
#create the dirs
#build link list
my @LINK;
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
{
$file = $CPP_SOURCE_FILES[$i];
$file =~ s/\.cpp/\.o/;
push(@LINK, $outdir."/".$file);
}
for ($i=0; $i<=$#C_SOURCE_FILES; $i++)
{
$file = $C_SOURCE_FILES[$i];
$file =~ s/\.c/\.o/;
push(@LINK, $outdir."/".$file);
}
if (!(-d $outdir))
{
mkdir($outdir);
}
$inc = $OPTIONS{"include"};
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
{
$file = $CPP_SOURCE_FILES[$i];
$ofile = $file;
$ofile =~ s/\.cpp/\.o/;
$ofile = "$outdir/$ofile";
$gcc = "g++ $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
if (-e $ofile)
{
$file_time = (stat($file))[9];
$ofile_time = (stat($file))[9];
if ($file_time > $ofile_time)
{
print "$gcc\n";
`$gcc`;
}
} else {
print "$gcc\n";
`$gcc`;
}
}
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
{
$file = $C_SOURCE_FILES[$i];
$ofile = $file;
$ofile =~ s/\.c/\.o/;
$ofile = "$outdir/$ofile";
$gcc = "cc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
if (-e $ofile)
{
$file_time = (stat($file))[9];
$ofile_time = (stat($file))[9];
if ($file_time > $ofile_time)
{
print "$gcc\n";
`$gcc`;
}
} else {
print "$gcc\n";
`$gcc`;
}
}
$gcc = "g++ $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
`$gcc`;

176
dlls/dod2/dodx/Makefile.pl Executable file
View File

@ -0,0 +1,176 @@
#!/usr/bin/perl
#(C)2004 AMX Mod X Development Team
# by David "BAILOPAN" Anderson
# output will occur in bin.x.proc
# where x is debug or opt and proc is ix86 or amd64
# You must use this script from the project src dir
#options =
# debug - enable gdb debugging
# amd64 - compile for AMD64
# proc=ix86 - assumed not amd64
# clean - clean the specifications above
$PROJECT = "dodx_amxx";
$sdk = "../../../hlsdk/SourceCode";
$mm = "../../../metamod/metamod";
@CPP_SOURCE_FILES = ("CMisc.cpp", "CRank.cpp", "NBase.cpp", "NRank.cpp", "Utils.cpp", "moduleconfig.cpp", "usermsg.cpp", "amxxmodule.cpp");
@C_SOURCE_FILES = ();
my %OPTIONS, %OPT;
$OPT{"debug"} = "-g -ggdb";
$OPT{"opt"} = "-O2 -ffast-math -funroll-loops -fomit-frame-pointer -s -DNDEBUG -Wall -Wno-unknown-pragmas -DOPT_TYPE=\"optimized\"";
$OPTIONS{"include"} = "-I$sdk -I. -I$mm -I$sdk/engine -I$sdk/common -I$sdk/pm_shared -I$sdk/dlls";
while ($cmd = shift)
{
if ($cmd =~ /amd64/) {
$OPTIONS{"amd64"} = 1;
} elsif ($cmd =~ /debug/) {
$OPTIONS{"debug"} = 1;
} elsif ($cmd =~ /proc=i(\d)86/) {
$proc = $1;
if ($OPTIONS{"amd64"})
{
die "You cannot compile for i".$proc."86 and AMD64.\n";
} else {
$OPTIONS{"proc"} = "i".$proc."86";
}
} elsif ($cmd =~ /clean/) {
$OPTIONS{"clean"} = 1;
}
}
$gcc = `g++ --version`;
if ($gcc =~ /2\.9/)
{
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
} else {
$OPT{"opt"} .= " -falign-loops=2 -falign-jumps=2 -falign-functions=2";
}
if ($OPTIONS{"debug"})
{
$cflags = $OPT{"debug"};
} else {
if (!$OPTIONS{"amd64"})
{
$proc = $OPTIONS{"proc"};
if (!$proc)
{
$proc = 3;
}
$cflags = "-march=i".$proc."86 ".$OPT{"opt"};
} else {
$cflags = $OPT{"opt"};
}
}
if ($OPTIONS{"amd64"})
{
$cflags .= "-m64 -DSMALL_CELLSIZE=64 $cflags";
}
if ($OPTIONS{"debug"})
{
$outdir = "bin.debug";
} else {
$outdir = "bin.opt";
}
if ($OPTIONS{"amd64"})
{
$outdir .= ".amd64";
$bin = $PROJECT."_amd64.so";
} else {
$proc = $OPTIONS{"proc"};
if ($proc)
{
$outdir .= ".i".$proc."86";
$bin = $PROJECT."_i".$proc."86.so";
} else {
$outdir .= ".i386";
$bin = $PROJECT."_i386.so";
}
}
if ($OPTIONS{"clean"})
{
`rm $outdir/*.o`;
`rm $outdir/$bin`;
die("Project cleaned.\n");
}
#create the dirs
#build link list
my @LINK;
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
{
$file = $CPP_SOURCE_FILES[$i];
$file =~ s/\.cpp/\.o/;
push(@LINK, $outdir."/".$file);
}
for ($i=0; $i<=$#C_SOURCE_FILES; $i++)
{
$file = $C_SOURCE_FILES[$i];
$file =~ s/\.c/\.o/;
push(@LINK, $outdir."/".$file);
}
if (!(-d $outdir))
{
mkdir($outdir);
}
$inc = $OPTIONS{"include"};
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
{
$file = $CPP_SOURCE_FILES[$i];
$ofile = $file;
$ofile =~ s/\.cpp/\.o/;
$ofile = "$outdir/$ofile";
$gcc = "g++ $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
if (-e $ofile)
{
$file_time = (stat($file))[9];
$ofile_time = (stat($file))[9];
if ($file_time > $ofile_time)
{
print "$gcc\n";
`$gcc`;
}
} else {
print "$gcc\n";
`$gcc`;
}
}
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
{
$file = $C_SOURCE_FILES[$i];
$ofile = $file;
$ofile =~ s/\.c/\.o/;
$ofile = "$outdir/$ofile";
$gcc = "cc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
if (-e $ofile)
{
$file_time = (stat($file))[9];
$ofile_time = (stat($file))[9];
if ($file_time > $ofile_time)
{
print "$gcc\n";
`$gcc`;
}
} else {
print "$gcc\n";
`$gcc`;
}
}
$gcc = "g++ $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
`$gcc`;

181
dlls/fakemeta/Makefile.pl Executable file
View File

@ -0,0 +1,181 @@
#!/usr/bin/perl
#(C)2004 AMX Mod X Development Team
# by David "BAILOPAN" Anderson
# output will occur in bin.x.proc
# where x is debug or opt and proc is ix86 or amd64
# You must use this script from the project src dir
#options =
# debug - enable gdb debugging
# amd64 - compile for AMD64
# proc=ix86 - assumed not amd64
# clean - clean the specifications above
$PROJECT = "fakemeta_amxx";
$sdk = "../../hlsdk/SourceCode";
$mm = "../../metamod/metamod";
@CPP_SOURCE_FILES = ("dllfunc.cpp", "fakemeta_amxx.cpp", "forward.cpp", "pdata.cpp", "pev.cpp", "engfunc.cpp", "sdk/amxxmodule.cpp");
@C_SOURCE_FILES = ();
my %OPTIONS, %OPT;
$OPT{"debug"} = "-g -ggdb";
$OPT{"opt"} = "-O2 -ffast-math -funroll-loops -fomit-frame-pointer -s -DNDEBUG -Wall -Wno-unknown-pragmas -DOPT_TYPE=\"optimized\"";
$OPTIONS{"include"} = "-I$sdk -I. -I$mm -I$sdk/engine -I$sdk/common -I$sdk/pm_shared -I$sdk/dlls";
while ($cmd = shift)
{
if ($cmd =~ /amd64/) {
$OPTIONS{"amd64"} = 1;
} elsif ($cmd =~ /debug/) {
$OPTIONS{"debug"} = 1;
} elsif ($cmd =~ /proc=i(\d)86/) {
$proc = $1;
if ($OPTIONS{"amd64"})
{
die "You cannot compile for i".$proc."86 and AMD64.\n";
} else {
$OPTIONS{"proc"} = "i".$proc."86";
}
} elsif ($cmd =~ /clean/) {
$OPTIONS{"clean"} = 1;
}
}
$gcc = `g++ --version`;
if ($gcc =~ /2\.9/)
{
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
} else {
$OPT{"opt"} .= " -falign-loops=2 -falign-jumps=2 -falign-functions=2";
}
if ($OPTIONS{"debug"})
{
$cflags = $OPT{"debug"};
} else {
if (!$OPTIONS{"amd64"})
{
$proc = $OPTIONS{"proc"};
if (!$proc)
{
$proc = 3;
}
$cflags = "-march=i".$proc."86 ".$OPT{"opt"};
} else {
$cflags = $OPT{"opt"};
}
}
if ($OPTIONS{"amd64"})
{
$cflags .= "-m64 -DSMALL_CELLSIZE=64 $cflags";
}
if ($OPTIONS{"debug"})
{
$outdir = "bin.debug";
} else {
$outdir = "bin.opt";
}
if ($OPTIONS{"amd64"})
{
$outdir .= ".amd64";
$bin = $PROJECT."_amd64.so";
} else {
$proc = $OPTIONS{"proc"};
if ($proc)
{
$outdir .= ".i".$proc."86";
$bin = $PROJECT."_i".$proc."86.so";
} else {
$outdir .= ".i386";
$bin = $PROJECT."_i386.so";
}
}
if ($OPTIONS{"clean"})
{
`rm $outdir/*.o`;
`rm $outdir/sdk/*.o`;
`rm $outdir/$bin`;
die("Project cleaned.\n");
}
#create the dirs
#build link list
my @LINK;
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
{
$file = $CPP_SOURCE_FILES[$i];
$file =~ s/\.cpp/\.o/;
push(@LINK, $outdir."/".$file);
}
for ($i=0; $i<=$#C_SOURCE_FILES; $i++)
{
$file = $C_SOURCE_FILES[$i];
$file =~ s/\.c/\.o/;
push(@LINK, $outdir."/".$file);
}
if (!(-d $outdir))
{
mkdir($outdir);
}
if (!(-d "$outdir/sdk"))
{
mkdir("$outdir/sdk");
}
$inc = $OPTIONS{"include"};
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
{
$file = $CPP_SOURCE_FILES[$i];
$ofile = $file;
$ofile =~ s/\.cpp/\.o/;
$ofile = "$outdir/$ofile";
$gcc = "g++ $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
if (-e $ofile)
{
$file_time = (stat($file))[9];
$ofile_time = (stat($file))[9];
if ($file_time > $ofile_time)
{
print "$gcc\n";
`$gcc`;
}
} else {
print "$gcc\n";
`$gcc`;
}
}
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
{
$file = $C_SOURCE_FILES[$i];
$ofile = $file;
$ofile =~ s/\.c/\.o/;
$ofile = "$outdir/$ofile";
$gcc = "cc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
if (-e $ofile)
{
$file_time = (stat($file))[9];
$ofile_time = (stat($file))[9];
if ($file_time > $ofile_time)
{
print "$gcc\n";
`$gcc`;
}
} else {
print "$gcc\n";
`$gcc`;
}
}
$gcc = "g++ $cflags -shared -lstdc++ -ldl -lm @LINK -o $outdir/$bin";
`$gcc`;

View File

@ -18,6 +18,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#define GEOIPDATADIR ""
#include "GeoIP.h" #include "GeoIP.h"
#include <stdio.h> #include <stdio.h>

View File

@ -3,10 +3,10 @@ SRCFILES = GeoIP.c amxxmodule.cpp geoip_amxx.cpp
EXTRA_LIBS_LINUX = EXTRA_LIBS_LINUX =
EXTRA_LIBS_WIN32 = EXTRA_LIBS_WIN32 =
EXTRA_LIBDIRS_LINUX = -Lextra/lib_linux EXTRA_LIBDIRS_LINUX = -Llib
EXTRA_LIBDIRS_WIN32 = -Lextra/lib_win32 EXTRA_LIBDIRS_WIN32 = -Lextra/lib_win32
EXTRA_INCLUDEDIRS = -Iextra/include -I../amxmodx EXTRA_INCLUDEDIRS = -Iextra/include -I../amxmodx -Igeolib/libGeoIP
EXTRA_FLAGS = -Dstrcmpi=strcasecmp EXTRA_FLAGS = -Dstrcmpi=strcasecmp
@ -65,7 +65,7 @@ CFLAGS:=$(CCOPT) $(CFLAGS) $(ODEF) $(EXTRA_FLAGS)
DO_CC_LINUX=$(CC_LINUX) $(CFLAGS) -fPIC $(INCLUDEDIRS) -o $@ -c $< DO_CC_LINUX=$(CC_LINUX) $(CFLAGS) -fPIC $(INCLUDEDIRS) -o $@ -c $<
DO_CC_WIN32=$(CC_WIN32) $(CFLAGS) $(INCLUDEDIRS) -o $@ -c $< DO_CC_WIN32=$(CC_WIN32) $(CFLAGS) $(INCLUDEDIRS) -o $@ -c $<
LINK_LINUX=$(CC_LINUX) $(CFLAGS) -shared -lstdc++ -ldl -lm $(OBJ_LINUX) $(EXTRA_LIBDIRS_LINUX) $(EXTRA_LIBS_LINUX) -o $@ LINK_LINUX=$(CC_LINUX) $(CFLAGS) -shared -ldl -lm $(OBJ_LINUX) $(EXTRA_LIBDIRS_LINUX) $(EXTRA_LIBS_LINUX) -o $@
LINK_WIN32=$(LD_WINDLL) -mwindows --def $(MODNAME).def --add-stdcall-alias $(OBJ_WIN32) $(EXTRA_LIBDIRS_WIN32) $(EXTRA_LIBS_WIN32) -o $@ LINK_WIN32=$(LD_WINDLL) -mwindows --def $(MODNAME).def --add-stdcall-alias $(OBJ_WIN32) $(EXTRA_LIBDIRS_WIN32) $(EXTRA_LIBS_WIN32) -o $@
$(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.cpp $(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.cpp

177
dlls/geoip/Makefile.pl Executable file
View File

@ -0,0 +1,177 @@
#!/usr/bin/perl
#(C)2004 AMX Mod X Development Team
# by David "BAILOPAN" Anderson
# output will occur in bin.x.proc
# where x is debug or opt and proc is ix86 or amd64
# You must use this script from the project src dir
#options =
# debug - enable gdb debugging
# amd64 - compile for AMD64
# proc=ix86 - assumed not amd64
# clean - clean the specifications above
$PROJECT = "geoip_amxx";
$sdk = "../../hlsdk/SourceCode";
$mm = "../../metamod/metamod";
$geoip = "geolib/libGeoIP";
@CPP_SOURCE_FILES = ("geoip_amxx.cpp", "amxxmodule.cpp");
@C_SOURCE_FILES = ("GeoIP.c");
my %OPTIONS, %OPT;
$OPT{"debug"} = "-g -ggdb";
$OPT{"opt"} = "-O2 -ffast-math -funroll-loops -fomit-frame-pointer -s -DNDEBUG -Wall -Wno-unknown-pragmas -DOPT_TYPE=\"optimized\"";
$OPTIONS{"include"} = "-I$sdk -I. -I$mm -I$sdk/engine -I$sdk/common -I$sdk/pm_shared -I$sdk/dlls -I$geoip";
while ($cmd = shift)
{
if ($cmd =~ /amd64/) {
$OPTIONS{"amd64"} = 1;
} elsif ($cmd =~ /debug/) {
$OPTIONS{"debug"} = 1;
} elsif ($cmd =~ /proc=i(\d)86/) {
$proc = $1;
if ($OPTIONS{"amd64"})
{
die "You cannot compile for i".$proc."86 and AMD64.\n";
} else {
$OPTIONS{"proc"} = "i".$proc."86";
}
} elsif ($cmd =~ /clean/) {
$OPTIONS{"clean"} = 1;
}
}
$gcc = `g++ --version`;
if ($gcc =~ /2\.9/)
{
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
} else {
$OPT{"opt"} .= " -falign-loops=2 -falign-jumps=2 -falign-functions=2";
}
if ($OPTIONS{"debug"})
{
$cflags = $OPT{"debug"};
} else {
if (!$OPTIONS{"amd64"})
{
$proc = $OPTIONS{"proc"};
if (!$proc)
{
$proc = 3;
}
$cflags = "-march=i".$proc."86 ".$OPT{"opt"};
} else {
$cflags = $OPT{"opt"};
}
}
if ($OPTIONS{"amd64"})
{
$cflags .= "-m64 -DSMALL_CELLSIZE=64 $cflags";
}
if ($OPTIONS{"debug"})
{
$outdir = "bin.debug";
} else {
$outdir = "bin.opt";
}
if ($OPTIONS{"amd64"})
{
$outdir .= ".amd64";
$bin = $PROJECT."_amd64.so";
} else {
$proc = $OPTIONS{"proc"};
if ($proc)
{
$outdir .= ".i".$proc."86";
$bin = $PROJECT."_i".$proc."86.so";
} else {
$outdir .= ".i386";
$bin = $PROJECT."_i386.so";
}
}
if ($OPTIONS{"clean"})
{
`rm $outdir/*.o`;
`rm $outdir/$bin`;
die("Project cleaned.\n");
}
#create the dirs
#build link list
my @LINK;
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
{
$file = $CPP_SOURCE_FILES[$i];
$file =~ s/\.cpp/\.o/;
push(@LINK, $outdir."/".$file);
}
for ($i=0; $i<=$#C_SOURCE_FILES; $i++)
{
$file = $C_SOURCE_FILES[$i];
$file =~ s/\.c/\.o/;
push(@LINK, $outdir."/".$file);
}
if (!(-d $outdir))
{
mkdir($outdir);
}
$inc = $OPTIONS{"include"};
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
{
$file = $CPP_SOURCE_FILES[$i];
$ofile = $file;
$ofile =~ s/\.cpp/\.o/;
$ofile = "$outdir/$ofile";
$gcc = "g++ $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
if (-e $ofile)
{
$file_time = (stat($file))[9];
$ofile_time = (stat($file))[9];
if ($file_time > $ofile_time)
{
print "$gcc\n";
`$gcc`;
}
} else {
print "$gcc\n";
`$gcc`;
}
}
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
{
$file = $C_SOURCE_FILES[$i];
$ofile = $file;
$ofile =~ s/\.c/\.o/;
$ofile = "$outdir/$ofile";
$gcc = "cc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
if (-e $ofile)
{
$file_time = (stat($file))[9];
$ofile_time = (stat($file))[9];
if ($file_time > $ofile_time)
{
print "$gcc\n";
`$gcc`;
}
} else {
print "$gcc\n";
`$gcc`;
}
}
$gcc = "g++ $cflags -shared -lstdc++ -ldl -lm @LINK -o $outdir/$bin";
`$gcc`;

View File

@ -1,6 +1,8 @@
#ifndef _INCLUDE_GEOIPAMXX_H #ifndef _INCLUDE_GEOIPAMXX_H
#define _INCLUDE_GEOIPAMXX_H #define _INCLUDE_GEOIPAMXX_H
#define GEOIPDATADIR ""
#include <GeoIP.h> #include <GeoIP.h>
#include "amxxmodule.h" #include "amxxmodule.h"

176
dlls/ns/ns/Makefile.pl Executable file
View File

@ -0,0 +1,176 @@
#!/usr/bin/perl
#(C)2004 AMX Mod X Development Team
# by David "BAILOPAN" Anderson
# output will occur in bin.x.proc
# where x is debug or opt and proc is ix86 or amd64
# You must use this script from the project src dir
#options =
# debug - enable gdb debugging
# amd64 - compile for AMD64
# proc=ix86 - assumed not amd64
# clean - clean the specifications above
$PROJECT = "ns_amxx";
$sdk = "../../../hlsdk/SourceCode";
$mm = "../../../metamod/metamod";
@CPP_SOURCE_FILES = ("amxxmodule.cpp", "CPlayer.cpp", "CSpawn.cpp", "NMisc.cpp", "NPData.cpp", "hookedfunctions.cpp");
@C_SOURCE_FILES = ();
my %OPTIONS, %OPT;
$OPT{"debug"} = "-g -ggdb";
$OPT{"opt"} = "-O2 -ffast-math -funroll-loops -fomit-frame-pointer -s -DNDEBUG -Wall -Wno-unknown-pragmas -DOPT_TYPE=\"optimized\"";
$OPTIONS{"include"} = "-I$sdk -I. -I$mm -I$sdk/engine -I$sdk/common -I$sdk/pm_shared -I$sdk/dlls";
while ($cmd = shift)
{
if ($cmd =~ /amd64/) {
$OPTIONS{"amd64"} = 1;
} elsif ($cmd =~ /debug/) {
$OPTIONS{"debug"} = 1;
} elsif ($cmd =~ /proc=i(\d)86/) {
$proc = $1;
if ($OPTIONS{"amd64"})
{
die "You cannot compile for i".$proc."86 and AMD64.\n";
} else {
$OPTIONS{"proc"} = "i".$proc."86";
}
} elsif ($cmd =~ /clean/) {
$OPTIONS{"clean"} = 1;
}
}
$gcc = `g++ --version`;
if ($gcc =~ /2\.9/)
{
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
} else {
$OPT{"opt"} .= " -falign-loops=2 -falign-jumps=2 -falign-functions=2";
}
if ($OPTIONS{"debug"})
{
$cflags = $OPT{"debug"};
} else {
if (!$OPTIONS{"amd64"})
{
$proc = $OPTIONS{"proc"};
if (!$proc)
{
$proc = 3;
}
$cflags = "-march=i".$proc."86 ".$OPT{"opt"};
} else {
$cflags = $OPT{"opt"};
}
}
if ($OPTIONS{"amd64"})
{
$cflags .= "-m64 -DSMALL_CELLSIZE=64 $cflags";
}
if ($OPTIONS{"debug"})
{
$outdir = "bin.debug";
} else {
$outdir = "bin.opt";
}
if ($OPTIONS{"amd64"})
{
$outdir .= ".amd64";
$bin = $PROJECT."_amd64.so";
} else {
$proc = $OPTIONS{"proc"};
if ($proc)
{
$outdir .= ".i".$proc."86";
$bin = $PROJECT."_i".$proc."86.so";
} else {
$outdir .= ".i386";
$bin = $PROJECT."_i386.so";
}
}
if ($OPTIONS{"clean"})
{
`rm $outdir/*.o`;
`rm $outdir/$bin`;
die("Project cleaned.\n");
}
#create the dirs
#build link list
my @LINK;
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
{
$file = $CPP_SOURCE_FILES[$i];
$file =~ s/\.cpp/\.o/;
push(@LINK, $outdir."/".$file);
}
for ($i=0; $i<=$#C_SOURCE_FILES; $i++)
{
$file = $C_SOURCE_FILES[$i];
$file =~ s/\.c/\.o/;
push(@LINK, $outdir."/".$file);
}
if (!(-d $outdir))
{
mkdir($outdir);
}
$inc = $OPTIONS{"include"};
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
{
$file = $CPP_SOURCE_FILES[$i];
$ofile = $file;
$ofile =~ s/\.cpp/\.o/;
$ofile = "$outdir/$ofile";
$gcc = "g++ $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
if (-e $ofile)
{
$file_time = (stat($file))[9];
$ofile_time = (stat($file))[9];
if ($file_time > $ofile_time)
{
print "$gcc\n";
`$gcc`;
}
} else {
print "$gcc\n";
`$gcc`;
}
}
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
{
$file = $C_SOURCE_FILES[$i];
$ofile = $file;
$ofile =~ s/\.c/\.o/;
$ofile = "$outdir/$ofile";
$gcc = "cc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
if (-e $ofile)
{
$file_time = (stat($file))[9];
$ofile_time = (stat($file))[9];
if ($file_time > $ofile_time)
{
print "$gcc\n";
`$gcc`;
}
} else {
print "$gcc\n";
`$gcc`;
}
}
$gcc = "g++ $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
`$gcc`;

View File

@ -1,17 +1,17 @@
MODNAME = pgsql_amx MODNAME = pgsql_amxx
SRCFILES = pgsql_amx.cpp SRCFILES = pgsql_amx.cpp pgsql.cpp amxxmodule.cpp
EXTRA_LIBS_LINUX = lib/libpq.a -lpq libz.a -lz -lcrypt EXTRA_LIBS_LINUX = lib/libpq.a -lpq -lz -lcrypt
EXTRA_LIBS_WIN32 = libpq.a -lws2_32 -lwsock32 EXTRA_LIBS_WIN32 = libpq.a -lws2_32 -lwsock32
EXTRA_LIBDIRS_LINUX = -Llib EXTRA_LIBDIRS_LINUX = -Llib
EXTRA_LIBDIRS_WIN32 = -L EXTRA_LIBDIRS_WIN32 = -L
EXTRA_INCLUDEDIRS = -Iextra/include -I../../amxmodx -Ipostgresql-7.4.2/src/include -Ipostgresql-7.4.2/src/interfaces/libpq EXTRA_INCLUDEDIRS = -Iextra/include -I../../amxmodx -Ipostgresql-7.4.3/src/include -Ipostgresql-7.4.3/src/interfaces/libpq
EXTRA_FLAGS = -Dstrcmpi=strcasecmp EXTRA_FLAGS = -Dstrcmpi=strcasecmp
SDKTOP=../../hlsdk SDKTOP=../../hlsdk
METADIR=../../metamodx/ METADIR=../../metamod/metamod
SDKSRC=$(SDKTOP)/SourceCode SDKSRC=$(SDKTOP)/SourceCode
OBJDIR_LINUX=obj.linux OBJDIR_LINUX=obj.linux
@ -53,7 +53,7 @@ endif
OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o) OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o) OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o)
#CCOPT = -funroll-loops \ CCOPT = -march=i386 -O2 -s -DNDEBUG
INCLUDEDIRS=-I../curl/include -I$(SRCDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/pm_shared -I$(SDKSRC)/dlls -I$(SDKSRC) $(EXTRA_INCLUDEDIRS) INCLUDEDIRS=-I../curl/include -I$(SRCDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/pm_shared -I$(SDKSRC)/dlls -I$(SDKSRC) $(EXTRA_INCLUDEDIRS)
CFLAGS=-Wall -Wno-unknown-pragmas -march=i386 CFLAGS=-Wall -Wno-unknown-pragmas -march=i386

View File

@ -88,10 +88,10 @@ void SQL::Disconnect()
if (isFree) if (isFree)
return; return;
Host.clear(); Host.assign("");
Username.clear(); Username.assign("");
Password.clear(); Password.assign("");
Database.clear(); Database.assign("");
PQfinish(cn); PQfinish(cn);

176
dlls/sockets/Makefile.pl Executable file
View File

@ -0,0 +1,176 @@
#!/usr/bin/perl
#(C)2004 AMX Mod X Development Team
# by David "BAILOPAN" Anderson
# output will occur in bin.x.proc
# where x is debug or opt and proc is ix86 or amd64
# You must use this script from the project src dir
#options =
# debug - enable gdb debugging
# amd64 - compile for AMD64
# proc=ix86 - assumed not amd64
# clean - clean the specifications above
$PROJECT = "sockets_amxx";
$sdk = "../hlsdk/SourceCode";
$mm = "../metamod/metamod";
@CPP_SOURCE_FILES = ("sockets.cpp", "amxxmodule.cpp");
@C_SOURCE_FILES = ();
my %OPTIONS, %OPT;
$OPT{"debug"} = "-g -ggdb";
$OPT{"opt"} = "-O2 -ffast-math -funroll-loops -fomit-frame-pointer -s -DNDEBUG -Wall -Wno-unknown-pragmas -DOPT_TYPE=\"optimized\"";
$OPTIONS{"include"} = "-I$sdk -I. -I$mm -I$sdk/engine -I$sdk/common -I$sdk/pm_shared -I$sdk/dlls";
while ($cmd = shift)
{
if ($cmd =~ /amd64/) {
$OPTIONS{"amd64"} = 1;
} elsif ($cmd =~ /debug/) {
$OPTIONS{"debug"} = 1;
} elsif ($cmd =~ /proc=i(\d)86/) {
$proc = $1;
if ($OPTIONS{"amd64"})
{
die "You cannot compile for i".$proc."86 and AMD64.\n";
} else {
$OPTIONS{"proc"} = "i".$proc."86";
}
} elsif ($cmd =~ /clean/) {
$OPTIONS{"clean"} = 1;
}
}
$gcc = `g++ --version`;
if ($gcc =~ /2\.9/)
{
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
} else {
$OPT{"opt"} .= " -falign-loops=2 -falign-jumps=2 -falign-functions=2";
}
if ($OPTIONS{"debug"})
{
$cflags = $OPT{"debug"};
} else {
if (!$OPTIONS{"amd64"})
{
$proc = $OPTIONS{"proc"};
if (!$proc)
{
$proc = 3;
}
$cflags = "-march=i".$proc."86 ".$OPT{"opt"};
} else {
$cflags = $OPT{"opt"};
}
}
if ($OPTIONS{"amd64"})
{
$cflags .= "-m64 -DSMALL_CELLSIZE=64 $cflags";
}
if ($OPTIONS{"debug"})
{
$outdir = "bin.debug";
} else {
$outdir = "bin.opt";
}
if ($OPTIONS{"amd64"})
{
$outdir .= ".amd64";
$bin = $PROJECT."_amd64.so";
} else {
$proc = $OPTIONS{"proc"};
if ($proc)
{
$outdir .= ".i".$proc."86";
$bin = $PROJECT."_i".$proc."86.so";
} else {
$outdir .= ".i386";
$bin = $PROJECT."_i386.so";
}
}
if ($OPTIONS{"clean"})
{
`rm $outdir/*.o`;
`rm $outdir/$bin`;
die("Project cleaned.\n");
}
#create the dirs
#build link list
my @LINK;
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
{
$file = $CPP_SOURCE_FILES[$i];
$file =~ s/\.cpp/\.o/;
push(@LINK, $outdir."/".$file);
}
for ($i=0; $i<=$#C_SOURCE_FILES; $i++)
{
$file = $C_SOURCE_FILES[$i];
$file =~ s/\.c/\.o/;
push(@LINK, $outdir."/".$file);
}
if (!(-d $outdir))
{
mkdir($outdir);
}
$inc = $OPTIONS{"include"};
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
{
$file = $CPP_SOURCE_FILES[$i];
$ofile = $file;
$ofile =~ s/\.cpp/\.o/;
$ofile = "$outdir/$ofile";
$gcc = "g++ $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
if (-e $ofile)
{
$file_time = (stat($file))[9];
$ofile_time = (stat($file))[9];
if ($file_time > $ofile_time)
{
print "$gcc\n";
`$gcc`;
}
} else {
print "$gcc\n";
`$gcc`;
}
}
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
{
$file = $C_SOURCE_FILES[$i];
$ofile = $file;
$ofile =~ s/\.c/\.o/;
$ofile = "$outdir/$ofile";
$gcc = "cc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
if (-e $ofile)
{
$file_time = (stat($file))[9];
$ofile_time = (stat($file))[9];
if ($file_time > $ofile_time)
{
print "$gcc\n";
`$gcc`;
}
} else {
print "$gcc\n";
`$gcc`;
}
}
$gcc = "g++ $cflags -shared -lstdc++ -ldl -lm @LINK -o $outdir/$bin";
`$gcc`;

View File

@ -10,8 +10,8 @@ EXTRA_INCLUDEDIRS = -Iextra/include
EXTRA_FLAGS = -Dstrcmpi=strcasecmp EXTRA_FLAGS = -Dstrcmpi=strcasecmp
SDKSRC=../sdk SDKSRC=../../../hlsdk/SourceCode
METADIR=../metamod METADIR=../../../metamod/metamod
OBJDIR_LINUX=obj.linux OBJDIR_LINUX=obj.linux
OBJDIR_WIN32=obj.win32 OBJDIR_WIN32=obj.win32
@ -51,9 +51,8 @@ endif
OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o) OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o) OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o)
CCOPT = -march=i586 -O6 -ffast-math -funroll-loops \ CCOPT = -march=i386 -O2 -ffast-math -funroll-loops \
-fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \ -s -DNDEBUG
-malign-jumps=2 -malign-functions=2 -s -DNDEBUG
INCLUDEDIRS=-I../curl/include -I$(SRCDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/dlls -I$(SDKSRC) $(EXTRA_INCLUDEDIRS) INCLUDEDIRS=-I../curl/include -I$(SRCDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/dlls -I$(SDKSRC) $(EXTRA_INCLUDEDIRS)
CFLAGS=-Wall -Wno-unknown-pragmas CFLAGS=-Wall -Wno-unknown-pragmas

176
dlls/tfc/tfcx/Makefile.pl Executable file
View File

@ -0,0 +1,176 @@
#!/usr/bin/perl
#(C)2004 AMX Mod X Development Team
# by David "BAILOPAN" Anderson
# output will occur in bin.x.proc
# where x is debug or opt and proc is ix86 or amd64
# You must use this script from the project src dir
#options =
# debug - enable gdb debugging
# amd64 - compile for AMD64
# proc=ix86 - assumed not amd64
# clean - clean the specifications above
$PROJECT = "tfcx_amxx";
$sdk = "../../../hlsdk/SourceCode";
$mm = "../../../metamod/metamod";
@CPP_SOURCE_FILES = ("CMisc.cpp", "CRank.cpp", "NBase.cpp", "NRank.cpp", "Utils.cpp", "moduleconfig.cpp", "usermsg.cpp", "amxxmodule.cpp");
@C_SOURCE_FILES = ();
my %OPTIONS, %OPT;
$OPT{"debug"} = "-g -ggdb";
$OPT{"opt"} = "-O2 -ffast-math -funroll-loops -fomit-frame-pointer -s -DNDEBUG -Wall -Wno-unknown-pragmas -DOPT_TYPE=\"optimized\"";
$OPTIONS{"include"} = "-I$sdk -I. -I$mm -I$sdk/engine -I$sdk/common -I$sdk/pm_shared -I$sdk/dlls";
while ($cmd = shift)
{
if ($cmd =~ /amd64/) {
$OPTIONS{"amd64"} = 1;
} elsif ($cmd =~ /debug/) {
$OPTIONS{"debug"} = 1;
} elsif ($cmd =~ /proc=i(\d)86/) {
$proc = $1;
if ($OPTIONS{"amd64"})
{
die "You cannot compile for i".$proc."86 and AMD64.\n";
} else {
$OPTIONS{"proc"} = "i".$proc."86";
}
} elsif ($cmd =~ /clean/) {
$OPTIONS{"clean"} = 1;
}
}
$gcc = `g++ --version`;
if ($gcc =~ /2\.9/)
{
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
} else {
$OPT{"opt"} .= " -falign-loops=2 -falign-jumps=2 -falign-functions=2";
}
if ($OPTIONS{"debug"})
{
$cflags = $OPT{"debug"};
} else {
if (!$OPTIONS{"amd64"})
{
$proc = $OPTIONS{"proc"};
if (!$proc)
{
$proc = 3;
}
$cflags = "-march=i".$proc."86 ".$OPT{"opt"};
} else {
$cflags = $OPT{"opt"};
}
}
if ($OPTIONS{"amd64"})
{
$cflags .= "-m64 -DSMALL_CELLSIZE=64 $cflags";
}
if ($OPTIONS{"debug"})
{
$outdir = "bin.debug";
} else {
$outdir = "bin.opt";
}
if ($OPTIONS{"amd64"})
{
$outdir .= ".amd64";
$bin = $PROJECT."_amd64.so";
} else {
$proc = $OPTIONS{"proc"};
if ($proc)
{
$outdir .= ".i".$proc."86";
$bin = $PROJECT."_i".$proc."86.so";
} else {
$outdir .= ".i386";
$bin = $PROJECT."_i386.so";
}
}
if ($OPTIONS{"clean"})
{
`rm $outdir/*.o`;
`rm $outdir/$bin`;
die("Project cleaned.\n");
}
#create the dirs
#build link list
my @LINK;
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
{
$file = $CPP_SOURCE_FILES[$i];
$file =~ s/\.cpp/\.o/;
push(@LINK, $outdir."/".$file);
}
for ($i=0; $i<=$#C_SOURCE_FILES; $i++)
{
$file = $C_SOURCE_FILES[$i];
$file =~ s/\.c/\.o/;
push(@LINK, $outdir."/".$file);
}
if (!(-d $outdir))
{
mkdir($outdir);
}
$inc = $OPTIONS{"include"};
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
{
$file = $CPP_SOURCE_FILES[$i];
$ofile = $file;
$ofile =~ s/\.cpp/\.o/;
$ofile = "$outdir/$ofile";
$gcc = "g++ $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
if (-e $ofile)
{
$file_time = (stat($file))[9];
$ofile_time = (stat($file))[9];
if ($file_time > $ofile_time)
{
print "$gcc\n";
`$gcc`;
}
} else {
print "$gcc\n";
`$gcc`;
}
}
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
{
$file = $C_SOURCE_FILES[$i];
$ofile = $file;
$ofile =~ s/\.c/\.o/;
$ofile = "$outdir/$ofile";
$gcc = "cc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
if (-e $ofile)
{
$file_time = (stat($file))[9];
$ofile_time = (stat($file))[9];
if ($file_time > $ofile_time)
{
print "$gcc\n";
`$gcc`;
}
} else {
print "$gcc\n";
`$gcc`;
}
}
$gcc = "g++ $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
`$gcc`;

176
dlls/ts/tsx/Makefile.pl Executable file
View File

@ -0,0 +1,176 @@
#!/usr/bin/perl
#(C)2004 AMX Mod X Development Team
# by David "BAILOPAN" Anderson
# output will occur in bin.x.proc
# where x is debug or opt and proc is ix86 or amd64
# You must use this script from the project src dir
#options =
# debug - enable gdb debugging
# amd64 - compile for AMD64
# proc=ix86 - assumed not amd64
# clean - clean the specifications above
$PROJECT = "tsx_amxx";
$sdk = "../../../hlsdk/SourceCode";
$mm = "../../../metamod/metamod";
@CPP_SOURCE_FILES = ("CMisc.cpp", "CRank.cpp", "NBase.cpp", "NRank.cpp", "Utils.cpp", "moduleconfig.cpp", "usermsg.cpp", "amxxmodule.cpp");
@C_SOURCE_FILES = ();
my %OPTIONS, %OPT;
$OPT{"debug"} = "-g -ggdb";
$OPT{"opt"} = "-O2 -ffast-math -funroll-loops -fomit-frame-pointer -s -DNDEBUG -Wall -Wno-unknown-pragmas -DOPT_TYPE=\"optimized\"";
$OPTIONS{"include"} = "-I$sdk -I. -I$mm -I$sdk/engine -I$sdk/common -I$sdk/pm_shared -I$sdk/dlls";
while ($cmd = shift)
{
if ($cmd =~ /amd64/) {
$OPTIONS{"amd64"} = 1;
} elsif ($cmd =~ /debug/) {
$OPTIONS{"debug"} = 1;
} elsif ($cmd =~ /proc=i(\d)86/) {
$proc = $1;
if ($OPTIONS{"amd64"})
{
die "You cannot compile for i".$proc."86 and AMD64.\n";
} else {
$OPTIONS{"proc"} = "i".$proc."86";
}
} elsif ($cmd =~ /clean/) {
$OPTIONS{"clean"} = 1;
}
}
$gcc = `g++ --version`;
if ($gcc =~ /2\.9/)
{
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
} else {
$OPT{"opt"} .= " -falign-loops=2 -falign-jumps=2 -falign-functions=2";
}
if ($OPTIONS{"debug"})
{
$cflags = $OPT{"debug"};
} else {
if (!$OPTIONS{"amd64"})
{
$proc = $OPTIONS{"proc"};
if (!$proc)
{
$proc = 3;
}
$cflags = "-march=i".$proc."86 ".$OPT{"opt"};
} else {
$cflags = $OPT{"opt"};
}
}
if ($OPTIONS{"amd64"})
{
$cflags .= "-m64 -DSMALL_CELLSIZE=64 $cflags";
}
if ($OPTIONS{"debug"})
{
$outdir = "bin.debug";
} else {
$outdir = "bin.opt";
}
if ($OPTIONS{"amd64"})
{
$outdir .= ".amd64";
$bin = $PROJECT."_amd64.so";
} else {
$proc = $OPTIONS{"proc"};
if ($proc)
{
$outdir .= ".i".$proc."86";
$bin = $PROJECT."_i".$proc."86.so";
} else {
$outdir .= ".i386";
$bin = $PROJECT."_i386.so";
}
}
if ($OPTIONS{"clean"})
{
`rm $outdir/*.o`;
`rm $outdir/$bin`;
die("Project cleaned.\n");
}
#create the dirs
#build link list
my @LINK;
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
{
$file = $CPP_SOURCE_FILES[$i];
$file =~ s/\.cpp/\.o/;
push(@LINK, $outdir."/".$file);
}
for ($i=0; $i<=$#C_SOURCE_FILES; $i++)
{
$file = $C_SOURCE_FILES[$i];
$file =~ s/\.c/\.o/;
push(@LINK, $outdir."/".$file);
}
if (!(-d $outdir))
{
mkdir($outdir);
}
$inc = $OPTIONS{"include"};
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
{
$file = $CPP_SOURCE_FILES[$i];
$ofile = $file;
$ofile =~ s/\.cpp/\.o/;
$ofile = "$outdir/$ofile";
$gcc = "g++ $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
if (-e $ofile)
{
$file_time = (stat($file))[9];
$ofile_time = (stat($file))[9];
if ($file_time > $ofile_time)
{
print "$gcc\n";
`$gcc`;
}
} else {
print "$gcc\n";
`$gcc`;
}
}
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
{
$file = $C_SOURCE_FILES[$i];
$ofile = $file;
$ofile =~ s/\.c/\.o/;
$ofile = "$outdir/$ofile";
$gcc = "cc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
if (-e $ofile)
{
$file_time = (stat($file))[9];
$ofile_time = (stat($file))[9];
if ($file_time > $ofile_time)
{
print "$gcc\n";
`$gcc`;
}
} else {
print "$gcc\n";
`$gcc`;
}
}
$gcc = "g++ $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
`$gcc`;

View File

@ -10,8 +10,8 @@ EXTRA_INCLUDEDIRS = -Iextra/include
EXTRA_FLAGS = -Dstrcmpi=strcasecmp EXTRA_FLAGS = -Dstrcmpi=strcasecmp
SDKSRC=../sdk SDKSRC=../../../hlsdk/SourceCode
METADIR=../metamod METADIR=../../../metamod/metamod
OBJDIR_LINUX=obj.linux OBJDIR_LINUX=obj.linux
OBJDIR_WIN32=obj.win32 OBJDIR_WIN32=obj.win32
@ -51,9 +51,8 @@ endif
OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o) OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o) OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o)
CCOPT = -march=i586 -O6 -ffast-math -funroll-loops \ CCOPT = -march=i386 -O2 -ffast-math -funroll-loops \
-fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \ -s -DNDEBUG
-malign-jumps=2 -malign-functions=2 -s -DNDEBUG
INCLUDEDIRS=-I../curl/include -I$(SRCDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/dlls -I$(SDKSRC) $(EXTRA_INCLUDEDIRS) INCLUDEDIRS=-I../curl/include -I$(SRCDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/dlls -I$(SDKSRC) $(EXTRA_INCLUDEDIRS)
CFLAGS=-Wall -Wno-unknown-pragmas CFLAGS=-Wall -Wno-unknown-pragmas