# -*- mode: python -*- # coding=utf-8 # DOOM build script # TTimo # http://scons.sourceforge.net #***************************************************************************** # The Dark Mod GPL Source Code # # This file is part of the The Dark Mod Source Code, originally based # on the Doom 3 GPL Source Code as published in 2011. # # The Dark Mod Source Code is free software: you can redistribute it # and/or modify it under the terms of the GNU General Public License as # published by the Free Software Foundation, either version 3 of the License, # or (at your option) any later version. For details, see LICENSE.TXT. # # Project: The Dark Mod (http://www.thedarkmod.com/) # # $Revision$ (Revision of last commit) # $Date$ (Date of last commit) # $Author$ (Author of last commit) # #***************************************************************************** import sys, os import scons_utils Import( 'GLOBALS' ) Import( GLOBALS ) # Master list of source files to compile game_string = ' \ Actor.cpp \ AF.cpp \ AFEntity.cpp \ BrittleFracture.cpp \ Camera.cpp \ Entity.cpp \ Emitter.cpp \ FX.cpp \ Game_local.cpp \ Game_network.cpp \ GameEdit.cpp \ IK.cpp \ Item.cpp \ Light.cpp \ Misc.cpp \ Moveable.cpp \ Mover.cpp \ MultiplayerGame.cpp \ Player.cpp \ PlayerIcon.cpp \ PlayerView.cpp \ Projectile.cpp \ Pvs.cpp \ SecurityCamera.cpp \ SmokeParticles.cpp \ Sound.cpp \ Target.cpp \ Trigger.cpp \ Weapon.cpp \ WorldSpawn.cpp \ ai/AAS.cpp \ ai/AAS_debug.cpp \ ai/AAS_pathing.cpp \ ai/AAS_routing.cpp \ ai/AI.cpp \ ai/AI_events.cpp \ ai/AI_pathing.cpp \ ai/MoveState.cpp \ ai/tdmAASFindEscape.cpp \ anim/Anim.cpp \ anim/Anim_Blend.cpp \ anim/Anim_Import.cpp \ anim/Anim_Testmodel.cpp \ gamesys/Class.cpp \ gamesys/DebugGraph.cpp \ gamesys/Event.cpp \ gamesys/SaveGame.cpp \ gamesys/SysCmds.cpp \ gamesys/SysCvar.cpp \ gamesys/TypeInfo.cpp \ physics/Clip.cpp \ physics/Force.cpp \ physics/Force_Constant.cpp \ physics/Force_Drag.cpp \ physics/Force_Field.cpp \ physics/Force_Push.cpp \ physics/Force_Spring.cpp \ physics/Physics.cpp \ physics/Physics_Actor.cpp \ physics/Physics_AF.cpp \ physics/Physics_Base.cpp \ physics/Physics_Liquid.cpp \ physics/Physics_Monster.cpp \ physics/Physics_Parametric.cpp \ physics/Physics_Player.cpp \ physics/Physics_RigidBody.cpp \ physics/Physics_Static.cpp \ physics/Physics_StaticMulti.cpp \ physics/Push.cpp \ script/Script_Compiler.cpp \ script/Script_Doc_Export.cpp \ script/Script_Interpreter.cpp \ script/Script_Program.cpp \ script/Script_Thread.cpp' game_list = scons_utils.BuildList( 'game', game_string ) for i in range( len( game_list ) ): game_list[ i ] = '../../' + game_list[ i ] # DarkMod source files darkModSrc = '\ AIComm_Message.cpp \ AIVehicle.cpp \ BinaryFrobMover.cpp \ BloodMarker.cpp \ ButtonStateTracker.cpp \ DarkmodAASHidingSpotFinder.cpp \ DarkModGlobals.cpp \ darkmodHidingSpotTree.cpp \ darkModLAS.cpp \ decltdm_matinfo.cpp \ declxdata.cpp \ DifficultyManager.cpp \ DifficultySettings.cpp \ DownloadMenu.cpp \ EscapePointEvaluator.cpp \ EscapePointManager.cpp \ Force_Grab.cpp \ Func_Shooter.cpp \ FrobDoor.cpp \ FrobButton.cpp \ FrobDoorHandle.cpp \ FrobHandle.cpp \ FrobLever.cpp \ FrobLock.cpp \ FrobLockHandle.cpp \ Grabber.cpp \ HidingSpotSearchCollection.cpp \ AbsenceMarker.cpp \ Intersection.cpp \ IniFile.cpp \ LightGem.cpp \ Liquid.cpp \ MaterialConverter.cpp \ MeleeWeapon.cpp \ ModMenu.cpp \ MultiStateMover.cpp \ MultiStateMoverButton.cpp \ MultiStateMoverPosition.cpp \ OverlaySys.cpp \ PositionWithinRangeFinder.cpp \ ProjectileResult.cpp \ PVSToAASMapping.cpp \ PickableLock.cpp \ Relations.cpp \ SndProp.cpp \ SndPropLoader.cpp \ TimerManager.cpp \ UserManager.cpp \ Inventory/Category.cpp \ Inventory/Cursor.cpp \ Inventory/Inventory.cpp \ Inventory/InventoryItem.cpp \ Inventory/WeaponItem.cpp \ Missions/Download.cpp \ Missions/DownloadManager.cpp \ Missions/MissionDB.cpp \ Missions/ModInfo.cpp \ Missions/ModInfoDecl.cpp \ Missions/MissionManager.cpp \ Objectives/CampaignStatistics.cpp \ Objectives/MissionData.cpp \ Objectives/MissionStatistics.cpp \ Objectives/Objective.cpp \ Objectives/ObjectiveComponent.cpp \ Objectives/ObjectiveCondition.cpp \ Objectives/ObjectiveLocation.cpp \ Http/HttpConnection.cpp \ Http/HttpRequest.cpp \ randomizer/mersenne.cpp \ randomizer/mother.cpp \ randomizer/ranrotb.cpp \ randomizer/ranrotw.cpp \ randomizer/userintf.cpp \ ZipLoader/ZipLoader.cpp \ pugixml/pugixml.cpp \ Shop/LootRuleSet.cpp \ Shop/Shop.cpp \ Shop/ShopItem.cpp \ StimResponse/Response.cpp \ StimResponse/ResponseEffect.cpp \ StimResponse/Stim.cpp \ StimResponse/StimResponse.cpp \ StimResponse/StimResponseCollection.cpp \ StimResponse/StimResponseTimer.cpp \ ai/AreaManager.cpp \ ai/CommunicationSubsystem.cpp \ ai/DoorInfo.cpp \ ai/Mind.cpp \ ai/Memory.cpp \ ai/MovementSubsystem.cpp \ ai/Subsystem.cpp \ ai/Conversation/ConversationSystem.cpp \ ai/Conversation/Conversation.cpp \ ai/Conversation/ConversationCommand.cpp \ ai/EAS/EAS.cpp \ ai/EAS/RouteInfo.cpp \ ai/EAS/RouteNode.cpp \ ai/States/AgitatedSearchingState.cpp \ ai/States/AlertIdleState.cpp \ ai/States/BlindedState.cpp \ ai/States/CombatState.cpp \ ai/States/AgitatedSearchingStateLanternBot.cpp \ ai/States/ConversationState.cpp \ ai/States/DeadState.cpp \ ai/States/EmergeFromCoverState.cpp \ ai/States/FailedKnockoutState.cpp \ ai/States/FleeState.cpp \ ai/States/FleeDoneState.cpp \ ai/States/IdleSleepState.cpp \ ai/States/IdleState.cpp \ ai/States/KnockedOutState.cpp \ ai/States/LostTrackOfEnemyState.cpp \ ai/States/ObservantState.cpp \ ai/States/PainState.cpp \ ai/States/SearchingState.cpp \ ai/States/State.cpp \ ai/States/StayInCoverState.cpp \ ai/States/SuspiciousState.cpp \ ai/States/SwitchOnLightState.cpp \ ai/States/ExamineRopeState.cpp \ ai/States/TakeCoverState.cpp \ ai/States/UnreachableTargetState.cpp \ ai/States/HitByMoveableState.cpp \ ai/Tasks/ChaseEnemyRangedTask.cpp \ ai/Tasks/ChaseEnemyTask.cpp \ ai/Tasks/CombatTask.cpp \ ai/Tasks/CommunicationTask.cpp \ ai/Tasks/CommWaitTask.cpp \ ai/Tasks/FleeTask.cpp \ ai/Tasks/FollowActorTask.cpp \ ai/Tasks/GreetingBarkTask.cpp \ ai/Tasks/HandleDoorTask.cpp \ ai/Tasks/HandleElevatorTask.cpp \ ai/Tasks/IdleAnimationTask.cpp \ ai/Tasks/InteractionTask.cpp \ ai/Tasks/InvestigateSpotTask.cpp \ ai/Tasks/MeleeCombatTask.cpp \ ai/Tasks/MoveToCoverTask.cpp \ ai/Tasks/MoveToPositionTask.cpp \ ai/Tasks/PathAnimTask.cpp \ ai/Tasks/PathCornerTask.cpp \ ai/Tasks/PathCycleAnimTask.cpp \ ai/Tasks/PathHideTask.cpp \ ai/Tasks/PathInteractTask.cpp \ ai/Tasks/PathLookatTask.cpp \ ai/Tasks/PathShowTask.cpp \ ai/Tasks/PathSitTask.cpp \ ai/Tasks/PathSleepTask.cpp \ ai/Tasks/PathTask.cpp \ ai/Tasks/PathTurnTask.cpp \ ai/Tasks/PathWaitForTriggerTask.cpp \ ai/Tasks/PathWaitTask.cpp \ ai/Tasks/PlayAnimationTask.cpp \ ai/Tasks/AnimalPatrolTask.cpp \ ai/Tasks/RandomHeadturnTask.cpp \ ai/Tasks/RandomTurningTask.cpp \ ai/Tasks/RangedCombatTask.cpp \ ai/Tasks/RepeatedBarkTask.cpp \ ai/Tasks/ResolveMovementBlockTask.cpp \ ai/Tasks/SingleBarkTask.cpp \ ai/Tasks/ScriptTask.cpp \ ai/Tasks/ThrowObjectTask.cpp \ ai/Tasks/WaitTask.cpp \ ai/Tasks/WanderInLocationTask.cpp \ SEED.cpp \ ModelGenerator.cpp \ ImageMapManager.cpp \ LightController.cpp \ StaticMulti.cpp \ RawVector.cpp' darkModList = scons_utils.BuildList('../../game/', darkModSrc) ziploader_list = SConscript( '../../sys/scons/SConscript.ziploader' ) local_env = g_game_env.Clone() # The game files use the game/precompiled_game.h header, make sure it can be found local_env.Prepend(CPPPATH = '#/game') local_env.Append( CPPDEFINES = [ 'GAME_DLL' ] ) local_env.Append( CPPFLAGS = [ '-Wno-deprecated', '-Winvalid-pch' ] ) # Link the runtime statically, link statically against libpng.a # the corresponding package libpng12-dev must be available on the system local_env.Append( LINKFLAGS = [ '-lrt', '-lpng' ] ) local_env.Append(LIBS = [ # Uncomment this if you're on a x64 system - there is no libpng.a on Ubuntu x64 for instance #File('/usr/lib32/libpng.so'), File('#/linux/libcurl/libcurl.a'), File('#/linux/boost/lib/libboost_filesystem.a'), File('#/linux/boost/lib/libboost_system.a'), File('#/linux/boost/lib/libboost_thread.a') ]) if NO_GCH == '0': # greebo: Set up our precompiled header GCH_CPPFLAGS = local_env['CPPFLAGS'] GCH_CPPFLAGS += ['-fPIC'] local_env['GchSh'] = local_env.GchSh('#game/precompiled_game.h', CPPFLAGS = GCH_CPPFLAGS)[0] # greebo: Use custom compiled devIL and libjpeg in Linux devil_list = SConscript( '../../sys/scons/SConscript.devil' ) libjpeg_list = SConscript( '../../sys/scons/SConscript.libjpeg' ) full_list = game_list + darkModList + idlib_objects + ziploader_list + devil_list + libjpeg_list ret = local_env.SharedLibrary('game', full_list ) Return( 'ret' )