Last active
January 22, 2016 16:01
-
-
Save AbigailBuccaneer/c3c26cacf2c036895b0b to your computer and use it in GitHub Desktop.
SConstruct won't find implicit dependencies on files which don't yet exist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "hello world!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dummy text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env = Environment() | |
# preprocess compiler.in to compiler | |
compiler = env.Command('compiler', 'compiler.in', 'cp $SOURCE $TARGET') | |
env['compiler'] = File(compiler)[0].abspath | |
# and then use that to compile foo.in | |
target = env.Command('foo', 'foo.in', '$compiler < $SOURCE > $TARGET') | |
Default(target) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ scons -c | |
scons: Reading SConscript files ... | |
scons: done reading SConscript files. | |
scons: Cleaning targets ... | |
scons: done cleaning targets. | |
$ scons | |
scons: Reading SConscript files ... | |
scons: done reading SConscript files. | |
scons: Building targets ... | |
/home/abigail/scons/compiler < foo.in > foo | |
sh: 1: /home/abigail/scons/compiler: not found | |
scons: *** [foo] Error 127 | |
scons: building terminated because of errors. | |
$ scons compiler | |
scons: Reading SConscript files ... | |
scons: done reading SConscript files. | |
scons: Building targets ... | |
cp compiler.in compiler | |
scons: done building targets. | |
$ scons | |
scons: Reading SConscript files ... | |
scons: done reading SConscript files. | |
scons: Building targets ... | |
/home/abigail/scons/compiler < foo.in > foo | |
scons: done building targets. | |
$ echo 'echo "more stuff"' >> compiler.in | |
$ scons | |
scons: Reading SConscript files ... | |
scons: done reading SConscript files. | |
scons: Building targets ... | |
cp compiler.in compiler | |
/home/abigail/scons/compiler < foo.in > foo | |
scons: done building targets. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment