| author | Ruben Gonzalez <drifter01620@gmail.com> |
| Thu May 22 09:49:27 2014 -0400 (2014-05-22) | |
| changeset 4378 | 568f4497ef4a |
| parent 4241 | 46fdb8cd9883 |
| permissions | -rw-r--r-- |
1 # vim: set ts=2 sw=2 tw=99 noet ft=python:
2 import os
4 binary = SM.Program(builder, 'spcomp')
5 compiler = binary.compiler
6 compiler.includes += [
7 os.path.join(builder.sourcePath, 'public'),
8 os.path.join(builder.sourcePath, 'public', 'sourcepawn'),
9 os.path.join(builder.sourcePath, 'sourcepawn', 'compiler'),
10 os.path.join(builder.buildPath, 'includes'),
11 ]
13 if compiler.cc.behavior == 'gcc':
14 compiler.cflags += ['-Wno-format']
15 if builder.target_platform == 'linux':
16 compiler.postlink += ['-lgcc', '-lm']
17 elif compiler.cc.behavior == 'msvc':
18 compiler.linkflags.remove('/SUBSYSTEM:WINDOWS')
19 compiler.linkflags.append('/SUBSYSTEM:CONSOLE')
21 if builder.target_platform == 'linux':
22 compiler.defines += [
23 'LINUX',
24 'HAVE_STDINT_H',
25 'AMX_ANSIONLY',
26 'ENABLE_BINRELOC',
27 '_GNU_SOURCE'
28 ]
29 elif builder.target_platform == 'mac':
30 compiler.defines += [
31 'DARWIN',
32 'HAVE_STDINT_H',
33 'AMX_ANSIONLY',
34 'ENABLE_BINRELOC',
35 'HAVE_SAFESTR'
36 ]
38 binary.sources += [
39 'libpawnc.c',
40 'lstring.c',
41 'memfile.c',
42 'pawncc.c',
43 'sc1.c',
44 'sc2.c',
45 'sc3.c',
46 'sc4.c',
47 'sc5.c',
48 'sc6.c',
49 'sc7.c',
50 'scexpand.c',
51 'sci18n.c',
52 'sclist.c',
53 'scmemfil.c',
54 'scstate.c',
55 'sctracker.c',
56 'scvars.c',
57 'sp_file.c',
58 'zlib/adler32.c',
59 'zlib/compress.c',
60 'zlib/crc32.c',
61 'zlib/deflate.c',
62 'zlib/gzio.c',
63 'zlib/infback.c',
64 'zlib/inffast.c',
65 'zlib/inflate.c',
66 'zlib/inftrees.c',
67 'zlib/trees.c',
68 'zlib/uncompr.c',
69 'zlib/zutil.c',
70 'sp_symhash.c'
71 ]
72 if builder.target_platform == 'linux':
73 binary.sources.append('binreloc.c')
75 SM.spcomp = builder.Add(binary)