summaryrefslogtreecommitdiff
path: root/ninja.rc
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2016-12-18 16:28:38 -0800
committerMichael Forney <mforney@mforney.org>2016-12-19 00:05:57 -0800
commit2420bcc6b191d1db5d324a4b4dd597da25843338 (patch)
tree895d2fc168ff855a1dac3b77ecdd91f1cf84cc88 /ninja.rc
parent393306274e1042368f586516cff41c0e222493cb (diff)
Compress man pages
Diffstat (limited to 'ninja.rc')
-rw-r--r--ninja.rc31
1 files changed, 31 insertions, 0 deletions
diff --git a/ninja.rc b/ninja.rc
index 7e9278ec..d9deee54 100644
--- a/ninja.rc
+++ b/ninja.rc
@@ -197,6 +197,37 @@ fn sym {
status=()
}
+fn man {
+ srcdir='$srcdir'
+ outdir='$outdir'
+ if(~ $1 -d) {
+ if(~ $2 '$'*) {
+ srcdir=$2
+ outdir=$2
+ }
+ if not {
+ srcdir='$srcdir'/$2
+ outdir='$outdir'/$2
+ }
+ shift 2
+ }
+ mandir=share/man
+ for(src) {
+ if(~ $src [1-9])
+ mandir=share/man/man$src
+ if not {
+ if(~ $src *.gz)
+ gz=$srcdir/$src
+ if not {
+ build $outdir/$src.gz gzip $srcdir/$src
+ src=$src.gz
+ gz=$outdir/$src
+ }
+ file $mandir/$src $outdir/$src 644
+ }
+ }
+}
+
fn fetch {
# Use a phony rule and stamp file to prevent ninja from making parent
# directories.