# Compile ruby under windows xp with MinGW

**URL:** <https://www.ruby-forum.com/t/compile-ruby-under-windows-xp-with-mingw/120263>\
**Category:** Ruby\
**Created:** [November 15, 2007, 11:51am UTC](https://www.ruby-forum.com/t/compile-ruby-under-windows-xp-with-mingw/120263 "2007-11-15T11:51:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lars\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/258eb7/32.png) [@lars\_S](https://www.ruby-forum.com/u/lars_S)\
**Post date:** [November 15, 2007, 11:51am UTC](https://www.ruby-forum.com/t/compile-ruby-under-windows-xp-with-mingw/120263/1 "2007-11-15T11:51:15Z")

</div>

dear rubyians,

I tried to compile ruby under windows xp with MinGW.  
firstly I copied and renamed the GNUMakefile.in out of cygwin directory  
into the src root directory. After that I successfully run ./configure  
in order to generate the Makefile.

Unfortunately, the auto generated Makefile has one “smaller” and one  
“bigger” obstacle.

The “smaller” one concerns the first line of the Makefile there was an  
“include Makefile” which caused “Makefile:1: Makefile: Too many open  
files” what I fixed with out-commenting that line.

The “bigger” one where I am without any suggestion is related to the  
first target:

$(RCFILES): $(RBCONFIG)  
@$(MINIRUBY) $(srcdir)/win32/resource.rb   
-ruby\_name=$(RUBY\_INSTALL\_NAME) -rubyw\_name=$(RUBYW\_INSTALL\_NAME)   
-so\_name=$(DLL\_BASE\_NAME)   
. $(icondirs) $(srcdir)/win32

which cause:

Makefile:42: target ‘.rc’ given more than once in the same rule.  
Makefile:42: target ‘.rc’ given more than once in the same rule.  
GNUMakefile:42: warning: overriding commands for target ‘.rc’  
Makefile:43: warning: ignoring old commands for target ‘.rc’  
GNUMakefile:41: target ‘.rc’ given more than once in the same rule.  
GNUMakefile:41: target ‘.rc’ given more than once in the same rule.  
mingw32-make: \*\*\* No rule to make target ‘/cygwin/GNUmakefile.in’,  
needed by ‘GNUMakefile’. Stop.

what has been gone wrong!?  
does anybody have an idea?

thanks in advance.

kind regards,  
lars

---

<div class="post-metadata">

**Author:** ![lars\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/258eb7/32.png) [@lars\_S](https://www.ruby-forum.com/u/lars_S)\
**Post date:** [November 15, 2007, 1:34pm UTC](https://www.ruby-forum.com/t/compile-ruby-under-windows-xp-with-mingw/120263/2 "2007-11-15T13:34:21Z")

</div>

Hi,

At Thu, 15 Nov 2007 19:51:13 +0900,  
Lars Eb wrote in [ruby-talk:279091]:

> I tried to compile ruby under windows xp with MinGW.  
> firstly I copied and renamed the GNUMakefile.in out of cygwin directory  
> into the src root directory. After that I successfully run ./configure  
> in order to generate the Makefile.

Just run ./configure _without_ copying it.

---

<div class="post-metadata">

**Author:** ![lars\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/258eb7/32.png) [@lars\_S](https://www.ruby-forum.com/u/lars_S)\
**Post date:** [November 15, 2007, 5:30pm UTC](https://www.ruby-forum.com/t/compile-ruby-under-windows-xp-with-mingw/120263/3 "2007-11-15T17:30:02Z")

</div>

Nobuyoshi N. wrote:

> Hi,
> 
> At Thu, 15 Nov 2007 19:51:13 +0900,  
> Lars Eb wrote in [ruby-talk:279091]:
> 
> > I tried to compile ruby under windows xp with MinGW.  
> > firstly I copied and renamed the GNUMakefile.in out of cygwin directory  
> > into the src root directory. After that I successfully run ./configure  
> > in order to generate the Makefile.
> 
> Just run ./configure _without_ copying it.

thank you for the quick reply! that’s it, but now there is one problem  
with make and cygpath command which is not found. I checked the path  
variable and the pure console call of cygpath which fits.

---

<div class="post-metadata">

**Author:** ![lars\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/258eb7/32.png) [@lars\_S](https://www.ruby-forum.com/u/lars_S)\
**Post date:** [November 16, 2007, 2:37pm UTC](https://www.ruby-forum.com/t/compile-ruby-under-windows-xp-with-mingw/120263/4 "2007-11-16T14:37:11Z")

</div>

Nobuyoshi N. wrote:

> Hi,
> 
> At Fri, 16 Nov 2007 01:29:59 +0900,  
> Lars Eb wrote in [ruby-talk:279141]:
> 
> > thank you for the quick reply! that’s it, but now there is one problem  
> > with make and cygpath command which is not found. I checked the path  
> > variable and the pure console call of cygpath which fits.
> 
> I’m not sure about your environment. cygpath is used only when  
> build\_os in rbconfig.rb is set to “cygwin”, but
> 
> > Attachments:  
> > [http://www.ruby-forum.com/attachment/981/make.txt](http://www.ruby-forum.com/attachment/981/make.txt)
> 
> this doesn’t seem like cygwin.

that was the result log of make call.

anyway I fixed this make completes with  
“$make  
compiling Win32API  
mingw32-make: \*\*\* [all] Error 1”

Due to the fact that the all “$make test” have success  
“$make test  
test succeeded”  
I don’t worry and tried to perform “make install” which lead to the  
following:  
$make install  
./miniruby.exe ./instruby.rb --dest-dir=“” --extout=“” --make=“make” \   
–mflags=“” --make-flags=“” -installed-list .installed.list  
–mantype=“doc” \ installing binary commands  
ruby/src/ruby-1.8.6/lib/fileutils.rb:843:in ‘stat’: No such File or  
directory - rubyw.exe

Of corse I can copy the generated rubyw from bin but make should  
complete without doing this.

Do you have any information for solving the problem!?

---

<div class="post-metadata">

**Author:** ![lars\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/258eb7/32.png) [@lars\_S](https://www.ruby-forum.com/u/lars_S)\
**Post date:** [November 16, 2007, 5:41am UTC](https://www.ruby-forum.com/t/compile-ruby-under-windows-xp-with-mingw/120263/5 "2007-11-16T05:41:17Z")

</div>

Hi,

At Fri, 16 Nov 2007 01:29:59 +0900,  
Lars Eb wrote in [ruby-talk:279141]:

> thank you for the quick reply! that’s it, but now there is one problem  
> with make and cygpath command which is not found. I checked the path  
> variable and the pure console call of cygpath which fits.

I’m not sure about your environment. cygpath is used only when  
build\_os in rbconfig.rb is set to “cygwin”, but

> Attachments:  
> [http://www.ruby-forum.com/attachment/981/make.txt](http://www.ruby-forum.com/attachment/981/make.txt)

this doesn’t seem like cygwin.
