[GRASS5] Re: grass 5.7 windows?

Markus Neteler neteler at itc.it
Tue Mar 30 13:58:58 EST 2004

On Tue, Mar 30, 2004 at 04:22:38PM +0100, Glynn Clements wrote:
> Markus Neteler wrote:
> > Richard and me are currently testing some recent compilation
> > of 5.7 under Cygwin. A strange error occurs:
> > cp:
> > `/cygdrive/e/projects/grass/grass57_cvs/dist.i686-pc-cygwin/driver/db/dbf'
> > and
> > `/cygdrive/e/projects/grass/grass57_cvs/dist.i686-pc-cygwin/driver/db/shp'
> > are the same file
> Is this error correct? I.e. is .../db/shp a link (hard or symbolic) to
> .../db/dbf?

Actually I don't understand the error. It's copying the file,
why does it fail? The command in the Makefile is 'cp'. Quite strange,
but I cannot check from here.

> > I'm a bit clueless since it should simply copy a file to a new filename:
> > 
> > tail -3 ~/grass57/db/drivers/dbf/Makefile
> >         $(CC) $(LDFLAGS) -o $@ $(ARCH_OBJS) $(LIBES) $(MATHLIB) $(XDRLIB)
> >         cp $(DRIVER) $(SHPDRIVER)
> > 
> > Any ideas?
> According to the error message, the new filename refers to the same
> file as the old filename, so you're asking "cp" to copy a file onto
> itself, which it refuses to do.
> More generally, Makefiles should normally use $(INSTALL) rather than
> "cp". The "install" program (or autoconf's install-sh script on
> systems which don't have an install program) will handle this
> situation[1] somewhat better than "cp", as it replaces an existing
> file whereas "cp" will attempt to overwrite it ("cp" behaves similarly
> to "cat srcfile > dstfile").

Ah, so quite a few Makefiles (5.3 as well?) will need such changes.
> [1] It will also handle the situation where the destination file is
> read-only, or where the destination is the executable for some
> process.

Sounds good. Thanks for the insights.


More information about the grass-dev mailing list