summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-03-03 09:38:40 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-03-03 09:38:40 +0000
commita48c63f36b48bdad1cfea978b58410fc70fada7a (patch)
tree4f20ff4a932659300910e0c699d6735a13d8a07b /win32
parent813a901a5e01675e548a2fd3ede472f9a2572bc3 (diff)
* {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: svn+ssh://ci.ruby-lang.org/ruby/trunk@8057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/Makefile.sub37
-rwxr-xr-xwin32/ifchange.bat30
-rw-r--r--win32/resource.rb12
3 files changed, 68 insertions, 11 deletions
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index d889b2b8d4..8a59bda74c 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -179,10 +179,15 @@ rubyw: $(WPROGRAM)
!include $(srcdir)/common.mk
-config: config.h config.status
+CONFIG_H = ./.config.h.time
-config.h:
- @echo Creating <<$@
+config: config.status
+
+config.status: $(CONFIG_H)
+
+$(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub
+ @echo Creating config.h
+ @$(srcdir:/=\)\win32\ifchange.bat config.h <<
#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
@@ -270,10 +275,27 @@ config.h:
#define RUBY_PLATFORM "$(ARCH)-$(OS)"
#define RUBY_ARCHLIB "/lib/ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(OS)"
#define RUBY_SITE_ARCHLIB "/lib/ruby/site_ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(RT)"
-<<KEEP
+<<
+ @exit > $(@:/=\)
+
+#!if exist(config.h)
+#! if exist(config_h.bak)
+# @del config_h.bak
+#! endif
+# @ren config.h config_h.bak
+#!endif
+# @ren config_h~ config.h
+#!if exist(config.h)
+# @echo NMAKE will abort if config.h is changed, then restart NMAKE.
+# @fc.exe config.h config_h.bak > nul
+# @echo config.h unchanged.
+# @del config.h
+# @ren config_h.bak config.h
+#!endif
config.status: $(MKFILES) $(srcdir)/win32/Makefile.sub $(srcdir)/common.mk
- @echo Creating <<$@
+ @echo Creating $@
+ @exit <<$@
# Generated automatically by Makefile.sub.
s,@SHELL@,$$(COMSPEC),;t t
s,@PATH_SEPARATOR@,;,;t t
@@ -339,6 +361,11 @@ s,@STRIP@,$(STRIP),;t t
s,@EXTSTATIC@,$(EXTSTATIC),;t t
s,@setup@,Setup,;t t
s,@MINIRUBY@,$(MINIRUBY),;t t
+s,@PREP@,miniruby$(EXEEXT),;t t
+s,@RUNRUBY@,$(RUNRUBY),;t t
+s,@EXTOUT@,$(EXTOUT),;t t
+s,@ARCHFILE@,,;t t
+s,@RDOCTARGET@,,;t t
s,@LIBRUBY_LDSHARED@,$(LIBRUBY_LDSHARED),;t t
s,@LIBRUBY_DLDFLAGS@,$(LIBRUBY_DLDFLAGS),;t t
s,@RUBY_INSTALL_NAME@,$(RUBY_INSTALL_NAME),;t t
diff --git a/win32/ifchange.bat b/win32/ifchange.bat
new file mode 100755
index 0000000000..61a80c841b
--- /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
diff --git a/win32/resource.rb b/win32/resource.rb
index 0bfebf2d63..b5a3a8b33a 100644
--- a/win32/resource.rb
+++ b/win32/resource.rb
@@ -46,11 +46,11 @@ icons.keys.sort.each do |i|
dll_icons << "#{dll_icons.size + 1} ICON DISCARDABLE "+icons[i].dump+"\n"
end
-[ # base name extension file type icons
- [$ruby_name, CONFIG["EXEEXT"], 'VFT_APP', ruby_icon],
- [$rubyw_name, CONFIG["EXEEXT"], 'VFT_APP', rubyw_icon || ruby_icon],
- [$so_name, '.dll', 'VFT_DLL', dll_icons],
-].each do |base, ext, type, icons|
+[ # base name extension file type desc, icons
+ [$ruby_name, CONFIG["EXEEXT"], 'VFT_APP', 'CUI', ruby_icon],
+ [$rubyw_name, CONFIG["EXEEXT"], 'VFT_APP', 'GUI', rubyw_icon || ruby_icon],
+ [$so_name, '.dll', 'VFT_DLL', 'DLL', dll_icons],
+].each do |base, ext, type, desc, icons|
open(base + '.rc', "w") { |f|
f.binmode if /mingw/ =~ RUBY_PLATFORM
@@ -74,7 +74,7 @@ BEGIN
BEGIN
BLOCK "000004b0"
BEGIN
- VALUE "FileDescription", "Ruby interpreter\\0"
+ VALUE "FileDescription", "Ruby interpreter (#{desc}) #{RUBY_VERSION} [#{RUBY_PLATFORM}]\\0"
VALUE "FileVersion", "#{fversion}\\0"
VALUE "Home Page", "http://www.ruby-lang.org/\\0"
VALUE "InternalName", "#{base + ext}\\0"