Subject: Re: 1.11 doesn't add sources with nonstandard suffixes when making a binary

From: Юрий Пухальский <[email-masked]>
Date: Tue, 11 Jan 2011 17:48:08 +0300

Good day, Ralf!

I've (finally) made it through two implicit rules, but i have a problem there.

The makefile looks something like that:

------------------------
.SUFFIXES: .pc .lo .c
.pc.c:
	cp $< $@
.c.lo:
	cp $< $@
------------------------

Given that i have no .c and no .lo before invoking make, it works good
with gmake and aix make.
While on HP-UX it doesn't:
--- skipped some lines of setting vars ---
Reading Makefile
doname(a.lo,0)
TIME(a.lo)=0
setvar: @ = a.lo noreset = 0 envflg = 0 Mflags = 040001
setvar: @ =  noreset = 0 envflg = 0 Mflags = 040001
look for explicit deps. 0
look for implicit rules. 0
right match = a.lo
setvar: @ = a.lo noreset = 0 envflg = 0 Mflags = 040001
setvar: ? =  noreset = 0 envflg = 0 Mflags = 040001
predecessor list: $! =  a.lo
right match = a.lo
setvar: @ = a.lo noreset = 0 envflg = 0 Mflags = 040001
setvar: ? =  noreset = 0 envflg = 0 Mflags = 040001
predecessor list: $! =  a.lo
Make: Don't know how to make a.lo.  Stop.
--------------------------------------

If .c file is present, it works:

-------------------------------------
doname(a.lo,0)
TIME(a.lo)=0
setvar: @ = a.lo noreset = 0 envflg = 0 Mflags = 040001
setvar: @ =  noreset = 0 envflg = 0 Mflags = 040001
look for explicit deps. 0
look for implicit rules. 0
right match = a.lo
a.c ---.c.lo--- a.lo
   doname(a.c,1)
setvar: @ = a.c noreset = 0 envflg = 0 Mflags = 040001
setvar: @ =  noreset = 0 envflg = 0 Mflags = 040001
   look for explicit deps. 1
   look for implicit rules. 1
   right match = a.c
   a.pc ---.pc.c--- a.c
      doname(a.pc,2)
setvar: @ = a.pc noreset = 0 envflg = 0 Mflags = 040001
setvar: @ =  noreset = 0 envflg = 0 Mflags = 040001
      look for explicit deps. 2
      look for implicit rules. 2
      right match = a.pc
setvar: < =  noreset = 0 envflg = 0 Mflags = 040001
setvar: * =  noreset = 0 envflg = 0 Mflags = 040001
   TIME(a.pc)=1294756730
setvar: * = a noreset = 0 envflg = 0 Mflags = 040001
setvar: < = a.pc noreset = 0 envflg = 0 Mflags = 040001
setvar: < =  noreset = 0 envflg = 0 Mflags = 040001
setvar: * =  noreset = 0 envflg = 0 Mflags = 040001
TIME(a.c)=1294757269
setvar: * = a noreset = 0 envflg = 0 Mflags = 040001
setvar: < = a.c noreset = 0 envflg = 0 Mflags = 040001
setvar: @ = a.lo noreset = 0 envflg = 0 Mflags = 040001
setvar: ? = a.c noreset = 0 envflg = 0 Mflags = 040001
predecessor list: $! =  a.lo
        cp a.c a.lo
nenv = 34
setvar: @ =  noreset = 0 envflg = 0 Mflags = 040001
setvar: % =  noreset = 0 envflg = 0 Mflags = 040001
setvar: < =  noreset = 0 envflg = 0 Mflags = 040001
setvar: * =  noreset = 0 envflg = 0 Mflags = 040001
-------------------------------------

Maybe You know a way to do it right?

On Sat, Nov 28, 2009 at 12:50 AM, Ralf Wildenhues
<[email-masked]> wrote:
> Hi Jack,
>
> * Jack Kelly wrote on Fri, Nov 27, 2009 at 10:37:55PM CET:
>> 2009/11/28 Ralf Wildenhues:
>> > That's why you should do it like this:
>> >
>> > .pc.$(OBJEXT):
>> >        ...
>>
>> I'm confused. Why is this better than writing a .pc.c rule? Doesn't it
>> sacrifice proper dependency tracking on the generated .c file?
>
> Because it's late and I avoid caffeine in the evening.  ;-)
> Of course, .pc.c.
>
> Thanks,
> Ralf
>
>
>

-- 
«The good thing about standards is there are so many to choose from.»