<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 26, 2016 at 7:28 AM, Glynn Clements <span dir="ltr"><<a href="mailto:glynn@gclements.plus.com" target="_blank">glynn@gclements.plus.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
Anna Petrášová wrote:<br>
<br>
> cp: the -H, -L, and -P options may not be specified with the -r option.<br>
><br>
> make: *** [install] Error 1<br>
><br>
><br>
> It seems cp -r (lowercase r) is not portable, see [1]. Mac cp man page says:<br>
><br>
> Historic versions of the cp utility had a -r option. This implementation<br>
> supports that option; how-ever, however, ever, its use is strongly<br>
> discouraged, as it does not correctly copy special files, symbolic links,<br>
> or fifo's.<br>
><br>
> lowercase r is used on couple of places, mainly include/Make/Install.make.<br>
> So my question is if anyone thinks there are some valid reasons for using<br>
> lowercase r.<br>
<br>
</span>"cp" probably shouldn't be used at all.<br>
<br>
Executable files should be installed with $(INSTALL), non-executable<br>
files with $(INSTALL_DATA).<br>
<br>
In either case, they should only be used to copy a rule's prerequisite<br>
to its target (i.e. no unconditional "bulk" copies in the body of an<br>
unrelated rule), as in:<br>
<br>
        destination: source<br>
                $(INSTALL_DATA) $< $@<br>
<br>
If the number of files is large, $(wildcard ...) and $(patsubst ...)<br>
should be used to construct a list of targets which should then be<br>
made prerequisites of the Makefile's "default" rule, with the<br>
installation performed by a pattern rule.<br>
<br>
The only places "cp" is used in the actual GRASS source tree (not<br>
including "addons") are in Install.make, the "install" targets of a<br>
couple of other *.make files, and the "update-po" target in<br>
locale/Makefile. None of these are part of the actual build process.<br>
<br>
(I just removed the one in simlib; Rules.make already has a pattern<br>
rule for installing headers).<br>
<br>
FWIW, the "portable" solution for recursive copies has historically<br>
been to use "tar c ... | tar x ...".<br></blockquote><div><br></div><div>Thanks for the information on this. However, for now, I just fixed one of the usages in Script.make (by changing -r to -R) to be able to install the addon, since I can't fix it properly.</div><div><br></div><div>Anna</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Glynn Clements <<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>><br>
</font></span></blockquote></div><br></div></div>