AMBuildScript
author Nicholas Hastings <skamonkey@gmail.com>
Sat Feb 09 14:21:50 2013 -0500 (2013-02-09)
changeset 3776 eb6b82fb00f3
parent 3767 7223d0a452a8
child 3810 f0393f7c8a9e
permissions -rw-r--r--
Updated gdc-psyfork symbols.txt with support for ep1 (NPOTB).
     1 # vim: set ts=2 sw=2 tw=99 noet ft=python:
     2 import os
     3 import sys
     4 from ambuild.command import SymlinkCommand
     5 
     6 class SM:
     7 	def __init__(self):
     8 		self.compiler = Cpp.Compiler()
     9 
    10 		#Build SDK info
    11 		self.possibleSdks = { }
    12 		self.possibleSdks['ep1'] =   {'sdk': 'HL2SDK',          'ext': '1.ep1',   'def': '1',
    13 		                         'name': 'EPISODEONE',     'platform': ['windows', 'linux']}
    14 		self.possibleSdks['ep2'] =   {'sdk': 'HL2SDKOB',        'ext': '2.ep2',   'def': '3',
    15 		                         'name': 'ORANGEBOX',      'platform': ['windows', 'linux']}
    16 		self.possibleSdks['css'] =  {'sdk': 'HL2SDKCSS',   'ext': '2.css',  'def': '6',
    17 		                         'name': 'CSS', 'platform': ['windows', 'linux', 'darwin']}
    18 		self.possibleSdks['ep2v'] =  {'sdk': 'HL2SDKOBVALVE',   'ext': '2.ep2v',  'def': '7',
    19 		                         'name': 'ORANGEBOXVALVE', 'platform': ['windows', 'linux', 'darwin']}
    20 		self.possibleSdks['l4d'] =   {'sdk': 'HL2SDKL4D',       'ext': '2.l4d',   'def': '8',
    21 		                         'name': 'LEFT4DEAD',      'platform': ['windows', 'linux', 'darwin']}
    22 		self.possibleSdks['l4d2'] =  {'sdk': 'HL2SDKL4D2',      'ext': '2.l4d2',  'def': '9',
    23 		                         'name': 'LEFT4DEAD2',     'platform': ['windows', 'linux', 'darwin']}
    24 		self.possibleSdks['darkm'] = {'sdk': 'HL2SDK-DARKM',    'ext': '2.darkm', 'def': '2',
    25 		                         'name': 'DARKMESSIAH',    'platform': ['windows']}
    26 		self.possibleSdks['swarm'] = {'sdk': 'HL2SDK-SWARM',    'ext': '2.swarm', 'def': '10',
    27 		                         'name': 'ALIENSWARM',     'platform': ['windows']}
    28 		self.possibleSdks['bgt'] =   {'sdk': 'HL2SDK-BGT',      'ext': '2.bgt', 'def': '4',
    29 		                         'name': 'BLOODYGOODTIME', 'platform': ['windows']}
    30 		self.possibleSdks['eye'] =   {'sdk': 'HL2SDK-EYE',      'ext': '2.eye', 'def': '5',
    31 		                         'name': 'EYE', 'platform': ['windows']}
    32 		self.possibleSdks['csgo'] =  {'sdk': 'HL2SDKCSGO',     'ext': '2.csgo',  'def': '12',
    33 		                         'name': 'CSGO',           'platform': ['windows', 'linux', 'darwin']}
    34 		# self.possibleSdks['portal2'] =  {'sdk': 'HL2SDK-PORTAL2',     'ext': '2.portal2',  'def': '11',
    35 		#                          'name': 'PORTAL2',           'platform': ['windows']}
    36 		
    37 		self.sdkInfo = { }
    38 
    39 		if AMBuild.mode == 'config':
    40 			#Detect compilers
    41 			self.compiler.DetectAll(AMBuild)
    42 
    43 			#Detect variables
    44 			envvars = { 'MMSOURCE19':    'mmsource-1.9',
    45 									'HL2SDKCSS':     'hl2sdk-css',
    46 									'HL2SDKOBVALVE': 'hl2sdk-ob-valve',
    47 									'HL2SDKL4D':     'hl2sdk-l4d',
    48 									'HL2SDKL4D2':    'hl2sdk-l4d2',
    49 									'HL2SDKCSGO':    'hl2sdk-csgo',
    50 									'MYSQL5':        'mysql-5.0'
    51 			}
    52 
    53 			if AMBuild.target['platform'] != 'darwin':
    54 				envvars['HL2SDK'] = 'hl2sdk'
    55 				envvars['HL2SDKOB'] = 'hl2sdk-ob'
    56 
    57 			#Dark Messiah is Windows-only
    58 			if AMBuild.target['platform'] == 'windows':
    59 				envvars['HL2SDK-DARKM'] = 'hl2sdk-darkm'
    60 				envvars['HL2SDK-SWARM'] = 'hl2sdk-swarm'
    61 				envvars['HL2SDK-BGT']   = 'hl2sdk-bgt'
    62 				envvars['HL2SDK-EYE']   = 'hl2sdk-eye'
    63 
    64 			# Finds if a dict with `key` set to `value` is present on the dict of dicts `dictionary`
    65 			def findDictByKey(dictionary, key, value):
    66 				for index in dictionary:
    67 					elem = dictionary[index]
    68 					if elem[key] == value:
    69 						return (elem, index)
    70 				return None
    71 
    72 			for i in envvars:
    73 				if i in os.environ:
    74 					path = os.environ[i]
    75 					if not os.path.isdir(path):
    76 						raise Exception('Path for {0} was not found: {1}'.format(i, path))
    77 					elif i.startswith('HL2SDK'):
    78 						(info, sdk) = findDictByKey(self.possibleSdks, 'sdk', i)
    79 						self.sdkInfo[sdk] = info
    80 				else:
    81 					head = os.getcwd()
    82 					oldhead = None
    83 					while head != None and head != oldhead:
    84 						path = os.path.join(head, envvars[i])
    85 						if os.path.isdir(path):
    86 							break
    87 						oldhead = head
    88 						head, tail = os.path.split(head)
    89 					if i.startswith('HL2SDK'):
    90 						if head != None and head != oldhead:
    91 							(info, sdk) = findDictByKey(self.possibleSdks, 'sdk', i)
    92 							self.sdkInfo[sdk] = info
    93 					elif head == None or head == oldhead:
    94 						raise Exception('Could not find a valid path for {0}'.format(i))
    95 				AMBuild.cache.CacheVariable(i, path)
    96 
    97 			if len(self.sdkInfo) < 1:
    98 				raise Exception('At least one SDK must be available.')
    99 				
   100 			AMBuild.cache.CacheVariable('sdkInfo', self.sdkInfo)
   101 
   102 			#Set up defines
   103 			cxx = self.compiler.cxx
   104 			if isinstance(cxx, Cpp.CompatGCC):
   105 				if isinstance(cxx, Cpp.GCC):
   106 					self.vendor = 'gcc'
   107 				elif isinstance(cxx, Cpp.Clang):
   108 					self.vendor = 'clang'
   109 				self.compiler.AddToListVar('CDEFINES', 'stricmp=strcasecmp')
   110 				self.compiler.AddToListVar('CDEFINES', '_stricmp=strcasecmp')
   111 				self.compiler.AddToListVar('CDEFINES', '_snprintf=snprintf')
   112 				self.compiler.AddToListVar('CDEFINES', '_vsnprintf=vsnprintf')
   113 				self.compiler.AddToListVar('CFLAGS', '-pipe')
   114 				self.compiler.AddToListVar('CFLAGS', '-fno-strict-aliasing')
   115 				if (self.vendor == 'gcc' and cxx.majorVersion >= 4) or self.vendor == 'clang':
   116 					self.compiler.AddToListVar('CFLAGS', '-fvisibility=hidden')
   117 					self.compiler.AddToListVar('CXXFLAGS', '-fvisibility-inlines-hidden')
   118 				self.compiler.AddToListVar('CFLAGS', '-Wall')
   119 				self.compiler.AddToListVar('CFLAGS', '-Werror')
   120 				self.compiler.AddToListVar('CFLAGS', '-Wno-uninitialized')
   121 				self.compiler.AddToListVar('CFLAGS', '-Wno-unused')
   122 				self.compiler.AddToListVar('CFLAGS', '-Wno-switch')
   123 				self.compiler.AddToListVar('CFLAGS', '-msse')
   124 				self.compiler.AddToListVar('CFLAGS', '-m32')
   125 				self.compiler.AddToListVar('POSTLINKFLAGS', '-m32')
   126 				self.compiler.AddToListVar('CXXFLAGS', '-fno-exceptions')
   127 				self.compiler.AddToListVar('CXXFLAGS', '-fno-threadsafe-statics')
   128 				self.compiler.AddToListVar('CXXFLAGS', '-Wno-non-virtual-dtor')
   129 				self.compiler.AddToListVar('CXXFLAGS', '-Wno-overloaded-virtual')
   130 				if (self.vendor == 'gcc' and cxx.majorVersion >= 4 and cxx.minorVersion >= 7) or \
   131 						(self.vendor == 'clang' and cxx.majorVersion >= 3):
   132 					self.compiler.AddToListVar('CXXFLAGS', '-Wno-delete-non-virtual-dtor')
   133 				self.compiler.AddToListVar('CDEFINES', 'HAVE_STDINT_H')
   134 				self.compiler.AddToListVar('CDEFINES', 'GNUC')
   135 				if self.vendor == 'gcc':
   136 					self.compiler.AddToListVar('CFLAGS', '-mfpmath=sse')
   137 			elif isinstance(cxx, Cpp.MSVC):
   138 				self.vendor = 'msvc'
   139 				if AMBuild.options.debug == '1':
   140 					self.compiler.AddToListVar('CFLAGS', '/MTd')
   141 					self.compiler.AddToListVar('POSTLINKFLAGS', '/NODEFAULTLIB:libcmt')
   142 				else:
   143 					self.compiler.AddToListVar('CFLAGS', '/MT')
   144 				self.compiler.AddToListVar('CDEFINES', '_CRT_SECURE_NO_DEPRECATE')
   145 				self.compiler.AddToListVar('CDEFINES', '_CRT_SECURE_NO_WARNINGS')
   146 				self.compiler.AddToListVar('CDEFINES', '_CRT_NONSTDC_NO_DEPRECATE')
   147 				self.compiler.AddToListVar('CXXFLAGS', '/EHsc')
   148 				self.compiler.AddToListVar('CXXFLAGS', '/GR-')
   149 				self.compiler.AddToListVar('CFLAGS', '/W3')
   150 				self.compiler.AddToListVar('CFLAGS', '/nologo')
   151 				self.compiler.AddToListVar('CFLAGS', '/Zi')
   152 				self.compiler.AddToListVar('CXXFLAGS', '/TP')
   153 				self.compiler.AddToListVar('POSTLINKFLAGS', '/DEBUG')
   154 				self.compiler.AddToListVar('POSTLINKFLAGS', '/MACHINE:X86')
   155 				self.compiler.AddToListVar('POSTLINKFLAGS', '/SUBSYSTEM:WINDOWS')
   156 				self.compiler.AddToListVar('POSTLINKFLAGS', 'kernel32.lib')
   157 				self.compiler.AddToListVar('POSTLINKFLAGS', 'user32.lib')
   158 				self.compiler.AddToListVar('POSTLINKFLAGS', 'gdi32.lib')
   159 				self.compiler.AddToListVar('POSTLINKFLAGS', 'winspool.lib')
   160 				self.compiler.AddToListVar('POSTLINKFLAGS', 'comdlg32.lib')
   161 				self.compiler.AddToListVar('POSTLINKFLAGS', 'advapi32.lib')
   162 				self.compiler.AddToListVar('POSTLINKFLAGS', 'shell32.lib')
   163 				self.compiler.AddToListVar('POSTLINKFLAGS', 'ole32.lib')
   164 				self.compiler.AddToListVar('POSTLINKFLAGS', 'oleaut32.lib')
   165 				self.compiler.AddToListVar('POSTLINKFLAGS', 'uuid.lib')
   166 				self.compiler.AddToListVar('POSTLINKFLAGS', 'odbc32.lib')
   167 				self.compiler.AddToListVar('POSTLINKFLAGS', 'odbccp32.lib')
   168 
   169 			#Optimization
   170 			if AMBuild.options.opt == '1':
   171 				self.compiler.AddToListVar('CDEFINES', 'NDEBUG')
   172 				if self.vendor == 'gcc' or self.vendor == 'clang':
   173 					self.compiler.AddToListVar('CFLAGS', '-O3')
   174 				elif self.vendor == 'msvc':
   175 					self.compiler.AddToListVar('CFLAGS', '/Ox')
   176 					self.compiler.AddToListVar('POSTLINKFLAGS', '/OPT:ICF')
   177 					self.compiler.AddToListVar('POSTLINKFLAGS', '/OPT:REF')
   178 
   179 			#Debugging
   180 			if AMBuild.options.debug == '1':
   181 				self.compiler.AddToListVar('CDEFINES', 'DEBUG')
   182 				self.compiler.AddToListVar('CDEFINES', '_DEBUG')
   183 				if self.vendor == 'gcc' or self.vendor == 'clang':
   184 					self.compiler.AddToListVar('CFLAGS', '-g3')
   185 				elif self.vendor == 'msvc':
   186 					self.compiler.AddToListVar('CFLAGS', '/Od')
   187 					self.compiler.AddToListVar('CFLAGS', '/RTC1')
   188 
   189 			#Platform-specifics
   190 			if AMBuild.target['platform'] == 'linux':
   191 				self.compiler.AddToListVar('CDEFINES', '_LINUX')
   192 				if self.vendor == 'gcc':
   193 					self.compiler.AddToListVar('POSTLINKFLAGS', '-static-libgcc')
   194 				if self.vendor == 'clang':
   195 					self.compiler.AddToListVar('POSTLINKFLAGS', '-lgcc_eh')
   196 			elif AMBuild.target['platform'] == 'darwin':
   197 				self.compiler.AddToListVar('CDEFINES', 'OSX')
   198 				self.compiler.AddToListVar('CDEFINES', '_OSX')
   199 				self.compiler.AddToListVar('POSTLINKFLAGS', '-mmacosx-version-min=10.5')
   200 				self.compiler.AddToListVar('POSTLINKFLAGS', ['-arch', 'i386'])
   201 				self.compiler.AddToListVar('POSTLINKFLAGS', '-lstdc++')
   202 
   203 				# For OS X dylib versioning
   204 				import re
   205 				productFile = open(os.path.join(AMBuild.sourceFolder, 'product.version'), 'r')
   206 				productContents = productFile.read()
   207 				productFile.close()
   208 				m = re.match('(\d+)\.(\d+)\.(\d+).*', productContents)
   209 				if m == None:
   210 					self.version = '1.0.0'
   211 				else:
   212 					major, minor, release = m.groups()
   213 					self.version = '{0}.{1}.{2}'.format(major, minor, release)
   214 				AMBuild.cache.CacheVariable('version', self.version)
   215 			elif AMBuild.target['platform'] == 'windows':
   216 				self.compiler.AddToListVar('CDEFINES', 'WIN32')
   217 				self.compiler.AddToListVar('CDEFINES', '_WINDOWS')
   218 
   219 			#Finish up
   220 			self.compiler.AddToListVar('CDEFINES', 'SOURCEMOD_BUILD')
   221 			self.compiler.AddToListVar('CDEFINES', 'SM_GENERATED_BUILD')
   222 			self.compiler.AddToListVar('CINCLUDES',
   223 			                           os.path.join(AMBuild.outputFolder, 'includes'))
   224 			self.compiler.ToConfig(AMBuild, 'compiler')
   225 			AMBuild.cache.CacheVariable('vendor', self.vendor)
   226 			self.targetMap = { }
   227 			AMBuild.cache.CacheVariable('targetMap', self.targetMap)
   228 		else:
   229 			self.sdkInfo = AMBuild.cache['sdkInfo']
   230 			self.compiler.FromConfig(AMBuild, 'compiler')
   231 			self.targetMap = AMBuild.cache['targetMap']
   232 
   233 		if AMBuild.target['platform'] == 'windows':
   234 			self.compiler.AddToListVar('RCINCLUDES', os.path.join(AMBuild.sourceFolder, 'public'))
   235 			self.compiler.AddToListVar('RCINCLUDES',
   236 			                           os.path.join(AMBuild.outputFolder, 'includes'))
   237 		self.mmsPath = AMBuild.cache['MMSOURCE19']
   238 
   239 	def DefaultCompiler(self):
   240 		return self.compiler.Clone()
   241 
   242 	def JobMatters(self, jobname):
   243 		file = sys._getframe().f_code.co_filename
   244 		if AMBuild.mode == 'config':
   245 			self.targetMap[jobname] = file
   246 			return True
   247 		if len(AMBuild.args) == 0:
   248 			return True
   249 		if not jobname in AMBuild.args:
   250 			return False
   251 
   252 	def DefaultExtCompiler(self, path):
   253 		compiler = self.DefaultCompiler()
   254 		compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, path))
   255 		compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, path, 'sdk'))
   256 		compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public'))
   257 		compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'extensions'))
   258 		compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'sourcepawn'))
   259 		return compiler
   260 
   261 	def AutoVersion(self, folder, binary):
   262 		if AMBuild.target['platform'] == 'windows':
   263 			env = {'RCDEFINES': ['BINARY_NAME="' + binary.binaryFile + '"', 'SM_GENERATED_BUILD']}
   264 			binary.AddResourceFile(os.path.join(folder, 'version.rc' ), env)
   265 		elif AMBuild.target['platform'] == 'darwin' and isinstance(binary, Cpp.LibraryBuilder):
   266 			binary.compiler['POSTLINKFLAGS'].extend(['-compatibility_version', '1.0.0'])
   267 			binary.compiler['POSTLINKFLAGS'].extend(['-current_version', AMBuild.cache['version']])
   268 		else:
   269 			return
   270 
   271 	def PreSetupHL2Job(self, job, builder, sdk):
   272 		info = self.sdkInfo[sdk]
   273 		sdkPath = AMBuild.cache[info['sdk']]
   274 		if AMBuild.target['platform'] == 'linux':
   275 			if sdk == 'ep1':
   276 				staticLibs = os.path.join(sdkPath, 'linux_sdk')
   277 			else:
   278 				staticLibs = os.path.join(sdkPath, 'lib', 'linux')
   279 			workFolder = os.path.join(AMBuild.outputFolder, job.workFolder)
   280 			if sdk in ['ep2v', 'css']:
   281 				libs = ['tier1_i486.a', 'mathlib_i486.a', 'libvstdlib_srv.so', 'libtier0_srv.so']
   282 				for lib in libs:
   283 					link = os.path.join(workFolder, lib)
   284 					target = os.path.join(staticLibs, lib)
   285 					try:
   286 						os.lstat(link)
   287 					except:
   288 						job.AddCommand(SymlinkCommand(link, target))
   289 			elif sdk in ['l4d', 'l4d2', 'csgo']:
   290 				libs = ['tier1_i486.a', 'mathlib_i486.a', 'libvstdlib.so', 'libtier0.so']
   291 				if sdk == 'csgo':
   292 					libs.append('interfaces_i486.a')
   293 				for lib in libs:
   294 					link = os.path.join(workFolder, lib)
   295 					target = os.path.join(staticLibs, lib)
   296 					try:
   297 						os.lstat(link)
   298 					except:
   299 						job.AddCommand(SymlinkCommand(link, target))
   300 			else:
   301 				libs = ['tier1_i486.a', 'mathlib_i486.a', 'vstdlib_i486.so', 'tier0_i486.so']
   302 				for lib in libs:
   303 					link = os.path.join(workFolder, lib)
   304 					target = os.path.join(staticLibs, lib)
   305 					try:
   306 						os.lstat(link)
   307 					except:
   308 						job.AddCommand(SymlinkCommand(link, target))
   309 		elif AMBuild.target['platform'] == 'darwin':
   310 			staticLibs = os.path.join(sdkPath, 'lib', 'mac')
   311 			workFolder = os.path.join(AMBuild.outputFolder, job.workFolder)
   312 			libs = ['tier1_i486.a', 'mathlib_i486.a', 'libvstdlib.dylib', 'libtier0.dylib']
   313 			if sdk == 'csgo':
   314 				libs.append('interfaces_i486.a')
   315 			for lib in libs:
   316 				link = os.path.join(workFolder, lib)
   317 				target = os.path.join(staticLibs, lib)
   318 				try:
   319 					os.lstat(link)
   320 				except:
   321 					job.AddCommand(SymlinkCommand(link, target))
   322 		elif AMBuild.target['platform'] == 'windows':
   323 			libs = ['tier0', 'tier1', 'vstdlib', 'mathlib']
   324 			if sdk in ['swarm', 'csgo']:
   325 				libs.append('interfaces')
   326 			for lib in libs:
   327 				libPath = os.path.join(sdkPath, 'lib', 'public', lib) + '.lib'
   328 				builder.RebuildIfNewer(libPath)
   329 				builder['POSTLINKFLAGS'].append(libPath)
   330 
   331 	def PostSetupHL2Job(self, job, builder, sdk):
   332 		if AMBuild.target['platform'] in ['linux', 'darwin']:
   333 			builder.AddObjectFiles(['tier1_i486.a', 'mathlib_i486.a'])
   334 			if sdk == 'csgo':
   335 				builder.AddObjectFiles(['interfaces_i486.a'])
   336 	
   337 	def DefaultHL2Compiler(self, path, sdk, noLink = False, oldMms = '-legacy'):
   338 		compiler = self.DefaultExtCompiler(path)
   339 
   340 		mms = 'core'
   341 		if sdk == 'ep1':
   342 			mms += oldMms
   343 
   344 		compiler['CXXINCLUDES'].append(os.path.join(self.mmsPath, mms))
   345 		compiler['CXXINCLUDES'].append(os.path.join(self.mmsPath, mms, 'sourcehook'))
   346 
   347 		info = self.possibleSdks
   348 		compiler['CDEFINES'].extend(['SE_' + info[i]['name'] + '=' + info[i]['def'] for i in info])
   349 				
   350 		# We don't build for Portal 2 (yet?, ever?), but using this define in code as 
   351 		# it saves trouble if we ever need to
   352 		compiler['CDEFINES'].append('SE_PORTAL2=11')
   353 
   354 		paths = [['public'], ['public', 'engine'], ['public', 'mathlib'], ['public', 'vstdlib'],
   355 						 ['public', 'tier0'], ['public', 'tier1']]
   356 		if sdk == 'ep1' or sdk == 'darkm':
   357 			paths.append(['public', 'dlls'])
   358 			paths.append(['game_shared'])
   359 		else:
   360 			paths.append(['public', 'game', 'server'])
   361 			paths.append(['public', 'toolframework'])
   362 			paths.append(['game', 'shared'])
   363 			paths.append(['common'])
   364 
   365 		info = self.sdkInfo[sdk]
   366 		sdkPath = AMBuild.cache[info['sdk']]
   367 
   368 		compiler['CDEFINES'].append('SOURCE_ENGINE=' + info['def'])
   369 
   370 		if sdk in ['swarm','csgo']:
   371 			if AMBuild.target['platform'] == 'windows':
   372 				compiler['CDEFINES'].extend(['COMPILER_MSVC', 'COMPILER_MSVC32'])
   373 			else:
   374 				compiler['CDEFINES'].extend(['COMPILER_GCC', 'POSIX'])
   375 
   376 		if sdk == 'ep1':
   377 			if AMBuild.target['platform'] == 'linux':
   378 				staticLibs = os.path.join(sdkPath, 'linux_sdk')
   379 		else:
   380 			if AMBuild.target['platform'] == 'linux':
   381 				staticLibs = os.path.join(sdkPath, 'lib', 'linux')
   382 			elif AMBuild.target['platform'] == 'darwin':
   383 				staticLibs = os.path.join(sdkPath, 'lib', 'mac')
   384 
   385 		for i in paths:
   386 			compiler['CXXINCLUDES'].append(os.path.join(sdkPath, *i))
   387 
   388 		if not noLink:
   389 			if AMBuild.target['platform'] == 'linux':
   390 				compiler['POSTLINKFLAGS'][0:0] = ['-lm']
   391 				if sdk in ['ep2v', 'css']:
   392 					compiler['POSTLINKFLAGS'][0:0] = ['libtier0_srv.so']
   393 					compiler['POSTLINKFLAGS'][0:0] = ['libvstdlib_srv.so']
   394 				elif sdk in ['l4d', 'l4d2', 'csgo']:
   395 					compiler['POSTLINKFLAGS'][0:0] = ['libtier0.so']
   396 					compiler['POSTLINKFLAGS'][0:0] = ['libvstdlib.so']
   397 				else:
   398 					compiler['POSTLINKFLAGS'][0:0] = ['tier0_i486.so']
   399 					compiler['POSTLINKFLAGS'][0:0] = ['vstdlib_i486.so']
   400 			elif AMBuild.target['platform'] == 'darwin':
   401 				compiler['POSTLINKFLAGS'][0:0] = ['libtier0.dylib']
   402 				compiler['POSTLINKFLAGS'][0:0] = ['libvstdlib.dylib']
   403 
   404 		return compiler
   405 
   406 sm = SM()
   407 globals = {
   408 	'SM': sm
   409 }
   410 
   411 AMBuild.Include(os.path.join('tools', 'buildbot', 'Versioning'), globals)
   412 
   413 FileList = [
   414 		['loader', 'AMBuilder'],
   415 		['core', 'AMBuilder'],
   416 		['core', 'logic', 'AMBuilder'],
   417 		['extensions', 'bintools', 'AMBuilder'],
   418 		['extensions', 'clientprefs', 'AMBuilder'],
   419 		['extensions', 'cstrike', 'AMBuilder'],
   420 		['extensions', 'curl', 'AMBuilder'],
   421 		['extensions', 'geoip', 'AMBuilder'],
   422 		['extensions', 'mysql', 'AMBuilder'],
   423 		['extensions', 'sdkhooks', 'AMBuilder'],
   424 		['extensions', 'sdktools', 'AMBuilder'],
   425 		['extensions', 'topmenus', 'AMBuilder'],
   426 		['extensions', 'updater', 'AMBuilder'],
   427 		['extensions', 'sqlite', 'AMBuilder'],
   428 		['extensions', 'regex', 'AMBuilder'],
   429 		['extensions', 'tf2', 'AMBuilder'],
   430 		['sourcepawn', 'jit', 'AMBuilder'],
   431 		['sourcepawn', 'compiler', 'AMBuilder'],
   432 		['plugins', 'AMBuilder'],
   433 		['tools', 'buildbot', 'PackageScript'],
   434 		['tools', 'buildbot', 'BreakpadSymbols']
   435 	]
   436 
   437 for parts in FileList:
   438 	AMBuild.Include(os.path.join(*parts), globals)
   439