Fixed makefiles for 64bit error, clean error, and output error

ADDED NEWLINES!! OMG
Corrected some AMD64 casts on ns_amxx
This commit is contained in:
David Anderson 2004-08-22 12:40:24 +00:00
parent c392f3cbbc
commit d966983354
37 changed files with 267 additions and 54 deletions

View File

@ -306,3 +306,4 @@ void RankSystem::saveRank( const char* filename )
fclose(bfp);
}

View File

@ -120,3 +120,4 @@ public:
#endif

177
dlls/csstats2/csstats/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 = "csstats_amxx";
$sdk = "../../../hlsdk/SourceCode";
$mm = "../../../metamod/metamod";
@CPP_SOURCE_FILES = ("amxxmodule.cpp", "CMisc.cpp", "usermsg.cpp", "meta_api.cpp", "rank.cpp", "CRank.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 -DHAVE_I64 -DSMALL_CELL_SIZE=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";
}
}
unlink("$outdir/$bin");
if ($OPTIONS{"clean"})
{
`rm $outdir/*.o`;
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";
print "$gcc\n";
`$gcc`;

View File

@ -459,3 +459,4 @@
#endif // USE_METAMOD
#endif // __MODULECONFIG_H__

View File

@ -125,3 +125,4 @@ public:
#endif // CMISC_H

View File

@ -72,7 +72,7 @@ if ($OPTIONS{"debug"})
if ($OPTIONS{"amd64"})
{
$cflags .= "-m64 -DSMALL_CELLSIZE=64 $cflags";
$cflags .= " -m64 -DHAVE_I64 -DSMALL_CELL_SIZE=64 $cflags";
}
if ($OPTIONS{"debug"})
@ -98,10 +98,10 @@ if ($OPTIONS{"amd64"})
}
}
unlink("$outdir/$bin");
if ($OPTIONS{"clean"})
{
`rm $outdir/*.o`;
`rm $outdir/$bin`;
die("Project cleaned.\n");
}
@ -173,4 +173,5 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
}
$gcc = "g++ $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
print "$gcc\n";
`$gcc`;

View File

@ -460,3 +460,4 @@
#endif // USE_METAMOD
#endif // __MODULECONFIG_H__

View File

@ -183,3 +183,4 @@ public:
#endif
#endif // CMISC_H

View File

@ -142,3 +142,4 @@ public:
#endif

View File

@ -72,7 +72,7 @@ if ($OPTIONS{"debug"})
if ($OPTIONS{"amd64"})
{
$cflags .= "-m64 -DSMALL_CELLSIZE=64 $cflags";
$cflags .= " -m64 -DHAVE_I64 -DSMALL_CELL_SIZE=64 $cflags";
}
if ($OPTIONS{"debug"})
@ -98,10 +98,10 @@ if ($OPTIONS{"amd64"})
}
}
unlink("%outdir/$bin");
if ($OPTIONS{"clean"})
{
`rm $outdir/*.o`;
`rm $outdir/$bin`;
die("Project cleaned.\n");
}
@ -173,4 +173,5 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
}
$gcc = "g++ $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
print "$gcc\n";
`$gcc`;

View File

@ -465,3 +465,4 @@
#endif // USE_METAMOD
#endif // __MODULECONFIG_H__

View File

@ -72,7 +72,7 @@ if ($OPTIONS{"debug"})
if ($OPTIONS{"amd64"})
{
$cflags .= "-m64 -DSMALL_CELLSIZE=64 $cflags";
$cflags .= " -m64 -DHAVE_I64 -DSMALL_CELL_SIZE=64 $cflags";
}
if ($OPTIONS{"debug"})
@ -98,11 +98,11 @@ if ($OPTIONS{"amd64"})
}
}
unlink("$outdir/$bin");
if ($OPTIONS{"clean"})
{
`rm $outdir/*.o`;
`rm $outdir/sdk/*.o`;
`rm $outdir/$bin`;
die("Project cleaned.\n");
}
@ -178,4 +178,5 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
}
$gcc = "g++ $cflags -shared -lstdc++ -ldl -lm @LINK -o $outdir/$bin";
print "$gcc\n";
`$gcc`;

