From b025ce46786ced077d67c2a2bbe53af3f819f9d7 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 17 Oct 2008 10:46:23 +0000 Subject: * common.mk (ID_H_TARGET): phony target to update id.h. * tool/ifchange, win32/ifchange.bat: --timestamp option added. * tool/generic_erb.rb: --timestamp, --output and --if-change options added. * template/id.h.tmpl: moved from id.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- win32/ifchange.bat | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'win32') diff --git a/win32/ifchange.bat b/win32/ifchange.bat index 8411099020..9f6092747b 100755 --- a/win32/ifchange.bat +++ b/win32/ifchange.bat @@ -3,6 +3,11 @@ if "%1" == "" goto :end +set timestamp= +if "%1" == "--timestamp" ( + set timestamp=yes + shift +) set dest=%1 set src=%2 set dest=%dest:/=\% @@ -47,13 +52,18 @@ goto :end if not exist %src% goto :end if exist %dest% ( fc.exe %dest% %src% > nul && ( - echo %dest% unchanged. + echo %1 unchanged. del %src% - goto :end + goto :nt_end ) ) -echo %dest% updated. +echo %1 updated. copy %src% %dest% > nul del %src% +:nt_end +if "%timestamp%" == "" goto :end + for %%I in ("%dest%") do set timestamp=%%~dpI\.time.%%~nxI + if not exist "%timestamp%" copy nul "%timestamp%" > nul + goto :end >> "%timestamp%" :end -- cgit v1.2.1