\"make\" is not only useful for building your programming project, but it seems to be under-used in other areas.
For example, many shell scripts can be rewritten as
Make can also be used as a sync utility. For example:
#!/usr/bin/make -f
FILES = *.html *.js *.css images/*.jpg subpage/*.html
LAST_SYNC = .last_sync
SCP = scp webserver.com:/home/john/public_html
.PHONY: sync
sync : $(LAST_SYNC)
$(LAST_SYNC) : $(FILES)
$(SCP) $?
touch $(LAST_SYNC)
This Makefile creates an empty file .last_sync that is used to record the last time that we synced the local repository with the remote one. Each time this script is run, Make will check whether any of the files listed in FILES have been modified since the last time we ran the sync, will copy them to the server and will then update the timestamp on .last_sync. The key is the automatic variable $?, which holds the list of all prerequisites that are newer than the target of the rule.