If you want to write a portable makefile, you use a CP variable which is conditionally set depending on what uname says, e.g. cp -r on GNU Linux and whatever it is on Mac OS. But also, copying files around is a bit out of make's scope, as it is a tool for transforming files. Most standard tools that are used in makefiles (sed, awk, m4, c toolchain) have posix interfaces, and other compilers usually don't have incompatible competing implementations. Even if you want to use a certain implementations features, say GNU features of awk, gawk+GNU coreutils are available for all popular systems, as well as bsdutils. Requiring them is better than when every program require its own build system because they are portable and reusable packages.
Re:Time for Makefiles to Make a Comeback
by jlebrech on Tuesday September 05, 2017 @08:44AM
(#15174556)
maybe projects should have their own ./bin folder for make to use and have those command refer to the right native command.
mixing make with a modern scripting language would make this possible.
Re:Time for Makefiles to Make a Comeback
by lederhosen on Tuesday September 05, 2017 @06:13PM
(#15179543)
GNU Make has built in support for scheme
PS. Copying files specifically is such huge PITA that cmake implements crossplatform copy for you, just run "cmake -E copy $in $out" (can be added as add_custom_command in CMakeLists.txt)