diff options
author | John Ankarstrom <john@ankarstrom.se> | 2021-07-06 22:12:01 +0200 |
---|---|---|
committer | John Ankarstrom <john@ankarstrom.se> | 2021-07-06 22:12:01 +0200 |
commit | ea4ba29c8d11f46e61d5a4b68c41dffecd6a3daf (patch) | |
tree | e26afd20d2e89e4d466a97d9b2b40e0e661f5274 | |
parent | 8558abc41b8d0515e07b552ca746f62c30c7502d (diff) | |
download | build-ea4ba29c8d11f46e61d5a4b68c41dffecd6a3daf.tar.gz |
Add build.1
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | build.1 | 84 |
2 files changed, 88 insertions, 0 deletions
@@ -1 +1,5 @@ build: build.c + +install: + install build /usr/local/bin + install -m 644 build.1 /usr/local/man/man1 @@ -0,0 +1,84 @@ +.Dd $Mdocdate$ +.Dt BUILD 1 +.Os +.Sh NAME +.Nm build +.Nd process and act on embedded build instructions +.Sh SYNOPSIS +.Nm +.Op Fl d +.Op Fl d +.Op Fl d +.Ar file +.Op Ar ... +.Sh DESCRIPTION +.Pp +.Nm +is a program which follows simple build instructions +embedded in source files. +The number of +.Fl d +flags control the printing of debugging information. +.Pp +.Nm +is decidedly not a +.Xr make 1 +replacement, except in trivial cases. +In such cases, however, +it is quite a nice and simple solution. +It is originally designed for generating +.Xr troff 1 +documents, +but can be used with arbitrary source files. +.Pp +The first twenty lines of each +.Ar file +are scanned for build information. +Build information is encoded in two ways: +.Bl -tag -width indent +.It command line +[anything] <whitespace> "$ " <shell command> [">" <target>] +.It dependency line +[anything] <whitespace> "% " <files separated by whitespace> +.El +.Pp +There can be multiple command lines, +but only one dependency line. +. +.Sh EXAMPLES +.Pp +Assuming that the file +.Pa doc.t +starts with the following text, +.Bd -literal -offset indent +\&.\\" This document is built with the following shell commands: +\&.\\" $ refer -p refs doc.t | troff -ms | dpost > doc.ps +\&.\\" $ ps2pdf doc.ps > doc.pdf +\&.\\" $ rm doc.ps +\&. +\&.\\" It depends on the following files: +\&.\\" % refs x.tmac +.Ed +.Pp +the invocation +.Bd -literal -offset indent +$ build doc.t +.Ed +.Pp +will generate +.Pa doc.pdf +by running the given commands, +depending on the relative modification times of +.Pa doc.t , +.Pa doc.pdf +and +.Pa x.tmac . +.\" .Sh DIAGNOSTICS +.\" .Sh SEE ALSO +.\" .Sh STANDARDS +.\" .Sh HISTORY +.Sh AUTHORS +.Nm +is written by John Ankarström +.Aq Mt "john (at) ankarstrom.se" . +.\" .Sh BUGS |