* Harlan Stenn wrote on Wed, Sep 06, 2006 at 08:28:01AM CEST: > > > > Two ways to get out of this: > > > > - do not stick $(srcdir)/ in front of the prerequisites. For example, > > > > this should work portably (if you take care not to stick $(srcdir)/ > > > > elsewhere before the *.in files): > > > > > > > > rpmbuildupdate: rpmbuildupdate.in > > > > perl -pi -e s'|[EMAIL PROTECTED]@|$(sysconfdir)|' \ > > > > < $(srcdir)/rpmbuildupdate.in > $@ > > > > > > > > rpmbuildupdate.comp: rpmbuildupdate.comp.in > > > > perl -pi -e s'|[EMAIL PROTECTED]@|$(sysconfdir)|' \ > > > > < $(srcdir)/rpmbuildupdate.comp.in > $@ > > > > > > > > (Note that even Solaris make would not VPATH-rewrite the rule, since the > > > > string `rpmbuildupdate.in' is not surrounded by white space in the > > > > rule.)
> > What am I missing? > > Probably nothing - I may have read what you wrote "differently" from > what you intended. I was concerned about your first case - if somebody > goes to the trouble of putting a $(srcdir)/ on a target or a dependency, > they need to be either "most everywhere" or nowhere. > > This may not be true, but it is a rule I currently accept. A don't disagree with that rule anywhere. Your "rule" doesn't contradict my "first case", because there, no "$(srcdir/)" is put on any target nor prerequisite, so your "rule" does not apply. "$(srcdir)/" is only added to _all_ occurrences in the rule (i.e., the commands to execute). And for the quoted reason below that means it also works with Solaris make: > > The above will > > work with Solaris make: all instances of `rpmbuildupdate.in' in the > > rule are _not_ surrounded by whitespace: there is a `/' right before > > them. So they are not rewritten in this case. Cheers, Ralf PS: I've quoted your "rule" in order to distinguish it from the notion of a makefile rule, written without quotes.
