[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: makefile improvements
From: |
Ben Pfaff |
Subject: |
Re: makefile improvements |
Date: |
Mon, 12 Oct 2009 20:45:12 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
John Darrington <address@hidden> writes:
> On Mon, Oct 12, 2009 at 08:56:08AM -0700, Ben Pfaff wrote:
>
> > $(POFILES): $(POTFILE)
> > $(MSGMERGE) $(top_srcdir)/$@ $(top_srcdir)/$(POTFILE) -o $@
> >
> > $(POTFILE) is a generated file, so it will be in $(top_builddir) not
> > $(top_srcdir).
>
> I hadn't realize that.
>
> When we make a distribution with "make dist", $(POTFILE) will be
> distributed and thus it will be in the source directory. Does
> this mean that we have to cope with both possible locations?
>
> Is that something we can change? Do we really need pspp.pot to be in
> the tarball? If not, then I guess we will indeed have to cope with
> both locations. And that is of course why the VPATH feature and the
> $< variable was invented.
I think I've found a satisfactory solution that avoids the need
to search for the path by hand. POSIX requires $? to work even
though it does not require $< to work. Since there is only one
target in this case, $? is always equivalent to $<.
The autoconf manual actually mentions this. I had forgotten that
it had a chapter on VPATH:
A simple workaround, and good practice anyway, is to use `$?' and
`$@' when possible:
VPATH = ../pkg/src
f.c: if.c
cp $? $@
but this does not generalize well to commands with multiple
prerequisites.
We still do need to distribute pspp.pot, but this is easier to
read than searching by hand.
--
Ben Pfaff
http://benpfaff.org