# game

Import qw( BASE_CFLAGS CONFIG_DIR BUILD_DIR BASEGAME do_lddabort CC CXX LINK );

$env = new cons(
	CC => $CC,
	CXX => $CXX,
	LINK => $LINK,
  CPPPATH => '#../game:#../botai',
  # NOTE TTimo what about the GAMEDLL define? where is it needed?
  CFLAGS => $BASE_CFLAGS . '-fPIC -DGAMEDLL',
  LDFLAGS => '-shared -ldl -lm'
);

@FILES = qw( 
  ../game/ai_cast.c
  ../game/ai_cast_characters.c
  ../game/ai_cast_debug.c
  ../game/ai_cast_events.c
  ../game/ai_cast_fight.c
  ../game/ai_cast_func_attack.c
  ../game/ai_cast_func_boss1.c
  ../game/ai_cast_funcs.c
  ../game/ai_cast_script.c
  ../game/ai_cast_script_actions.c
  ../game/ai_cast_script_ents.c
  ../game/ai_cast_sight.c
  ../game/ai_cast_think.c
  ../botai/ai_chat.c
  ../botai/ai_cmd.c
  ../botai/ai_dmnet.c
  ../botai/ai_dmq3.c
  ../botai/ai_main.c
  ../botai/ai_team.c 
  ../game/bg_animation.c
  ../game/bg_misc.c
  ../game/bg_pmove.c
  ../game/bg_slidemove.c
  ../game/g_active.c
  ../game/g_antilag.c
  ../game/g_alarm.c
  ../game/g_bot.c
  ../game/g_client.c
  ../game/g_cmds.c
  ../game/g_combat.c
  ../game/g_items.c
  ../game/g_main.c
  ../game/g_mem.c
  ../game/g_misc.c
  ../game/g_missile.c
  ../game/g_mover.c
  ../game/g_props.c
  ../game/g_save.c
  ../game/g_script.c
  ../game/g_script_actions.c
  ../game/g_session.c
  ../game/g_spawn.c
  ../game/g_svcmds.c
  ../game/g_syscalls.c
  ../game/g_target.c
  ../game/g_team.c
  ../game/g_tramcar.c
  ../game/g_trigger.c
  ../game/g_utils.c
  ../game/g_vehicles.c
  ../game/g_weapon.c
  ../game/q_math.c
  ../game/q_shared.c
   );
$FILESREF = \@FILES;

# NOTE: could use an ldd -r after .so build to catch unresolved symbols? (PostBuild command)
Program $env 'qagame.mp.i386.so', @$FILESREF;
my $path = FilePath('qagame.mp.i386.so');
AfterBuild $env 'qagame.mp.i386.so', "[perl] &ldd_check::do_check(\'$path\', $do_lddabort)";

Install $env '#' . $CONFIG_DIR . '/out/' . $BASEGAME, 'qagame.mp.i386.so';
