Makefiles are great for automating builds, installs and tests.
But, that is not the end of Make. I have used makefiles to do many tasks like cleaning up logs, keeping mirrored web pages and downloads, hooked them into crontabs and test suites...
Like scripting, I think there is a large scope of automating with Makefiles. Particularly when you have a chain of dependency based triggering required.
What different things have you done using Makefiles?
What are you planning to do more with them, on a rainy day perhaps.
My resume. LaTeX input, PDF output.
I like Makefiles very much, especially for junior sysadmins.
Update the bind zonefile?
No problem: target has
checkzone
andcheckconfig
(out of memory) and only doessudo cp <editlocation> <reallocation>; git commit -a ....
if everything seems basically fine...Complex deployment?
No problem record it in a Makefile
I've pretty much used Makefiles anywhere where a script would have been appropriate also. Acutally I combine them,
/usr/local/[s]bin/
is where the "single step" scripts are and the Makefile is in the working directory of the service in question.Actually I have used them a lot more for the above reasons than for build systems - that is if you don't count latex and builds from upstream.
Since we're pretty much a Ruby shop, I use Rake instead of Make. I've automated the following with Rake, and it shouldn't be too difficult to do these with Make:
EC2 node maintenance. Create and terminate instances.
Create a tarball and upload it to S3.
Deploy server configurations; mainly by calling rsync for directories and directly copying singleton files.
Convert Ruby DSL code into JSON data.
Handle software releases in a git repository (creating new branches, tags, etc).
sendmail.cf back in the 8.9 days if I recall.
I used makefiles to handle XML transformation from DocBook sources. That way I could pipeline all of the commands and do "make pdf" or "make wordml" from the same source depending on who the intended audience was.
Nothing really. I find Makefile syntax to be horrible for most day-to-day tasks and I try to only interact with Makefiles when absolutely necessary. For system administration tasks, I don't see what they offer over a Bash or Python script. For building software, there are better build systems out there.
I've used it to "print all notes since last printing" in a random notes directory:
I echoed the command into the flag file so I could just ". printflag" to reprint the same set if need be;
to maintain DNS / DHCP / etc. :
(or just "edit hosts.dat; make restart" for the foolishly brave)
and as a quick and dirty way to generate manual scripts for procedures -- that is, just use pseudo targets and have the makefile commands echo something along the lines of "do step Foo" -- when you need something more sophisticated than tsort
I know some people used to use Makefile script instead of init scripts. This effectively made them run paralelly and define dependencies between steps.