1 # SPDX-License-Identifier: MIT
3 # Copyright The SCons Foundation
6 Phony linker for testing SCons.
8 Copies its source files to the target file, dropping lines that match
9 a pattern, so we can recognize the tool has made a modification.
10 Intended for use as the $LINK construction variable.
17 opts
, args
= getopt
.getopt(sys
.argv
[1:], 'o:s:')
22 with
open(out
, 'wb') as ofp
, fileinput
.input(files
=args
, mode
='rb') as ifp
:
24 if not line
.startswith(b
'#link'):
27 def fake_win32_link():
35 if arg
[0] not in '/-':
38 if arg
.lower().startswith('/out:'):
40 with
open(args
[0], 'rb') as ifp
, open(out
, 'wb') as ofp
:
42 if not line
.startswith(b
'#link'):
45 if __name__
== '__main__':
46 if sys
.platform
== 'win32':