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

@ -305,4 +305,5 @@ void RankSystem::saveRank( const char* filename )
fwrite( &i , 1, sizeof(short int), bfp); // null terminator
fclose(bfp);
}
}

View File

@ -119,4 +119,5 @@ public:
};
#endif
#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

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

View File

@ -124,4 +124,5 @@ public:
#endif // CMISC_H
#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

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

View File

@ -182,4 +182,5 @@ public:
};
#endif
#endif // CMISC_H
#endif // CMISC_H

View File

@ -141,4 +141,5 @@ public:
};
#endif
#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

@ -464,4 +464,5 @@
#endif // USE_METAMOD
#endif // __MODULECONFIG_H__
#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

@ -51,4 +51,5 @@ enum
MetaFunc_CallGameEntity // bool (plid_t plid, const char *entStr,entvars_t *pev);
};
#endif //_INCLUDE_DLLFUNC_H
#endif //_INCLUDE_DLLFUNC_H

View File

@ -80,4 +80,5 @@ enum {
EngFunc_SetClientKeyValue // void ) (int clientIndex, char *infobuffer, char *key, char *value);
};
#endif //_ENGFUNC_INCLUDE_H
#endif //_ENGFUNC_INCLUDE_H

View File

@ -38,4 +38,5 @@ extern enginefuncs_t *g_pengfuncsTable;
extern enginefuncs_t *g_pengfuncsTable_Post;
#endif //_FAKEMETA_INCLUDE_H
#endif //_FAKEMETA_INCLUDE_H

View File

@ -161,4 +161,5 @@ extern const char *mlStringResult;
extern int lastFmRes;
extern int retType;
#endif //_INCLUDE_FORWARD_H
#endif //_INCLUDE_FORWARD_H

View File

@ -157,4 +157,5 @@ enum pev_pointers
pev_vecarray_end
};
#endif //_INCLUDE_PEV_H
#endif //_INCLUDE_PEV_H

View File

@ -459,4 +459,5 @@
#endif // USE_METAMOD
#endif // __MODULECONFIG_H__
#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

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

View File

@ -38,4 +38,5 @@ public:
int iclass;
};
#endif
#endif

View File

@ -17,4 +17,5 @@ public:
float getnum(int type);
vec3_t getpoint(int type, int num);
};
#endif
#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;
}
@ -353,4 +353,5 @@ AMX_NATIVE_INFO ns_pdata_natives[] = {
{ "ns_set_hive_trait", ns_set_hive_trait },
{ NULL, NULL }
};
};

View File

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

View File

@ -33,4 +33,5 @@ extern int BuiltForward;
#endif // NS_H
#endif // NS_H

View File

@ -274,4 +274,5 @@ enum classes
#define MENUDEFAULT_HOLDTIME 30.0;
#endif
#endif

View File

@ -68,4 +68,5 @@ inline BOOL isValidEntity(int x)
#define CHECK_PARAMS(x) if (*params/sizeof(cell) < x) return 0;
#endif // UTILFUNCTIONS_H
#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

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

View File

@ -110,4 +110,5 @@ public:
};
#endif
#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

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

View File

@ -148,4 +148,5 @@ public:
void exec(int p1,int p2);
};
#endif // CMISC_H
#endif // CMISC_H

View File

@ -110,4 +110,5 @@ public:
};
#endif
#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

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