1 # SPDX-License-Identifier: MIT
3 # Copyright The SCons Foundation
6 Phony compiler 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 a *COM construction variable.
12 Calling convention is:
13 argv[1] the function of the script (cc, c++, as, link etc.)
14 argv[2] the output file to write
15 argv[3:] one or more input files to "compile"
17 Invocation often looks like:
18 Environment(CCCOM = r'%(_python_)s mycompile.py cc $TARGET $SOURCE', ...
25 skipline
= f
"/*{sys.argv[1]}*/\n".encode()
26 with
open(sys
.argv
[2], 'wb') as ofp
, fileinput
.input(files
=sys
.argv
[3:], mode
='rb') as ifp
:
32 if __name__
== '__main__':