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 {