|
|
|
|
|
by obezyian
265 days ago
|
|
Articles like this one are more likely to drive people away from make(1) than teach them to appreciate it. This Makefile is anything but simple. It uses advanced features that are meant for complicated situations, just to create a few symlinks. The same symlinks, every time. And if you introduce a new dotfile to the repo, you have to update the Makefile too. It also makes no use of the main feature of make(1) - to track files for changes, and update them. For demonstration, here is the same functionality, in sh(1): files=$(find files -type f | sed s=^files/==)
echo "$files" | sed s=[^/]*\$== | sort -u | { cd; xargs mkdir -p; }
echo "$files" | xargs -I{} -n1 ln -sf $PWD/files/{} ~/{}
Doesn't use advanced features, shorter, and you don't need to update the script for new dotfiles. And more "ubiquitous" than GNU make. |
|
The real point of make is it's a declarative build system. You just tell it to make and it will do what needs to be done by figuring out dependencies and rebuilds.