The creativity comes in when dealing with cross-platform compatibility: Not all file listing commands are implemented the same. ls(1) doesn't work the same across all shell systems, and find on BSD accepts different arguments than GNU's find. So to collect a list of files to watch, we use POSIX find and store it in a Make variable.
Then, there's a need to get a cross platform file watcher. This is tricky since file events work differently across operating systems. So we bring in entr(1) (http://entrproject.org/). This works across Linux, BSD's and macOS and packaged across linux distros, ports, and homebrew.
Another random tip: For recursive Make calls, use $(MAKE). This will assure that non-GNU Make systems can work with your scripts. See here: https://github.com/liuxinyu95/AlgoXY/pull/16
I use Makefile's regularly on open source and personal profiles (e.g. https://github.com/tony/tmuxp/blob/master/Makefile). Feel free to take and use that code, it's available under the BSD license.
The creativity comes in when dealing with cross-platform compatibility: Not all file listing commands are implemented the same. ls(1) doesn't work the same across all shell systems, and find on BSD accepts different arguments than GNU's find. So to collect a list of files to watch, we use POSIX find and store it in a Make variable.
Then, there's a need to get a cross platform file watcher. This is tricky since file events work differently across operating systems. So we bring in entr(1) (http://entrproject.org/). This works across Linux, BSD's and macOS and packaged across linux distros, ports, and homebrew.
Another random tip: For recursive Make calls, use $(MAKE). This will assure that non-GNU Make systems can work with your scripts. See here: https://github.com/liuxinyu95/AlgoXY/pull/16