[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gnulib] Re: [patch] byteswap module fails when building from su
From: |
Ben Pfaff |
Subject: |
Re: [bug-gnulib] Re: [patch] byteswap module fails when building from subdir |
Date: |
Sat, 30 Jul 2005 09:43:01 -0700 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) |
Bruno Haible <address@hidden> writes:
> Oskar Liljeblad wrote:
>> > byteswap.h: byteswap_.h
>> > - cp $(srcdir)/$< address@hidden
>> > + cp $(srcdir)/byteswap_.h address@hidden
>> > mv address@hidden $@
>>
>> Can you please explain why this is necessary,
>> so that I won't make the same mistake in the future again?
>
> See the POSIX specification of "make", at
> http://www.opengroup.org/onlinepubs/009695399/utilities/make.html :
> $< is defined for inference rules only. Not for target rules.
> GNU make implements $< also for target rules, but other "make" programs
> don't.
That is one reason, but there is another also. When the build
directory is different from the source directory, $< expands to
the file name in the source directory, e.g. ../../gl/byteswap_.h.
Thus, $(srcdir)/$< expands to something like
../../gl/../../gl/byteswap_.h, which will fail. This is the
actual problem that I encountered.
--
"MONO - Monochrome Emulation
This field is used to store your favorite bit."
--FreeVGA Attribute Controller Reference