#! /usr/bin/env python
# encoding: utf-8

from waflib import Utils
import os

top = '.'
PROJECT_NAME = 'server'

def options(opt):
	# stub
	return

def configure(conf):
	conf.env.append_unique('DEFINES', [
		'GAME_DLL',
		'VECTOR',
		'VERSION_SAFE_STEAM_API_INTERFACES',
		'PROTECTED_THINGS_ENABLE'
		'sprintf=use_Q_snprintf_instead_of_sprintf',
		'strncpy=use_Q_strncpy_instead',
		'_snprintf=use_Q_snprintf_instead',
		'HL2_DLL',
		'USES_SAVERESTORE'
	])

def build(bld):
	print(bld)
	source = [
		'../shared/achievement_saverestore.cpp',
		'../shared/achievementmgr.cpp',
		'../shared/achievements_hlx.cpp',
		'../shared/activitylist.cpp',
		'ai_activity.cpp',
		'ai_baseactor.cpp',
		'ai_basehumanoid.cpp',
		'ai_basenpc.cpp',
		'ai_basenpc_flyer.cpp',
		'ai_basenpc_flyer_new.cpp',
		'ai_basenpc_movement.cpp',
		'ai_basenpc_physicsflyer.cpp',
		'ai_basenpc_schedule.cpp',
		'ai_basenpc_squad.cpp',
		'ai_behavior.cpp',
		'ai_behavior_assault.cpp',
		'ai_behavior_fear.cpp',
		'ai_behavior_follow.cpp',
		'ai_behavior_lead.cpp',
		'ai_behavior_rappel.cpp',
		'ai_behavior_standoff.cpp',
		'ai_blended_movement.cpp',
		'ai_concommands.cpp',
		'ai_condition.cpp',
		'AI_Criteria.cpp',
		'ai_default.cpp',
		'ai_dynamiclink.cpp',
		'ai_event.cpp',
		'ai_goalentity.cpp',
		'ai_hint.cpp',
		'ai_hull.cpp',
		'ai_initutils.cpp',
		'AI_Interest_Target.cpp',
		'ai_link.cpp',
		'ai_localnavigator.cpp',
		'ai_looktarget.cpp',
		'ai_memory.cpp',
		'ai_motor.cpp',
		'ai_moveprobe.cpp',
		'ai_moveshoot.cpp',
		'ai_movesolver.cpp',
		'ai_namespaces.cpp',
		'ai_navigator.cpp',
		'ai_network.cpp',
		'ai_networkmanager.cpp',
		'ai_node.cpp',
		'ai_pathfinder.cpp',
		'ai_planesolver.cpp',
		'ai_playerally.cpp',
		'AI_ResponseSystem.cpp',
		'ai_route.cpp',
		'ai_saverestore.cpp',
		'ai_schedule.cpp',
		'ai_scriptconditions.cpp',
		'ai_senses.cpp',
		'ai_sentence.cpp',
		'ai_speech.cpp',
		'ai_speechfilter.cpp',
		'ai_squad.cpp',
		'ai_squadslot.cpp',
		'ai_tacticalservices.cpp',
		'ai_task.cpp',
		'ai_trackpather.cpp',
		'ai_utils.cpp',
		'ai_waypoint.cpp',
		'../shared/ammodef.cpp',
		'../shared/animation.cpp',
		'../shared/base_playeranimstate.cpp',
		'base_transmit_proxy.cpp',
		'../shared/baseachievement.cpp',
		'baseanimating.cpp',
		'BaseAnimatingOverlay.cpp',
		'basecombatcharacter.cpp',
		'../shared/basecombatcharacter_shared.cpp',
		'basecombatweapon.cpp',
		'../shared/basecombatweapon_shared.cpp',
		'baseentity.cpp',
		'../shared/baseentity_shared.cpp',
		'baseflex.cpp',
		'../shared/basegrenade_shared.cpp',
		'basemultiplayerplayer.cpp',
		'../shared/baseparticleentity.cpp',
		'../shared/baseplayer_shared.cpp',
		'../shared/baseprojectile.cpp',
		'baseviewmodel.cpp',
		'../shared/baseviewmodel_shared.cpp',
		'../shared/beam_shared.cpp',
		'bitstring.cpp',
		'bmodels.cpp',
		'buttons.cpp',
		'cbase.cpp',
		'client.cpp',
		'../shared/collisionproperty.cpp',
		'colorcorrection.cpp',
		'colorcorrectionvolume.cpp',
		'CommentarySystem.cpp',
		'controlentities.cpp',
		'cplane.cpp',
		'CRagdollMagnet.cpp',
		'damagemodifier.cpp',
		'../shared/death_pose.cpp',
		'../shared/debugoverlay_shared.cpp',
		'../shared/decals.cpp',
		'doors.cpp',
		'dynamiclight.cpp',
		'../shared/effect_dispatch_data.cpp',
		'effects.cpp',
		'EffectsServer.cpp',
		'../shared/ehandle.cpp',
		'entityblocker.cpp',
		'EntityDissolve.cpp',
		'EntityFlame.cpp',
		'entitylist.cpp',
		'../shared/entitylist_base.cpp',
		'EntityParticleTrail.cpp',
		'../shared/EntityParticleTrail_Shared.cpp',
		'env_debughistory.cpp',
		'../shared/env_detail_controller.cpp',
		'env_effectsscript.cpp',
		'env_entity_maker.cpp',
		'env_particlescript.cpp',
		'env_player_surface_trigger.cpp',
		'env_projectedtexture.cpp',
		'env_screenoverlay.cpp',
		'env_texturetoggle.cpp',
		'env_tonemap_controller.cpp',
		'../shared/env_wind_shared.cpp',
		'env_zoom.cpp',
		'EnvBeam.cpp',
		'EnvFade.cpp',
		'EnvHudHint.cpp',
		'EnvLaser.cpp',
		'EnvMessage.cpp',
		'envmicrophone.cpp',
		'EnvShake.cpp',
		'EnvSpark.cpp',
		'../shared/eventlist.cpp',
		'EventLog.cpp',
		'explode.cpp',
		'filters.cpp',
		'fire.cpp',
		'fire_smoke.cpp',
		'fish.cpp',
		'fogcontroller.cpp',
		'fourwheelvehiclephysics.cpp',
		'func_areaportal.cpp',
		'func_areaportalbase.cpp',
		'func_areaportalwindow.cpp',
		'func_break.cpp',
		'func_breakablesurf.cpp',
		'func_dust.cpp',
		'../shared/func_ladder.cpp',
		'func_ladder_endpoint.cpp',
		'func_lod.cpp',
		'func_movelinear.cpp',
		'func_occluder.cpp',
		'func_reflective_glass.cpp',
		'func_smokevolume.cpp',
		'game.cpp',
		'game_ui.cpp',
		'gameinterface.cpp',
		'../shared/gamemovement.cpp',
		'../shared/gamerules.cpp',
		'../shared/gamerules_register.cpp',
		'../shared/GameStats.cpp',
		'../shared/gamestringpool.cpp',
		'gametrace_dll.cpp',
		'../shared/gamevars_shared.cpp',
		'gameweaponmanager.cpp',
		'genericactor.cpp',
		'genericmonster.cpp',
		'gib.cpp',
		'globals.cpp',
		'globalstate.cpp',
		'guntarget.cpp',
		'h_ai.cpp',
		'hierarchy.cpp',
		'hltvdirector.cpp',
		'../shared/hintmessage.cpp',
		'../shared/hintsystem.cpp',
		'../shared/igamesystem.cpp',
		'info_camera_link.cpp',
		'info_overlay_accessor.cpp',
		'intermission.cpp',
		'item_world.cpp',
		'lightglow.cpp',
		'lights.cpp',
		'logic_measure_movement.cpp',
		'logic_navigation.cpp',
		'logicauto.cpp',
		'logicentities.cpp',
		'logicrelay.cpp',
		'mapentities.cpp',
		'../shared/mapentities_shared.cpp',
		'maprules.cpp',
		'MaterialModifyControl.cpp',
		'message_entity.cpp',
		'modelentities.cpp',
		'../shared/ModelSoundsCache.cpp',
		'movehelper_server.cpp',
		'movement.cpp',
		'../shared/movevars_shared.cpp',
		'../shared/multiplay_gamerules.cpp',
		'ndebugoverlay.cpp',
		'npc_vehicledriver.cpp',
		'../shared/obstacle_pushaway.cpp',
		'particle_light.cpp',
		'../shared/particle_parse.cpp',
		'particle_system.cpp',
		'../shared/particlesystemquery.cpp',
		'pathcorner.cpp',
		'pathtrack.cpp',
		'phys_controller.cpp',
		'physconstraint.cpp',
		'physics.cpp',
		'physics_bone_follower.cpp',
		'physics_cannister.cpp',
		'physics_fx.cpp',
		'physics_impact_damage.cpp',
		'physics_main.cpp',
		'../shared/physics_main_shared.cpp',
		'physics_npc_solver.cpp',
		'physics_prop_ragdoll.cpp',
		'../shared/physics_saverestore.cpp',
		'../shared/physics_shared.cpp',
		'physobj.cpp',
		'player.cpp',
		'player_command.cpp',
		'player_lagcompensation.cpp',
		'player_pickup.cpp',
		'player_resource.cpp',
		'playerinfomanager.cpp',
		'playerlocaldata.cpp',
		'plugin_check.cpp',
		'../shared/point_bonusmaps_accessor.cpp',
		'point_camera.cpp',
		'point_devshot_camera.cpp',
		'point_playermoveconstraint.cpp',
		'../shared/point_posecontroller.cpp',
		'point_spotlight.cpp',
		'point_template.cpp',
		'pointanglesensor.cpp',
		'PointAngularVelocitySensor.cpp',
		'pointhurt.cpp',
		'pointteleport.cpp',
		'../shared/precache_register.cpp',
		'../shared/predictableid.cpp',
		'props.cpp',
		'../shared/props_shared.cpp',
		'../shared/querycache.cpp',
		'ragdoll_manager.cpp',
		'../shared/ragdoll_shared.cpp',
		'RagdollBoogie.cpp',
		'recipientfilter.cpp',
		'rope.cpp',
		'../shared/rope_helpers.cpp',
		'../shared/saverestore.cpp',
		'saverestore_gamedll.cpp',
		'../shared/SceneCache.cpp',
		'sceneentity.cpp',
		'../shared/sceneentity_shared.cpp',
		'scratchpad_gamedll_helpers.cpp',
		'scripted.cpp',
		'scriptedtarget.cpp',
		'sendproxy.cpp',
		'../shared/sequence_Transitioner.cpp',
		'../server/serverbenchmark_base.cpp',
		'ServerNetworkProperty.cpp',
		'shadowcontrol.cpp',
		'../shared/simtimer.cpp',
		'../shared/singleplay_gamerules.cpp',
		'SkyCamera.cpp',
		'slideshow_display.cpp',
		'sound.cpp',
		'../shared/SoundEmitterSystem.cpp',
		'soundent.cpp',
		'../shared/soundenvelope.cpp',
		'../../public/SoundParametersInternal.cpp',
		'soundscape.cpp',
		'soundscape_system.cpp',
		'spotlightend.cpp',
		'../shared/Sprite.cpp',
		'sprite_perfmonitor.cpp',
		'../shared/studio_shared.cpp',
		'subs.cpp',
		'sun.cpp',
		'tactical_mission.cpp',
		'../shared/takedamageinfo.cpp',
		'tanktrain.cpp',
		'team.cpp',
		'../shared/teamplay_gamerules.cpp',
		'TemplateEntities.cpp',
		'tempmonster.cpp',
		'tesla.cpp',
		'../shared/test_ehandle.cpp',
		'test_proxytoggle.cpp',
		'test_stressentities.cpp',
		'testfunctions.cpp',
		'testtraceline.cpp',
		'textstatsmgr.cpp',
		'timedeventmgr.cpp',
		'trains.cpp',
		'triggers.cpp',
		'../shared/usercmd.cpp',
		'util.cpp',
		'../shared/util_shared.cpp',
		'variant_t.cpp',
		'vehicle_base.cpp',
		'vehicle_baseserver.cpp',
		'../shared/vehicle_viewblend_shared.cpp',
		'vguiscreen.cpp',
		'../shared/voice_gamemgr.cpp',
		'waterbullet.cpp',
		'WaterLODControl.cpp',
		'wcedit.cpp',
		'../shared/weapon_parse.cpp',
		'../shared/weapon_proficiency.cpp',
		'weight_button.cpp',
		'world.cpp',
		'../shared/mp_shareddefs.cpp',
		'../server/vote_controller.cpp',
		'../../public/haptics/haptic_msgs.cpp',
#		'../../public/haptics/haptic_utils.cpp',	[$WIN32]
		'../../public/bone_setup.cpp',
		'../../public/collisionutils.cpp',
		'../../public/dt_send.cpp',
		'../../public/dt_utlvector_common.cpp',
		'../../public/dt_utlvector_send.cpp',
		'../../public/editor_sendcommand.cpp',
		'../../public/filesystem_helpers.cpp',
		'gamehandle.cpp',
		'h_export.cpp',
		'init_factory.cpp',
		'../../public/interpolatortypes.cpp',
		'../../game/shared/interval.cpp',
		'../../public/keyframe/keyframe.cpp',
		'../../common/language.cpp',
		'../../common/steamid.cpp',
		'../../public/map_utils.cpp',
		'../../public/networkvar.cpp',
		'../../common/randoverride.cpp',
		'../../public/registry.cpp',
		'../../public/rope_physics.cpp',
		'../../public/scratchpad3d.cpp',
		'../../public/ScratchPadUtils.cpp',
		'../../public/server_class.cpp',
		'../../game/shared/sheetsimulator.cpp',
		'../../public/simple_physics.cpp',
		'../../public/stringregistry.cpp',
		'../../public/studio.cpp',
		'GameStats_BasicStatsFunctions.cpp',
		'basetempentity.cpp',
		'event_tempentity_tester.cpp',
		'movie_explosion.cpp',
		'particle_fire.cpp',
		'particle_smokegrenade.cpp',
		'plasma.cpp',
		'smokestack.cpp',
		'smoke_trail.cpp',
		'../shared/SpriteTrail.cpp',
		'steamjet.cpp',
		'te.cpp',
		'te_armorricochet.cpp',
		'te_basebeam.cpp',
		'te_beamentpoint.cpp',
		'te_beaments.cpp',
		'te_beamfollow.cpp',
		'te_beamlaser.cpp',
		'te_beampoints.cpp',
		'te_beamring.cpp',
		'te_beamringpoint.cpp',
		'te_beamspline.cpp',
		'te_bloodsprite.cpp',
		'te_bloodstream.cpp',
		'te_breakmodel.cpp',
		'te_bspdecal.cpp',
		'te_bubbles.cpp',
		'te_bubbletrail.cpp',
		'te_clientprojectile.cpp',
		'te_decal.cpp',
		'te_dynamiclight.cpp',
		'te_effect_dispatch.cpp',
		'te_energysplash.cpp',
		'te_explosion.cpp',
		'te_fizz.cpp',
		'te_footprintdecal.cpp',
		'hl2/te_gaussexplosion.cpp',
		'te_glassshatter.cpp',
		'te_glowsprite.cpp',
		'te_impact.cpp',
		'te_killplayerattachments.cpp',
		'te_largefunnel.cpp',
		'te_muzzleflash.cpp',
		'te_particlesystem.cpp',
		'te_physicsprop.cpp',
		'te_playerdecal.cpp',
		'te_projecteddecal.cpp',
		'te_showline.cpp',
		'te_smoke.cpp',
		'te_sparks.cpp',
		'te_sprite.cpp',
		'te_spritespray.cpp',
		'te_worlddecal.cpp',
		'../shared/usermessages.cpp',
		'entity_tools_server.cpp',
		'toolframework_server.cpp'
	] + [
		'ai_eventresponse.cpp',
		'ai_relationship.cpp',
		'base_gameinterface.cpp',
		'basegrenade_concussion.cpp',
		'basegrenade_contact.cpp',
		'basegrenade_timed.cpp',
		'hl2/Func_Monitor.cpp',
		'grenadethrown.cpp',
		'h_cycler.cpp',
		'logic_achievement.cpp',
		'monstermaker.cpp',
		'../shared/hl2/survival_gamerules.cpp',
		'team_spawnpoint.cpp',
		'vehicle_choreo_generic.cpp',
		'../shared/weapon_parse_default.cpp',
		'../shared/hl2/achievements_hl2.cpp',
		'hl2/ai_allymanager.cpp',
		'hl2/ai_behavior_actbusy.cpp',
		'hl2/ai_behavior_functank.cpp',
		'hl2/ai_behavior_holster.cpp',
		'hl2/ai_behavior_operator.cpp',
		'hl2/ai_behavior_police.cpp',
		'hl2/ai_goal_police.cpp',
		'hl2/ai_spotlight.cpp',
		'hl2/antlion_dust.cpp',
		'hl2/antlion_maker.cpp',
		'hl2/ar2_explosion.cpp',
		'basebludgeonweapon.cpp',
		'hl2/basehlcombatweapon.cpp',
		'../shared/hl2/basehlcombatweapon_shared.cpp',
		'hl2/cbasehelicopter.cpp',
		'hl2/cbasespriteprojectile.cpp',
		'hl2/citadel_effects.cpp',
		'hl2/combine_mine.cpp',
		'hl2/env_alyxemp.cpp',
		'hl2/env_headcrabcanister.cpp',
		'../shared/hl2/env_headcrabcanister_shared.cpp',
		'hl2/env_speaker.cpp',
		'hl2/env_starfield.cpp',
		'hl2/func_recharge.cpp',
		'hl2/func_tank.cpp',
		'hl2/grenade_ar2.cpp',
		'hl2/grenade_bugbait.cpp',
		'hl2/grenade_frag.cpp',
		'hl2/hl2_ai_network.cpp',
		'hl2/hl2_client.cpp',
		'hl2/hl2_eventlog.cpp',
		'../shared/hl2/hl2_gamerules.cpp',
		'hl2/hl2_gamestats.cpp',
		'hl2/hl2_player.cpp',
		'hl2/hl2_playerlocaldata.cpp',
		'hl2/hl2_triggers.cpp',
		'../shared/hl2/hl2_usermessages.cpp',
		'../shared/hl2/hl_gamemovement.cpp',
		'hl2/hl_playermove.cpp',
		'hl2/info_darknessmode_lightsource.cpp',
		'hl2/info_teleporter_countdown.cpp',
		'hl2/item_ammo.cpp',
		'hl2/item_battery.cpp',
		'hl2/item_dynamic_resupply.cpp',
		'hl2/item_healthkit.cpp',
		'hl2/item_itemcrate.cpp',
		'hl2/item_suit.cpp',
		'hl2/look_door.cpp',
		'hl2/monster_dummy.cpp',
		'hl2/npc_alyx.cpp',
		'hl2/npc_antlion.cpp',
		'hl2/npc_antlionguard.cpp',
		'hl2/npc_apcdriver.cpp',
		'hl2/npc_attackchopper.cpp',
		'hl2/npc_barnacle.cpp',
		'hl2/npc_barney.cpp',
		'hl2/npc_basescanner.cpp',
		'hl2/npc_BaseZombie.cpp',
		'hl2/npc_blob.cpp',
		'hl2/npc_breen.cpp',
		'hl2/npc_bullseye.cpp',
		'hl2/npc_citizen17.cpp',
		'hl2/npc_combine.cpp',
		'hl2/npc_combinecamera.cpp',
		'hl2/npc_combinedropship.cpp',
		'hl2/npc_combinegunship.cpp',
		'hl2/npc_combines.cpp',
		'hl2/npc_cranedriver.cpp',
		'hl2/npc_crow.cpp',
		'hl2/npc_dog.cpp',
		'hl2/npc_eli.cpp',
		'hl2/npc_enemyfinder.cpp',
		'hl2/npc_fastzombie.cpp',
		'hl2/npc_fisherman.cpp',
		'hl2/npc_gman.cpp',
		'hl2/npc_headcrab.cpp',
		'hl2/npc_ichthyosaur.cpp',
		'hl2/npc_kleiner.cpp',
		'hl2/npc_launcher.cpp',
		'hl2/npc_manhack.cpp',
		'hl2/npc_metropolice.cpp',
		'hl2/npc_monk.cpp',
		'hl2/npc_mossman.cpp',
		'hl2/npc_playercompanion.cpp',
		'hl2/npc_PoisonZombie.cpp',
		'hl2/npc_rollermine.cpp',
		'hl2/npc_scanner.cpp',
		'hl2/npc_stalker.cpp',
		'hl2/npc_strider.cpp',
		'npc_talker.cpp',
		'hl2/npc_turret_ceiling.cpp',
		'hl2/npc_turret_floor.cpp',
		'hl2/npc_turret_ground.cpp',
		'hl2/npc_vortigaunt_episodic.cpp',
		'hl2/npc_zombie.cpp',
		'hl2/point_apc_controller.cpp',
		'hl2/prop_combine_ball.cpp',
		'hl2/prop_thumper.cpp',
		'hl2/proto_sniper.cpp',
		'hl2/rotorwash.cpp',
		'hl2/script_intro.cpp',
		'../shared/script_intro_shared.cpp',
		'hl2/vehicle_airboat.cpp',
		'hl2/vehicle_cannon.cpp',
		'hl2/vehicle_crane.cpp',
		'hl2/vehicle_jeep.cpp',
		'hl2/vehicle_prisoner_pod.cpp',
		'hl2/vehicle_viewcontroller.cpp',
		'hl2/weapon_357.cpp',
		'hl2/weapon_alyxgun.cpp',
		'hl2/weapon_annabelle.cpp',
		'hl2/weapon_ar2.cpp',
		'hl2/weapon_bugbait.cpp',
		'hl2/weapon_citizenpackage.cpp',
		'hl2/weapon_crossbow.cpp',
		'hl2/weapon_crowbar.cpp',
		'weapon_cubemap.cpp',
		'hl2/weapon_frag.cpp',
		'hl2/weapon_physcannon.cpp',
		'hl2/weapon_pistol.cpp',
		'hl2/weapon_rpg.cpp',
		'hl2/weapon_shotgun.cpp',
		'hl2/weapon_smg1.cpp',
		'hl2/weapon_stunstick.cpp',
		'hl2/grenade_beam.cpp',
		'hl2/grenade_homer.cpp',
		'hl2/grenade_pathfollower.cpp',
		'hl2/npc_missiledefense.cpp',
		'hl2/vehicle_apc.cpp',
		'hl2/weapon_cguard.cpp',
		'hl2/weapon_flaregun.cpp'
	]

	includes = [
		'.',
		'../shared',
		'../../utils/common',
		'../shared/econ',
		'NextBot',
		'../../common',
		'../../public/tier0',
		'../../public/tier1',
		'../../public'
	] + [
		'../shared/hl2',
		'hl2'
	]

	defines = []

	libs = ['tier0','particles','dmxloader','tier1','tier2','tier3','mathlib','vstdlib','choreoobjects','steam_api']

	install_path = bld.env.PREFIX

	bld.shlib(
		source   = source,
		target   = PROJECT_NAME,
		name     = PROJECT_NAME,
		features = 'c cxx',
		includes = includes,
		defines  = defines,
		use      = libs,
		subsystem = bld.env.MSVC_SUBSYSTEM,
		idx      = bld.get_taskgen_count()
	)