[GRASS5] Re: grass 5.7 windows?

Glynn Clements glynn.clements at virgin.net
Tue Mar 30 10:22:38 EST 2004


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?

> 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").

[1] It will also handle the situation where the destination file is
read-only, or where the destination is the executable for some
process.

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-dev mailing list