View File

@ -52,3 +52,4 @@ enum
};
#endif //_INCLUDE_DLLFUNC_H

View File

@ -81,3 +81,4 @@ enum {
};
#endif //_ENGFUNC_INCLUDE_H

View File

@ -39,3 +39,4 @@ extern enginefuncs_t *g_pengfuncsTable_Post;
#endif //_FAKEMETA_INCLUDE_H

View File

@ -162,3 +162,4 @@ extern int lastFmRes;
extern int retType;
#endif //_INCLUDE_FORWARD_H

View File

@ -158,3 +158,4 @@ enum pev_pointers
};
#endif //_INCLUDE_PEV_H

View File

@ -460,3 +460,4 @@
#endif // USE_METAMOD
#endif // __MODULECONFIG_H__

View File

@ -73,7 +73,7 @@ if ($OPTIONS{"debug"})
if ($OPTIONS{"amd64"})
{
$cflags .= "-m64 -DSMALL_CELLSIZE=64 $cflags";
$cflags .= " -m64 -DHAVE_I64 -DSMALL_CELL_SIZE=64 $cflags";
}
if ($OPTIONS{"debug"})
@ -99,10 +99,10 @@ if ($OPTIONS{"amd64"})
}
}
unlink("$outdir/$bin");
if ($OPTIONS{"clean"})
{
`rm $outdir/*.o`;
`rm $outdir/$bin`;
die("Project cleaned.\n");
}
@ -174,4 +174,5 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
}
$gcc = "g++ $cflags -shared -lstdc++ -ldl -lm @LINK -o $outdir/$bin";
print "$gcc\n";
`$gcc`;

View File

@ -460,3 +460,4 @@
#endif // USE_METAMOD
#endif // __MODULECONFIG_H__

View File

@ -39,3 +39,4 @@ public:
int iclass;
};
#endif

View File

@ -18,3 +18,4 @@ public:
vec3_t getpoint(int type, int num);
};
#endif

View File

@ -72,7 +72,7 @@ if ($OPTIONS{"debug"})
if ($OPTIONS{"amd64"})
{
$cflags .= "-m64 -DSMALL_CELLSIZE=64 $cflags";
$cflags .= " -m64 -DHAVE_I64 -DSMALL_CELL_SIZE=64 $cflags";
}
if ($OPTIONS{"debug"})
@ -98,10 +98,10 @@ if ($OPTIONS{"amd64"})
}
}
unlink("$outdir/$bin");
if ($OPTIONS{"clean"})
{
`rm $outdir/*.o`;
`rm $outdir/$bin`;
die("Project cleaned.\n");
}
@ -173,4 +173,5 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
}
$gcc = "g++ $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
print "$gcc\n";
`$gcc`;

View File

