summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog16
-rw-r--r--Makefile.in6
-rw-r--r--bcc32/Makefile.sub16
-rw-r--r--common.mk11
-rw-r--r--cygwin/GNUmakefile.in5
-rw-r--r--ext/extmk.rb7
-rw-r--r--lib/mkmf.rb7
-rw-r--r--win32/Makefile.sub26
-rwxr-xr-xwin32/rm.bat4
-rw-r--r--wince/Makefile.sub14
-rw-r--r--wince/README.wince19
11 files changed, 87 insertions, 44 deletions
diff --git a/ChangeLog b/ChangeLog
index 22d130a..ce30b7d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+Tue Mar 23 14:31:47 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * Makefile.in, */Makefile.sub, common.mk (clean-local, distclean-local):
+ separate files under directories due to directory separator.
+
+ * */Makefile.sub (MKFILES): common.mk and */Makefile.sub should not be
+ removed.
+
+ * win32/Makefile.sub, wince/Makefile.sub: $* cannot appear in explicit
+ rules.
+
+ * cygwin/GNUmakefile.in: some mingw stuffs were missed.
+
+ * lib/mkmf.rb (create_makefile): Borland make wrongly removes braces
+ from command lines.
+
Mon Mar 22 08:21:17 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* Makefile.in, */Makefile.sub, common.mk: extract common portions.
diff --git a/Makefile.in b/Makefile.in
index 6bd888c..1632a3a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -116,6 +116,7 @@ $(LIBRUBY_SO):
@-$(MINIRUBY) -e 'ARGV.each{|link| File.delete link if File.exist? link; \
File.symlink "$(LIBRUBY_SO)", link}' \
$(LIBRUBY_ALIASES) || true
+
fake.rb: Makefile
@echo ' \
class Object; \
@@ -166,3 +167,8 @@ lex.c: keywords
.c.@OBJEXT@:
$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
+clean-local::
+ @$(RM) ext/extinit.c ext/extinit.$(OBJEXT)
+
+distclean-local::
+ @$(RM) ext/config.cache $(RBCONFIG)
diff --git a/bcc32/Makefile.sub b/bcc32/Makefile.sub
index 2ca5ea0..c579ac9 100644
--- a/bcc32/Makefile.sub
+++ b/bcc32/Makefile.sub
@@ -1,7 +1,7 @@
# -*- makefile -*-
SHELL = $(COMSPEC)
-MKFILES = Makefile $(srcdir)bcc32/Makefile.sub $(srcdir)common.mk
+MKFILES = Makefile
#### Start of system configuration section. ####
OS = bccwin32
@@ -186,7 +186,7 @@ WINMAINOBJ = winmain.$(OBJEXT)
sed -e "s!^ *extern char \*getenv();!/* & */!;s/^\(#.*\)y\.tab/\1parse/" y.tab.c > $(@F)
@del y.tab.c
-all:
+all: $(srcdir)bcc32/Makefile.sub $(srcdir)common.mk
!include $(srcdir)/common.mk
@@ -271,11 +271,12 @@ config.h:
\#define RUBY_SITE_ARCHLIB "/lib/ruby/site_ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(OS)"
|
-config.status: $(MKFILES)
+config.status: $(MKFILES) $(srcdir)bcc32/Makefile.sub $(srcdir)common.mk
@echo Creating $@
@type > $@ &&|
# Generated automatically by Makefile.sub.
s,@SHELL@,$$(COMSPEC),;t t
+s,@PATH_SEPARATOR@,;,;t t
s,@CFLAGS@,$(CFLAGS),;t t
s,@CPPFLAGS@,$(CPPFLAGS),;t t
s,@CXXFLAGS@,$(CXXFLAGS),;t t
@@ -403,8 +404,15 @@ $(LIBRUBY): $(LIBRUBY_SO)
$(RUBYDEF): $(LIBRUBY_A) $(PREP)
$(MINIRUBY) $(srcdir)win32/mkexports.rb -output=$@ -base=$(RUBY_SO_NAME) $(LIBRUBY_A)
+$(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc: rbconfig.rb
+ @$(MINIRUBY) $(srcdir)win32/resource.rb \
+ -ruby_name=$(RUBY_INSTALL_NAME) \
+ -rubyw_name=$(RUBYW_INSTALL_NAME) \
+ -so_name=$(RUBY_SO_NAME) \
+ . $(icondirs) $(srcdir)win32
+
clean-local::
- @$(RM) ext\extinit.c ext\extinit.$(OBJEXT) *.tds *.il?
+ @$(RM) ext\extinit.c ext\extinit.$(OBJEXT) *.tds *.il? $(RUBY_SO_NAME).lib
@$(RM) $(RUBY_INSTALL_NAME).res $(RUBYW_INSTALL_NAME).res $(RUBY_SO_NAME).res
distclean-local::
diff --git a/common.mk b/common.mk
index 35abb53..44221a8 100644
--- a/common.mk
+++ b/common.mk
@@ -99,19 +99,18 @@ install-doc: $(PROGRAM)
clean: clean-ext clean-local
clean-local::
- @$(RM) $(OBJS) $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY_ALIASES)
- @$(RM) ext/extinit.c ext/extinit.$(OBJEXT) dmyext.$(OBJEXT)
- @$(RM) $(PROGRAM) $(WPROGRAM) miniruby$(EXEEXT)
+ @$(RM) $(OBJS) $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY) $(LIBRUBY_ALIASES)
+ @$(RM) $(PROGRAM) $(WPROGRAM) miniruby$(EXEEXT) dmyext.$(OBJEXT)
clean-ext:
@-$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS) clean
distclean: distclean-ext distclean-local
distclean-local:: clean-local
- @$(RM) $(MKFILES) config.h rbconfig.rb $(RBCONFIG)
- @$(RM) ext/config.cache config.cache config.log config.status
+ @$(RM) $(MKFILES) config.h rbconfig.rb
+ @$(RM) config.cache config.log config.status
@$(RM) *~ *.bak *.stackdump core *.core gmon.out y.tab.c y.output ruby.imp
distclean-ext:
- @-$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS) distclean 2> $(NULL)
+ @-$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS) distclean
realclean:: distclean
@$(RM) parse.c lex.c
diff --git a/cygwin/GNUmakefile.in b/cygwin/GNUmakefile.in
index d7e951c..fe6fd3b 100644
--- a/cygwin/GNUmakefile.in
+++ b/cygwin/GNUmakefile.in
@@ -1,11 +1,14 @@
include Makefile
ENABLE_SHARED=@ENABLE_SHARED@
+DLLWRAP = @DLLWRAP@ --target=@target_os@
ifeq (@target_os@,cygwin)
DLL_BASE_NAME := $(subst .dll,,$(LIBRUBY_SO))
else
DLL_BASE_NAME := $(RUBY_SO_NAME)
+ DLLWRAP += -mno-cygwin
+ VPATH += $(srcdir)/win32
endif
ifneq ($(ENABLE_SHARED),yes)
@@ -44,7 +47,7 @@ $(WPROGRAM): $(RUBYW_INSTALL_NAME).res.@OBJEXT@
$(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
$(RUBY_EXP): $(LIBRUBY_A)
- @DLLWRAP@ --target=@target_os@ --driver-name=$(CC) \
+ $(DLLWRAP) \
--output-exp=$(RUBY_EXP) \
--export-all $(LIBRUBY_A) $(LIBS) -o $(PROGRAM)
$(LDSHARED) $(DLDFLAGS) $(OBJS) dmyext.o $(SOLIBS) -o $(PROGRAM)
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 4abe6a1..94c0917 100644
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -116,6 +116,9 @@ def extmake(target)
unless system($make, *args)
$ignore or $continue or return false
end
+ if $clean and $clean != true
+ File.unlink(makefile) rescue nil
+ end
if $static
$extflags ||= ""
$extlibs ||= []
@@ -215,11 +218,11 @@ parse_args()
if target = ARGV.shift and /^[a-z-]+$/ =~ target
$mflags.push(target)
- target = target.sub(/^(?:dist|real)(?=(?:clean)?$)/, '\1')
+ target = target.sub(/^(dist|real)(?=(?:clean)?$)/, '')
case target
when /clean/
$ignore ||= true
- $clean = true
+ $clean = $1 ? $1[0] : true
when /^install\b/
$install = true
$ignore ||= true
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 7ebd289..ba9f90c 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -897,8 +897,9 @@ RUBYLIBDIR = $(sitelibdir)$(target_prefix)
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
}
end
+ n = ($extout ? '$(RUBYARCHDIR)/' : '') + '$(TARGET).'
mfile.print %{
-CLEANLIBS = #{$extout ? '$(RUBYARCHDIR)/' : ''}$(TARGET).{#{CONFIG['DLEXT']},il?,tds,map}
+CLEANLIBS = #{n}#{CONFIG['DLEXT']} #{n}il? #{n}tds #{n}map
CLEANOBJS = *.#{$OBJEXT} *.#{$LIBEXT} *.s[ol] *.pdb *.exp *.bak
all: #{target ? $extout ? "install" : "$(DLLIB)" : "Makefile"}
@@ -1024,8 +1025,8 @@ def init_mkmf(config = CONFIG)
$LOCAL_LIBS = ""
- $cleanfiles = []
- $distcleanfiles = []
+ $cleanfiles = config_string('CLEANFILES') {|s| Shellwords.shellwords(s)} || []
+ $distcleanfiles = config_string('DISTCLEANFILES') {|s| Shellwords.shellwords(s)} || []
$extout ||= nil
$extout_prefix ||= nil
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index 198f8e8..f8d0d51 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -1,7 +1,7 @@
# -*- makefile -*-
SHELL = $(COMSPEC)
-MKFILES = Makefile $(srcdir)/win32/Makefile.sub $(srcdir)/common.mk
+MKFILES = Makefile
NULL = nul
#### Start of system configuration section. ####
@@ -171,7 +171,7 @@ DLDOBJS =
WINMAINOBJ = winmain.$(OBJEXT)
-all:
+all: $(srcdir)/win32/Makefile.sub $(srcdir)/common.mk
!include $(srcdir)/common.mk
@@ -271,10 +271,11 @@ config.h:
#define RUBY_SITE_ARCHLIB "/lib/ruby/site_ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(RT)"
<<KEEP
-config.status: $(MKFILES)
+config.status: $(MKFILES) $(srcdir)/win32/Makefile.sub $(srcdir)/common.mk
@echo Creating <<$@
# Generated automatically by Makefile.sub.
s,@SHELL@,$$(COMSPEC),;t t
+s,@PATH_SEPARATOR@,;,;t t
s,@CFLAGS@,$(CFLAGS),;t t
s,@CPPFLAGS@,$(CPPFLAGS),;t t
s,@CXXFLAGS@,$(CXXFLAGS),;t t
@@ -366,6 +367,7 @@ s,@TRY_LINK@,$$(CC) -Feconftest $$(INCFLAGS) -I$$(hdrdir) $$(CPPFLAGS) $$(CFLAGS
s,@COMMON_LIBS@,m,;t t
s,@COMMON_MACROS@,WIN32_LEAN_AND_MEAN;t t
s,@COMMON_HEADERS@,winsock2.h windows.h,;t t
+s,@DISTCLEANFILES@,vc*.pdb,;t t
s,@EXPORT_PREFIX@, ,;t t
s,@arch@,$(ARCH)-$(OS),;t t
s,@sitearch@,$(ARCH)-$(RT),;t t
@@ -380,13 +382,14 @@ miniruby$(EXEEXT):
@echo. $(LIBS)
$(PURIFY) $(CC) $(MAINOBJ) $(LIBRUBY_A) $(LIBS) -Fe$@ $(LDFLAGS)
-$(PROGRAM): $*.res
- $(PURIFY) $(CC) $(MAINOBJ) $*.res \
+$(PROGRAM): $(RUBY_INSTALL_NAME).res
+ $(PURIFY) $(CC) $(MAINOBJ) $(RUBY_INSTALL_NAME).res \
$(OUTFLAG)$@ $(LIBRUBYARG) $(LDFLAGS) $(XLDFLAGS)
-$(WPROGRAM): $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_SO) $*.res
- $(PURIFY) $(CC) $(MAINOBJ) $(WINMAINOBJ) $*.res \
- $(OUTFLAG)$@ $(LIBRUBYARG) $(LDFLAGS) $(XLDFLAGS) -subsystem:Windows
+$(WPROGRAM): $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_SO) $(RUBYW_INSTALL_NAME).res
+ $(PURIFY) $(CC) $(MAINOBJ) $(WINMAINOBJ) \
+ $(RUBYW_INSTALL_NAME).res $(OUTFLAG)$@ $(LIBRUBYARG) \
+ $(LDFLAGS) $(XLDFLAGS) -subsystem:Windows
$(LIBRUBY_A): $(OBJS) $(DMYEXT)
$(AR) $(ARFLAGS)$@ $(OBJS) $(DMYEXT)
@@ -394,10 +397,11 @@ $(LIBRUBY_A): $(OBJS) $(DMYEXT)
$(LIBRUBY): $(RUBYDEF)
$(AR) $(ARFLAGS)$@ -def:$(RUBYDEF)
-$(LIBRUBY_SO): $(LIBRUBY_A) $(DLDOBJS) $(RUBYDEF) $*.res
+$(LIBRUBY_SO): $(LIBRUBY_A) $(DLDOBJS) $(RUBYDEF) $(RUBY_SO_NAME).res
@echo. $(DLDOBJS)
- $(LDSHARED) $(MAINOBJ) $(DLDOBJS) $(LIBRUBY_A) $*.res $(LIBS) \
- -Fe$@ $(LDFLAGS) $(LIBRUBY_DLDFLAGS)
+ $(LDSHARED) $(MAINOBJ) $(DLDOBJS) $(LIBRUBY_A) \
+ $(RUBY_SO_NAME).res $(LIBS) -Fe$@ $(LDFLAGS) \
+ $(LIBRUBY_DLDFLAGS)
$(RUBYDEF): $(LIBRUBY_A) $(PREP)
$(MINIRUBY) $(srcdir)/win32/mkexports.rb -output=$@ $(LIBRUBY_A)
diff --git a/win32/rm.bat b/win32/rm.bat
index ee18ea6..c730761 100755
--- a/win32/rm.bat
+++ b/win32/rm.bat
@@ -1,9 +1,9 @@
@echo off
-::: $Id$
+::: $Id: rm.bat,v 1.1 2004/03/21 23:21:30 nobu Exp $
if "%1" == "-f" shift
:begin
if "%1" == "" goto :end
-if exist %1 del %1
+if exist "%1" del "%1"
shift
goto :begin
:end
diff --git a/wince/Makefile.sub b/wince/Makefile.sub
index d8c2462..7899670 100644
--- a/wince/Makefile.sub
+++ b/wince/Makefile.sub
@@ -1,7 +1,7 @@
# -*- makefile -*-
SHELL = $(COMSPEC)
-MKFILES = Makefile $(srcdir)/wince/Makefile.sub $(srcdir)/common.mk
+MKFILES = Makefile
NULL = nul
#### Start of system configuration section. ####
@@ -178,7 +178,7 @@ DLDOBJS =
WINMAINOBJ = wincemain.$(OBJEXT)
-all:
+all: $(srcdir)/wince/Makefile.sub $(srcdir)/common.mk
ruby: $(PROGRAM)
lib: $(LIBRUBY)
dll: $(LIBRUBY_SO)
@@ -297,10 +297,11 @@ $(BANG)endif
#endif
<<KEEP
-config.status: $(MKFILES)
+config.status: $(MKFILES) $(srcdir)/wince/Makefile.sub $(srcdir)/common.mk
@echo Creating <<$@
# Generated automatically by Makefile.sub.
s,@SHELL@,$$(COMSPEC),;t t
+s,@PATH_SEPARATOR@,;,;t t
s,@CFLAGS@,$(CFLAGS),;t t
s,@CPPFLAGS@,$(CPPFLAGS),;t t
s,@CXXFLAGS@,$(CXXFLAGS),;t t
@@ -412,10 +413,11 @@ $(LIBRUBY_A): $(OBJS) $(DMYEXT)
$(LIBRUBY): $(RUBYDEF)
$(AR) $(ARFLAGS)$@ -def:$(RUBYDEF)
-$(LIBRUBY_SO): $(LIBRUBY_A) $(DLDOBJS) $(RUBYDEF) $*.res
+$(LIBRUBY_SO): $(LIBRUBY_A) $(DLDOBJS) $(RUBYDEF) $(RUBY_SO_NAME).res
@echo. $(DLDOBJS)
- $(LDSHARED) $(MAINOBJ) $(DLDOBJS) $(LIBRUBY_A) $*.res $(LIBS) \
- -Fe$@ $(LDFLAGS) $(LIBRUBY_DLDFLAGS)
+ $(LDSHARED) $(MAINOBJ) $(DLDOBJS) $(LIBRUBY_A) \
+ $(RUBY_SO_NAME).res $(LIBS) -Fe$@ $(LDFLAGS) \
+ $(LIBRUBY_DLDFLAGS)
$(RUBYDEF): $(LIBRUBY_A) $(PREP)
$(MINIRUBY) $(srcdir)/win32/mkexports.rb \
diff --git a/wince/README.wince b/wince/README.wince
index 795dc71..b4c8de2 100644
--- a/wince/README.wince
+++ b/wince/README.wince
@@ -6,9 +6,7 @@
(1) eMbedded Visual C++ 3.0 or later.
-(2) If you want to run `((%nmake clean%))' or `((%nmake distclean%))'
- properly, you must install UNIX compatible `((%rm%))' command on
- your ((|PATH|)) if you want to clean after compile.
+(2) ruby executable on the compiling host environment.
(3) Please set environment variable (({INCLUDE})), (({LIB})), (({PATH})),
(({CE_TOOLS_DIR})), (({EMBEDDED_TOOLS_DIR})) to run required commands
@@ -25,6 +23,9 @@
(1) Execute wince\configure.bat on your build directory.
You can specify the target platform as an argument.
For example, run `((%configure arm-hpc2k-wince%))'
+ You can also specify the install directory.
+ For example, run `((%configure --prefix=<install_directory>%))'
+ Default of the install directory is /usr .
(2) Change ((|RUBY_INSTALL_NAME|)) and ((|RUBY_SO_NAME|)) in (({Makefile}))
if you want to change the name of the executable files.
@@ -79,9 +80,9 @@ in Japanese, but you can download at least.
C:
cd \ruby
- win32\configure
+ win32\configure --prefix=/usr/local
nmake
- nmake DESTDIR=/usr/local install
+ nmake install
* Build on the relative directory from the ruby source directory.
@@ -94,9 +95,9 @@ in Japanese, but you can download at least.
cd \ruby
mkdir mswin32
cd mswin32
- ..\win32\configure
+ ..\win32\configure --prefix=/usr/local
nmake
- nmake DESTDIR=/usr/local install
+ nmake install
* Build on the different drive.
@@ -107,9 +108,9 @@ in Japanese, but you can download at least.
D:
cd D:\build\ruby
- C:\src\ruby\win32\configure
+ C:\src\ruby\win32\configure --prefix=C:/usr/local
nmake
- nmake DESTDIR=C:/usr/local install
+ nmake install
== Bugs