sourcepawn/compiler/AMBuilder
changeset 2784 8903397125e6
child 2983 203dff816df1
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/sourcepawn/compiler/AMBuilder	Sun Aug 30 00:46:56 2009 -0700
     1.3 @@ -0,0 +1,64 @@
     1.4 +# vim: set ts=2 sw=2 tw=99 noet ft=python: 
     1.5 +import os
     1.6 +
     1.7 +compiler = SM.DefaultCompiler()
     1.8 +compiler['CINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public'))
     1.9 +compiler['CINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'sourcepawn'))
    1.10 +compiler['CINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'sourcepawn', 'compiler'))
    1.11 +compiler['CINCLUDES'].append(os.path.join(AMBuild.outputFolder, 'includes'))
    1.12 +
    1.13 +if compiler.cc.name == 'gcc':
    1.14 +	compiler['CFLAGS'].extend(['-Wno-parentheses', '-Wno-format'])
    1.15 +	compiler['POSTLINKFLAGS'].extend(['-lgcc', '-lm'])
    1.16 +elif compiler.cc.name == 'msvc':
    1.17 +	compiler['POSTLINKFLAGS'].remove('/SUBSYSTEM:WINDOWS')
    1.18 +	compiler['POSTLINKFLAGS'].append('/SUBSYSTEM:CONSOLE')
    1.19 +
    1.20 +if AMBuild.target['platform'] == 'linux':
    1.21 +	compiler['CDEFINES'].extend(['LINUX', 'HAVE_STDINT_H', 'AMX_ANSIONLY', 'ENABLE_BINRELOC'])
    1.22 +
    1.23 +extension = AMBuild.AddJob('spcomp')
    1.24 +binary = Cpp.ExecutableBuilder('spcomp', AMBuild, extension, compiler)
    1.25 +files = [
    1.26 +	'libpawnc.c',
    1.27 +	'lstring.c',
    1.28 +	'memfile.c',
    1.29 +	'pawncc.c',
    1.30 +	'sc1.c',
    1.31 +	'sc2.c',
    1.32 +	'sc3.c',
    1.33 +	'sc4.c',
    1.34 +	'sc5.c',
    1.35 +	'sc6.c',
    1.36 +	'sc7.c',
    1.37 +	'scexpand.c',
    1.38 +	'sci18n.c',
    1.39 +	'sclist.c',
    1.40 +	'scmemfil.c',
    1.41 +	'scstate.c',
    1.42 +	'sctracker.c',
    1.43 +	'scvars.c',
    1.44 +	'sp_file.c',
    1.45 +	'zlib/adler32.c',
    1.46 +	'zlib/compress.c',
    1.47 +	'zlib/crc32.c',
    1.48 +	'zlib/deflate.c',
    1.49 +	'zlib/gzio.c',
    1.50 +	'zlib/infback.c',
    1.51 +	'zlib/inffast.c',
    1.52 +	'zlib/inflate.c',
    1.53 +	'zlib/inftrees.c',
    1.54 +	'zlib/trees.c',
    1.55 +	'zlib/uncompr.c',
    1.56 +	'zlib/zutil.c'
    1.57 +	]
    1.58 +if AMBuild.target['platform'] == 'linux':
    1.59 +	files.append('binreloc.c')
    1.60 +binary.AddSourceFiles('sourcepawn/compiler', files)
    1.61 +
    1.62 +if AMBuild.target['platform'] == 'windows':
    1.63 +	env = {'RCDEFINES': ['BINARY_NAME="' + binary.binaryFile + '"']}
    1.64 +	binary.AddResourceFile('sourcepawn/compiler/libpawnc.rc', env)
    1.65 +
    1.66 +binary.SendToJob()
    1.67 +