From 7d949a215ad3e4d5be0e846fd41cced201f05906 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 15 Dec 2005 18:04:05 +0000 Subject: [PATCH] - Add comment explaining the reason for "touch" commands. - Move "file-touch-command" to "common.jam". It already has "file-creation-command" so this one will be a good companion. Patch from Alexey Pakhunov. [SVN r32061] --- v2/tools/common.jam | 16 ++++++++++++++++ v2/tools/midl.jam | 21 +++++---------------- v2/tools/msvc.jam | 3 ++- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/v2/tools/common.jam b/v2/tools/common.jam index 7a6c15135..c5bbd4294 100644 --- a/v2/tools/common.jam +++ b/v2/tools/common.jam @@ -465,6 +465,22 @@ rule file-creation-command ( ) } +# Returns a command that may be used for 'touching' files. +# It is not a real 'touch' command on NT because it adds an empty line at +# the end of file but it works with source files +rule file-touch-command ( ) +{ + if [ os.name ] in NT + { + return "echo. >> " ; + } + else + { + return "touch " ; + } +} + + rule MkDir { # If dir exists, don't update it diff --git a/v2/tools/midl.jam b/v2/tools/midl.jam index 5d7c487a0..0aa5dda31 100644 --- a/v2/tools/midl.jam +++ b/v2/tools/midl.jam @@ -128,22 +128,11 @@ flags midl.compile.idl INCLUDES ; generators.register-c-compiler midl.compile.idl : IDL : MSTYPELIB H C(%_i) C(%_proxy) C(%_dlldata) ; -# Returns a command that may be used for 'touching' files. -# It is not a real 'touch' command on NT because it adds an empty line at -# the end of file but it works with source files -rule file-touch-command ( ) -{ - if [ os.name ] in NT - { - return "echo. >> " ; - } - else - { - return "touch " ; - } -} - -TOUCH_FILE = [ file-touch-command ] ; +# MIDL does not always generate '%_proxy.c' and '%_dlldata.c'. This behavior +# depends on contents of the source IDL file. Calling TOUCH_FILE below ensures +# that both files will be created so bjam will not try to recreate them +# constantly. +TOUCH_FILE = [ common.file-touch-command ] ; actions compile.idl { diff --git a/v2/tools/msvc.jam b/v2/tools/msvc.jam index dfe65fc95..df57baf69 100644 --- a/v2/tools/msvc.jam +++ b/v2/tools/msvc.jam @@ -603,7 +603,8 @@ actions compile.rc $(.RC) -l 0x409 -U$(UNDEFS) -D$(DEFINES) -I"$(INCLUDES)" -fo "$(<:W)" "$(>:W)" } -TOUCH_FILE = [ midl.file-touch-command ] ; +# See midl.jam for details +TOUCH_FILE = [ common.file-touch-command ] ; actions compile.idl {