summaryrefslogtreecommitdiffstats
path: root/win32/ifchange.bat
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-17 10:46:23 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-17 10:46:23 +0000
commitdbc024d16c94320ad151e06e89a532888d7f0bb9 (patch)
tree242aef5fa2be80f10e11f4f52598f299fc66a118 /win32/ifchange.bat
parentef10f19d07ec8cefd1447c4a2d211004f5d47f09 (diff)
downloadruby-dbc024d16c94320ad151e06e89a532888d7f0bb9.tar.gz
ruby-dbc024d16c94320ad151e06e89a532888d7f0bb9.tar.xz
ruby-dbc024d16c94320ad151e06e89a532888d7f0bb9.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@19822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/ifchange.bat')
-rwxr-xr-xwin32/ifchange.bat16
1 files changed, 13 insertions, 3 deletions
diff --git a/win32/ifchange.bat b/win32/ifchange.bat
index 841109902..9f6092747 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