diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-03-03 09:38:40 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-03-03 09:38:40 +0000 |
commit | b417f99856471ff24a6cda4f059ac3938b76b379 (patch) | |
tree | 4f20ff4a932659300910e0c699d6735a13d8a07b /win32/ifchange.bat | |
parent | 25fa9649d3ec44b78ff3fb69b1fa01acd6ceae9b (diff) | |
download | ruby-b417f99856471ff24a6cda4f059ac3938b76b379.tar.gz ruby-b417f99856471ff24a6cda4f059ac3938b76b379.tar.xz ruby-b417f99856471ff24a6cda4f059ac3938b76b379.zip |
* {bcc32,win32,wince}/Makefile.sub (config.h): check if affected
when makefiles are modified.
* {bcc32,win32,wince}/Makefile.sub (config.status): add variables
for tests.
* win32/ifchange.bat: try to update a file only if modified.
* win32/resource.rb: more descriptions.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/ifchange.bat')
-rwxr-xr-x | win32/ifchange.bat | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/win32/ifchange.bat b/win32/ifchange.bat new file mode 100755 index 000000000..61a80c841 --- /dev/null +++ b/win32/ifchange.bat @@ -0,0 +1,30 @@ +@echo off
+:: usage: ifchange target temporary
+
+:: check if fc.exe works.
+echo foo > conftest1.tmp
+echo bar > conftest2.tmp
+fc.exe conftest1.tmp conftest2.tmp > nul
+if not errorlevel 1 goto :brokenfc
+
+:: target does not exist or new file differs from it.
+if not exist %1 goto :update
+fc.exe %1 %2 > nul
+if errorlevel 1 goto :update
+
+:unchange
+echo %1 unchanged.
+del %2
+goto :end
+
+:brokenfc
+del conftest1.tmp > nul
+del conftest2.tmp > nul
+echo FC.EXE does not work properly.
+echo assuming %1 should be changed.
+
+:update
+echo %1 updated.
+if exist %1 del %1
+copy %2 %1 > nul
+:end
|