Hacker News new | ask | show | jobs
by shoo 961 days ago
i agree. make is a tool for defining recipes to derive target files from dependency files. archetypal use case would be compiling and linking a bunch of C source and header files into an application binary. make isn't specialized to building C programs, make can also be used for other file-driven computation tasks such as defining data processing pipelines / graphs of processing that consume data files and produce data files.

the rough essence of make is arguably:

1. there are targets, and recipes (written as a shell command) to derive the target 2. targets can express dependencies on other targets 3. targets are files in the filesystem. 4. add a bunch of language features on top (pattern rules, automatic variables, built-in functions, etc) to make it easier to write and maintain the recipes

Another way of thinking about make is that it is a a way to define and evaluate gigantic pure-functional expressions, where each input and output file is a file, and where intermediate sub-expressions can be cached.

for an alternative to make that supports 1+2+3+4, see e.g. https://gittup.org/tup/index.html

for an alternative to make that supports 1+2+3 but explicitly does not aim to support 4, see e.g. https://ninja-build.org/manual.html

another alternative to make that supports 1+2+3+4 but de-emphasizes 3, "targets are files", from the ruby community, is https://github.com/ruby/rake

these days in projects it is quite common to see make used to do 1 but not 2, 3 nor 4. i.e. a makefile as a way to define a bunch of imperative shell recipes for named targets, where each named target has no relationship to a file, and dependencies between the targets aren't expressed or relevant. as a random example of this, here's the first google result searching for "makefile terraform":

https://github.com/paulRbr/terraform-makefile/blob/master/Ma...

note all the targets are ".PHONY" targets, we're telling make to disable the default behaviour where every target corresponds to a file in the file system -- to turn off "3 targets are files in the filesystem". there's very sparing use of dependencies. so this is an example of using makes support for 1 defining recipes to produce targets and a little splash of 2 dependencies between targets, but not 3 nor 4.

it looks like this "jeeves" project is aiming at this latter use case, not attempting to implement support for 2+3, the core of how make is typically used as a build tool

2 comments

You should add

5. allow partial rebuilding of targets

When I checked some build systems several year ago, many turned out to re-build just everything.

That's right. For projects which only use subset of Make features described by (1) jeeves can be considered an alternative for Make, and I would believe there are quite a few such projects.