| 1 |
target = 'System' |
| 2 |
|
| 3 |
files = Split(""" |
| 4 |
Source/Buffers.c |
| 5 |
Source/Plugin.c |
| 6 |
Source/System.c |
| 7 |
""") |
| 8 |
|
| 9 |
libs = Split(""" |
| 10 |
kernel32 |
| 11 |
user32 |
| 12 |
ole32 |
| 13 |
""") |
| 14 |
|
| 15 |
examples = Split(""" |
| 16 |
Resource.dll |
| 17 |
System.nsi |
| 18 |
System.nsh |
| 19 |
SysFunc.nsh |
| 20 |
""") |
| 21 |
|
| 22 |
docs = Split(""" |
| 23 |
System.html |
| 24 |
WhatsNew.txt |
| 25 |
""") |
| 26 |
|
| 27 |
Import('BuildPlugin env') |
| 28 |
|
| 29 |
defs = ['SYSTEM_EXPORTS'] |
| 30 |
msvc = 'msvc' in env['TOOLS'] or 'mstoolkit' in env['TOOLS'] |
| 31 |
|
| 32 |
srcsuff = '' |
| 33 |
if env['TARGET_ARCH'] != 'x86': |
| 34 |
srcsuff = '-' + env['TARGET_ARCH'] |
| 35 |
defs += ['SYSTEM_NOCALLBACKS'] # BUGBUG: Remove this when CallBack() is implemented |
| 36 |
filename = 'Call' + srcsuff |
| 37 |
|
| 38 |
src_ascpp = """ |
| 39 |
#if 0 /* a C style comment */ |
| 40 |
ERROR: assembler-with-cpp required! |
| 41 |
#else |
| 42 |
.end |
| 43 |
#endif |
| 44 |
""" |
| 45 |
conf = env.Configure() |
| 46 |
if conf.TryCompile('END', '.S'): |
| 47 |
files += ['Source/'+filename+'.S'] |
| 48 |
elif (not msvc) and conf.TryCompile(src_ascpp, '.S'): |
| 49 |
files += ['Source/'+filename+'CPP.S'] |
| 50 |
elif (not msvc) and conf.TryCompile(src_ascpp, '.sx'): |
| 51 |
files += ['Source/'+filename+'CPP.sx'] |
| 52 |
else: |
| 53 |
print('WARNING: System.dll: unable to find assembler for '+filename+'.S') |
| 54 |
conf.Finish() |
| 55 |
|
| 56 |
BuildPlugin( |
| 57 |
target, |
| 58 |
files, |
| 59 |
libs, |
| 60 |
examples, |
| 61 |
docs, |
| 62 |
nodeflib = False, |
| 63 |
defines = defs |
| 64 |
) |
| 65 |
|
| 66 |
res = 'Resource/Resource.rc' |
| 67 |
res_obj = 'Resource/Resource-rc.o' |
| 68 |
res_target = env.RES(res_obj, res) |
| 69 |
|
| 70 |
res_main = env.Object('Resource/Main.c') |
| 71 |
|
| 72 |
resources = Split(""" |
| 73 |
Resource/Icon.ico |
| 74 |
Resource/Resource.h |
| 75 |
""") |
| 76 |
|
| 77 |
env.Depends(res_target, resources) |
| 78 |
|
| 79 |
resource = env.SharedLibrary('Resource', res_target + res_main) |
| 80 |
env.MakeReproducible(resource) |