@ -116,7 +116,7 @@ static cell AMX_NATIVE_CALL ns_set_points(AMX *amx, cell *params)
CPlayer *player = GET_PLAYER_I(id);
if (!player->connected || player->edict->pvPrivateData == NULL)
return 0;
set_private(player->edict,OFFSET_WIN_POINTS,OFFSET_LIN_POINTS,params[2]);
set_private(player->edict,OFFSET_WIN_POINTS,OFFSET_LIN_POINTS,(int)params[2]);
return 1;
}
static cell AMX_NATIVE_CALL ns_set_weapon_dmg(AMX *amx, cell *params)
@ -172,7 +172,7 @@ static cell AMX_NATIVE_CALL ns_set_weapon_ammo(AMX *amx, cell *params)
edict_t *pEntity = INDEXENT2(id);
if (pEntity->pvPrivateData == NULL)
return 0;
set_private(pEntity,OFFSET_WIN_WEAPCLIP,OFFSET_LIN_WEAPCLIP,params[2]);
set_private(pEntity,OFFSET_WIN_WEAPCLIP,OFFSET_LIN_WEAPCLIP,(int)params[2]);
return 1;
}
static cell AMX_NATIVE_CALL ns_get_weapon_ammo(AMX *amx, cell *params)
@ -221,19 +221,19 @@ static cell AMX_NATIVE_CALL ns_set_weap_reserve(AMX *amx, cell *params)
switch (params[2])
{
case WEAPON_PISTOL:
set_private(player->edict,OFFSET_WIN_AMMO_PISTOL,OFFSET_LIN_AMMO_PISTOL,params[3]);
set_private(player->edict,OFFSET_WIN_AMMO_PISTOL,OFFSET_LIN_AMMO_PISTOL,(int)params[3]);
return 1;
case WEAPON_LMG:
set_private(player->edict,OFFSET_WIN_AMMO_LMG,OFFSET_LIN_AMMO_LMG,params[3]);
set_private(player->edict,OFFSET_WIN_AMMO_LMG,OFFSET_LIN_AMMO_LMG,(int)params[3]);
return 1;
case WEAPON_HMG:
set_private(player->edict,OFFSET_WIN_AMMO_HMG,OFFSET_LIN_AMMO_HMG,params[3]);
set_private(player->edict,OFFSET_WIN_AMMO_HMG,OFFSET_LIN_AMMO_HMG,(int)params[3]);
return 1;
case WEAPON_GRENADE_GUN:
set_private(player->edict,OFFSET_WIN_AMMO_GL,OFFSET_LIN_AMMO_GL,params[3]);
set_private(player->edict,OFFSET_WIN_AMMO_GL,OFFSET_LIN_AMMO_GL,(int)params[3]);
return 1;
case WEAPON_GRENADE:
set_private(player->edict,OFFSET_WIN_AMMO_HG,OFFSET_LIN_AMMO_HG,params[3]);
set_private(player->edict,OFFSET_WIN_AMMO_HG,OFFSET_LIN_AMMO_HG,(int)params[3]);
return 1;
default:
return 0;
@ -258,7 +258,7 @@ static cell AMX_NATIVE_CALL ns_set_score(AMX *amx, cell *params)
CPlayer *player = GET_PLAYER_I(id);
if (!player->connected || player->edict->pvPrivateData == NULL)
return 0;
set_private(player->edict,OFFSET_WIN_SCORE,OFFSET_LIN_SCORE,params[2]);
set_private(player->edict,OFFSET_WIN_SCORE,OFFSET_LIN_SCORE,(int)params[2]);
return 1;
}
static cell AMX_NATIVE_CALL ns_set_hive_trait(AMX *amx, cell *params)
@ -269,7 +269,7 @@ static cell AMX_NATIVE_CALL ns_set_hive_trait(AMX *amx, cell *params)
edict_t *pEntity = INDEXENT2(id);
if (pEntity->pvPrivateData == NULL)
return 0;
set_private(pEntity,OFFSET_WIN_HIVE_TRAIT,OFFSET_LIN_HIVE_TRAIT,params[2]);
set_private(pEntity,OFFSET_WIN_HIVE_TRAIT,OFFSET_LIN_HIVE_TRAIT,(int)params[2]);
return 1;
}
static cell AMX_NATIVE_CALL ns_get_hive_trait(AMX *amx, cell *params)
@ -296,7 +296,7 @@ static cell AMX_NATIVE_CALL ns_set_deaths(AMX *amx, cell *params)
if (id < 1 || id > gpGlobals->maxClients)
return 0;
CPlayer *player = GET_PLAYER_I(id);
set_private(player->edict,OFFSET_WIN_DEATHS,OFFSET_LIN_DEATHS,params[2]);
set_private(player->edict,OFFSET_WIN_DEATHS,OFFSET_LIN_DEATHS,(int)params[2]);
return 1;
}
static cell AMX_NATIVE_CALL ns_get_icon(AMX *amx, cell *params)
@ -313,7 +313,7 @@ static cell AMX_NATIVE_CALL ns_set_icon(AMX *amx, cell *params)
if (id < 1 || id > gpGlobals->maxClients)
return 0;
CPlayer *player = GET_PLAYER_I(id);
set_private(player->edict,OFFSET_WIN_ICON,OFFSET_LIN_ICON,params[2]);
set_private(player->edict,OFFSET_WIN_ICON,OFFSET_LIN_ICON,(int)params[2]);
return 1;
}
@ -354,3 +354,4 @@ AMX_NATIVE_INFO ns_pdata_natives[] = {
{ NULL, NULL }
};

