Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Heafield <github@kheafield.com>2012-09-26 22:22:33 +0400
committerKenneth Heafield <github@kheafield.com>2012-09-26 22:22:33 +0400
commit9c990ee3a8e484df04c4d29918152087d967baa8 (patch)
treee9c195150fda1cab60eec08cf288230f2776b019 /jam-files
parent080585b5c47251b6dc5a3be3d6f608487572d8fd (diff)
parentbc866f37ff13251e9c8cf8548669f788449d9238 (diff)
Merge remote-tracking branch 'upstream/master'
Conflicts: moses/src/LM/Jamfile
Diffstat (limited to 'jam-files')
-rw-r--r--jam-files/sanity.jam47
1 files changed, 13 insertions, 34 deletions
diff --git a/jam-files/sanity.jam b/jam-files/sanity.jam
index 738316f89..e15a92dbc 100644
--- a/jam-files/sanity.jam
+++ b/jam-files/sanity.jam
@@ -235,42 +235,21 @@ rule add-post-hook ( names * ) {
post-hooks += $(names) ;
}
-
-#Backend for writing content to files after build completes.
-post-files = ;
-post-contents = ;
-rule save-post-build ( ok ? ) {
- if $(ok) {
- while $(post-files) {
- local ignored = @($(post-files[1]):E=$(post-contents[1])) ;
- post-files = $(post-files[2-]) ;
- post-contents = $(post-contents[2-]) ;
- }
- }
-}
-add-post-hook save-post-build ;
-
-#Queue content to be written to file when build completes successfully.
-rule add-post-write ( name content ) {
- post-files += $(name) ;
- post-contents += $(content) ;
+import feature : feature ;
+feature options-to-write : : free ;
+import toolset : flags ;
+flags write-options OPTIONS-TO-WRITE <options-to-write> ;
+actions write-options {
+ echo "$(OPTIONS-TO-WRITE)" > $(<) ;
}
-#Compare contents of file with current. If they're different, force the targets to rebuild then overwrite the file.
-rule always-if-changed ( file current : targets * ) {
- local previous = inconsistent ;
- if [ path.exists $(file) ] {
- previous = [ _shell "cat $(file)" ] ;
- }
- if $(current) != $(previous) {
- #Write inconsistent while the build is running
- if [ path.exists $(file) ] {
- local ignored = @($(file):E=inconsistent) ;
- }
- add-post-write $(file) $(current) ;
- for local i in $(targets) {
- always $(i) ;
- }
+#Compare contents of file with current. If they're different, write to the
+#file. This file can then be used with <dependency>$(file) to force
+#recompilation.
+rule update-if-changed ( file current ) {
+ if ( ! [ path.exists $(file) ] ) || ( [ _shell "cat $(file)" ] != $(current) ) {
+ make $(file) : : $(__name__).write-options : <options-to-write>$(current) ;
+ always $(file) ;
}
}