Extconf problem

I have a minor problem with mkmf (ruby 1.6.7) and gmake.

mkmf generates implicite dependencies for “.cxx” files,
such as:

all: example.o
…cxx.o :
g++ -c $@ $<

(I have reduced the example to minimum)

The problem is that it does NOT work with gmake,
it says:

No rule to make target example.o', needed byall’. Stop.

Remark: if you substitute “cxx” by “C”, then it works.

I have two questions:

  1. Why does the mkmf generates dependencies which do not work?
    (It took at least 15 minutes to find out the problem,
    since the Makefile looked “right”. It is really nasty.

  2. Why does not it generates dependencies which work?

Best regards, Christian

Hi,

all: example.o
…cxx.o :
g++ -c $@ $<

Are there two dots at beginning of the line, and the command
uses g++ directly?

The problem is that it does NOT work with gmake,
it says:

No rule to make target example.o', needed by all’. Stop.

Remark: if you substitute “cxx” by “C”, then it works.

.C rule should be generated below the .cxx rule.

Could you show me your extconf.rb?

···

At Fri, 20 Sep 2002 23:02:50 +0900, Christian Szegedy wrote:


Nobu Nakada

Of course, this was a copy and paste error: there is only one point.

My extconf is simple:

#!/usr/bin/env ruby
require ‘mkmf’
create_makefile(‘example_ext’)

But you can test the following example also:

all: example.o
…cxx.o :
g++ -DTEST_FLAG -c -o $@ $<

If you touch example.cxx, it won’t bild example.o.

If you replace cxx by C, and touch example.C, then
it will compile it by the given command.

(I have used extconf and mkmf several times, and it
always worked with c files.)

Regards, Christian

···

nobu.nokada@softhome.net wrote:

Hi,

At Fri, 20 Sep 2002 23:02:50 +0900, > Christian Szegedy wrote:

all: example.o
…cxx.o :
g++ -c $@ $<

Are there two dots at beginning of the line, and the command
uses g++ directly?

The problem is that it does NOT work with gmake,
it says:

No rule to make target example.o', needed by all’. Stop.

Remark: if you substitute “cxx” by “C”, then it works.

C rule should be generated below the .cxx rule.

Could you show me your extconf.rb?

Yes, but what if I have cxx files in my directory?
(They were generated by SWIG.)

Regards, Christian

···

nobu.nokada@softhome.net wrote:

C rule should be generated below the .cxx rule.

Could you show me your extconf.rb?

This is the same problem I reported in this post (a few weeks back):

http://www.ruby-talk.org/blade/48866

I’d like to see this bug in mkmf.rb fixed as well.

Hope this helps,

Lyle

···

nobu.nokada@softhome.net wrote:

At Fri, 20 Sep 2002 23:02:50 +0900, > Christian Szegedy wrote:

all: example.o
…cxx.o :
g++ -c $@ $<

Are there two dots at beginning of the line, and the command
uses g++ directly?

The problem is that it does NOT work with gmake,
it says:

No rule to make target example.o', needed by all’. Stop.

Remark: if you substitute “cxx” by “C”, then it works.

C rule should be generated below the .cxx rule.

Could you show me your extconf.rb?

Hi,

···

At Sat, 21 Sep 2002 01:23:05 +0900, Christian Szegedy wrote:

But you can test the following example also:

all: example.o
…cxx.o :
g++ -DTEST_FLAG -c -o $@ $<

If you touch example.cxx, it won’t bild example.o.

It’s due to that mkmf.rb didn’t generate .SUFFEXES: rule, I’d
forgotten to backport it and done yesterday. Sorry.


Nobu Nakada

Lyle Johnson wrote:

http://www.ruby-talk.org/blade/48866

Hope this helps,

Thanks, I will change my mkmf.rb accordingly.

Regards, Christian

Thanks!

···

nobu.nokada@softhome.net wrote:

It’s due to that mkmf.rb didn’t generate .SUFFEXES: rule, I’d
forgotten to backport it and done yesterday. Sorry.