View File

@ -458,3 +458,4 @@
#endif // USE_METAMOD
#endif // __MODULECONFIG_H__

View File

@ -34,3 +34,4 @@ extern int BuiltForward;
#endif // NS_H

View File

@ -275,3 +275,4 @@ enum classes
#endif

View File

@ -69,3 +69,4 @@ inline BOOL isValidEntity(int x)
#endif // UTILFUNCTIONS_H

View File

@ -72,7 +72,7 @@ if ($OPTIONS{"debug"})
if ($OPTIONS{"amd64"})
{
$cflags .= "-m64 -DSMALL_CELLSIZE=64 $cflags";
$cflags .= " -m64 -DHAVE_I64 -DSMALL_CELL_SIZE=64 $cflags";
}
if ($OPTIONS{"debug"})
@ -98,10 +98,10 @@ if ($OPTIONS{"amd64"})
}
}
unlink("$outdir/$bin");
if ($OPTIONS{"clean"})
{
`rm $outdir/*.o`;
`rm $outdir/$bin`;
die("Project cleaned.\n");
}
@ -173,4 +173,5 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
}
$gcc = "g++ $cflags -shared -lstdc++ -ldl -lm @LINK -o $outdir/$bin";
print "$gcc\n";
`$gcc`;

View File

@ -460,3 +460,4 @@
#endif // USE_METAMOD
#endif // __MODULECONFIG_H__

View File

@ -111,3 +111,4 @@ public:
#endif

View File

@ -72,7 +72,7 @@ if ($OPTIONS{"debug"})
if ($OPTIONS{"amd64"})
{
$cflags .= "-m64 -DSMALL_CELLSIZE=64 $cflags";
$cflags .= " -m64 -DHAVE_I64 -DSMALL_CELL_SIZE=64 $cflags";
}
if ($OPTIONS{"debug"})
@ -98,10 +98,10 @@ if ($OPTIONS{"amd64"})
}
}
unlink("$outdir/$bin");
if ($OPTIONS{"clean"})
{
`rm $outdir/*.o`;
`rm $outdir/$bin`;
die("Project cleaned.\n");
}
@ -173,4 +173,5 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
}
$gcc = "g++ $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
print "$gcc\n";
`$gcc`;

View File

@ -460,3 +460,4 @@
#endif // USE_METAMOD
#endif // __MODULECONFIG_H__

View File

@ -149,3 +149,4 @@ public:
};
#endif // CMISC_H

View File

@ -111,3 +111,4 @@ public:
#endif

View File

@ -72,7 +72,7 @@ if ($OPTIONS{"debug"})
if ($OPTIONS{"amd64"})
{
$cflags .= "-m64 -DSMALL_CELLSIZE=64 $cflags";
$cflags .= " -m64 -DHAVE_I64 -DSMALL_CELL_SIZE=64 $cflags";
}
if ($OPTIONS{"debug"})
@ -98,10 +98,10 @@ if ($OPTIONS{"amd64"})
}
}
unlink("$outdir/$bin");
if ($OPTIONS{"clean"})
{
`rm $outdir/*.o`;
`rm $outdir/$bin`;
die("Project cleaned.\n");
}
@ -173,4 +173,5 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
}
$gcc = "g++ $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
print "$gcc\n";
`$gcc`;

View File

@ -460,3 +460,4 @@
#endif // USE_METAMOD
#endif // __MODULECONFIG_H__