From a29a7207a1fce99557776576349da04eb8e92c06 Mon Sep 17 00:00:00 2001 From: Daniel Jones Date: Mon, 4 Aug 2014 13:42:57 -0700 Subject: [PATCH] Slightly expand README. --- README.md | 31 ++++++++++++++++++++++++++++++- mk.go | 2 +- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fb18161..7eee7db 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# Mk +!["Logo"](http://dcjones.github.com/mk/mk.svg) Mk is a reboot of the Plan 9 mk command, which itself is [a successor to make](http://www.cs.tufts.edu/~nr/cs257/archive/andrew-hume/mk.pdf). This tool @@ -68,6 +68,35 @@ improvements. file. Just stick it directly in the mkfile. 1. Pretty colors. + +# Usage + +`mk [options] [target] ...` + +## Options + + * `-f filename` Use the given file as the mkfile. + * `-n` Dry run, print commands without actually executing. + * `-r` Force building of the immediate targets. + * `-a` Force building the targets and of all their dependencies. + * `-p` Maximum number of jobs to execute in parallel (default: 8) + * `-i` Show rules that will execute and prompt before executing. + + +# Non-shell recipes + +Non-shell recipes are a major addition over Plan 9 mk. They can be used with the +`S[command]` attribute, where `command` is an arbitrary command that the recipe +will be piped into. For example, here's a recipe to add the read numbers from a +file and write their mean to another file. Unlike a typical recipe, it's written +in Julia. + +```make +mean.txt:Sjulia: input.txt + println(open("$target", "w"), + mean(map(parseint, eachline(open("$prereq"))))) +``` + # Current State Functional, but with some bugs and some unimplemented minor features. Give it a diff --git a/mk.go b/mk.go index 550baba..7abfdc8 100644 --- a/mk.go +++ b/mk.go @@ -301,7 +301,7 @@ func main() { flag.BoolVar(&dryrun, "n", false, "print commands without actually executing") flag.BoolVar(&shallowrebuild, "r", false, "force building of just targets") flag.BoolVar(&rebuildall, "a", false, "force building of all dependencies") - flag.IntVar(&subprocsAllowed, "p", 8, "maximum number of jobs to execute in parallel") + flag.IntVar(&subprocsAllowed, "p", 4, "maximum number of jobs to execute in parallel") flag.BoolVar(&interactive, "i", false, "prompt before executing rules") flag.Parse()