On Samstag, 8. April 2023 18:40:01 CEST Bernhard Voelker wrote:
On 4/7/23 12:48, mh@mike.franken.de wrote: [...]
Using -f forces overwriting existing files, -n should preserve them, if they exist.
Sure, but I wouldn't know a place in Makefiles where the latter would be used.
It would look a bit strange to me just to avoid the double writing of the destination file if various targets would copy the same content from different places to it. Otherwise, if the Makefile would instruct to copy the same file again and again (with or without overwriting), then this would be strange either. Finally, if the content of the source files was different, then I'd call it even a bit fishy for a build process to copy just the first one.
I don't say that -n is not useful in general or not used in scripts or interactively, but probably very seldom in Makefiles ... and if so, then that option could probably just be removed there.
It can be and is used for copying a first set of config files to a config directory. But if the files are still there and possibly modified you wouldn't want to overwrite them.
Have a nice day, Berny
Bye. Michael.