69 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			69 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
| # vim: set ts=2 sw=2 tw=99 noet ft=python: 
 | |
| import os
 | |
| 
 | |
| compiler = SM.DefaultCompiler()
 | |
| compiler['CINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public'))
 | |
| compiler['CINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'sourcepawn'))
 | |
| compiler['CINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'sourcepawn', 'compiler'))
 | |
| compiler['CINCLUDES'].append(os.path.join(AMBuild.outputFolder, 'includes'))
 | |
| 
 | |
| if compiler.cc.name == 'gcc':
 | |
| 	compiler['CFLAGS'].extend(['-Wno-parentheses', '-Wno-format'])
 | |
| 	if AMBuild.target['platform'] == 'linux':
 | |
| 		compiler['POSTLINKFLAGS'].extend(['-lgcc', '-lm'])
 | |
| elif compiler.cc.name == 'msvc':
 | |
| 	compiler['POSTLINKFLAGS'].remove('/SUBSYSTEM:WINDOWS')
 | |
| 	compiler['POSTLINKFLAGS'].append('/SUBSYSTEM:CONSOLE')
 | |
| 
 | |
| if AMBuild.target['platform'] == 'linux':
 | |
| 	compiler['CDEFINES'].extend(['LINUX', 'HAVE_STDINT_H', 'AMX_ANSIONLY', 'ENABLE_BINRELOC'])
 | |
| elif AMBuild.target['platform'] == 'darwin':
 | |
| 	compiler['CDEFINES'].extend(['DARWIN', 'HAVE_STDINT_H', 'AMX_ANSIONLY', 'ENABLE_BINRELOC'])
 | |
| 
 | |
| extension = AMBuild.AddJob('spcomp')
 | |
| binary = Cpp.ExecutableBuilder('spcomp', AMBuild, extension, compiler)
 | |
| files = [
 | |
| 	'libpawnc.c',
 | |
| 	'lstring.c',
 | |
| 	'memfile.c',
 | |
| 	'pawncc.c',
 | |
| 	'sc1.c',
 | |
| 	'sc2.c',
 | |
| 	'sc3.c',
 | |
| 	'sc4.c',
 | |
| 	'sc5.c',
 | |
| 	'sc6.c',
 | |
| 	'sc7.c',
 | |
| 	'scexpand.c',
 | |
| 	'sci18n.c',
 | |
| 	'sclist.c',
 | |
| 	'scmemfil.c',
 | |
| 	'scstate.c',
 | |
| 	'sctracker.c',
 | |
| 	'scvars.c',
 | |
| 	'sp_file.c',
 | |
| 	'zlib/adler32.c',
 | |
| 	'zlib/compress.c',
 | |
| 	'zlib/crc32.c',
 | |
| 	'zlib/deflate.c',
 | |
| 	'zlib/gzio.c',
 | |
| 	'zlib/infback.c',
 | |
| 	'zlib/inffast.c',
 | |
| 	'zlib/inflate.c',
 | |
| 	'zlib/inftrees.c',
 | |
| 	'zlib/trees.c',
 | |
| 	'zlib/uncompr.c',
 | |
| 	'zlib/zutil.c',
 | |
| 	'sp_symhash.c'
 | |
| 	]
 | |
| if AMBuild.target['platform'] == 'linux':
 | |
| 	files.append('binreloc.c')
 | |
| binary.AddSourceFiles('sourcepawn/compiler', files)
 | |
| 
 | |
| if AMBuild.target['platform'] == 'windows':
 | |
| 	env = {'RCDEFINES': ['BINARY_NAME="' + binary.binaryFile + '"']}
 | |
| 	binary.AddResourceFile('sourcepawn/compiler/libpawnc.rc', env)
 | |
| 
 | |
| binary.SendToJob()
 | |
| 
 |