by sciencerobot on 5/15/20, 4:22 PM with 43 comments
by brandmeyer on 5/15/20, 5:33 PM
Author probably wants to use `private` for those target-local variables, though.
For example,
R: .SHELLFLAGS := -e
R: SHELL := Rscript
R:
greeting = "bonjour"
message(paste0(greeting, ", R!"))
Everything that target `R` depends on will also have SHELL and .SHELLFLAGS over-ridden. If `R` depends on some data generated by another program, it probably wants to be built and executed with the default SHELL (or another shell, perhaps). R: private .SHELLFLAGS := -e
R: private SHELL := Rscript
R:
greeting = "bonjour"
message(paste0(greeting, ", R!"))
Now, `R`'s dependencies will be generated with the makefile's defaults.Usually I prefer to build up richer stages like this using the system shell anyway, though. Build a target which in turn is executed by the shell normally to traverse the next edge in the graph. But I can see how this mechanism has its uses.
See also https://www.gnu.org/software/make/manual/html_node/Target_00...
by gregwebs on 5/15/20, 6:05 PM
[just](https://github.com/casey/just) is a tool that feels similar to make but is designed explicitly for the purpose of running commands.
I think of this as a simple CLI for your project workflow. You still really want to avoid putting code into a Justfile and put it into scripts. But the Justfile helps provide a slightly nicer UX and automatically invoke dependencies.
by epistasis on 5/15/20, 5:33 PM
#!/usr/bin/make -f
And then putting them in my $PATH. I run them with arguments like: $ process-data.mk INTSV=a.tsv DB=largefile.gz OUTDIR=finished
This makes me feel like I've sold my soul to the devil, and that I'm just living on borrowed time until it all fails and falls apart. It hasn't yet, however...by ainar-g on 5/15/20, 5:58 PM
by IshKebab on 5/15/20, 8:33 PM
by adelarsq on 5/15/20, 6:56 PM
Pull requests are welcome.
by mehrdadn on 5/15/20, 5:31 PM
by purplezooey on 5/15/20, 11:33 PM