Bruno Haible <[EMAIL PROTECTED]> writes: > Oskar Liljeblad wrote: >> > byteswap.h: byteswap_.h >> > - cp $(srcdir)/$< [EMAIL PROTECTED] >> > + cp $(srcdir)/byteswap_.h [EMAIL PROTECTED] >> > mv [EMAIL PROTECTED] $@ >> >> 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 _______________________________________________ bug-gnulib mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-gnulib
