ref: ae222f2157fa57dd27ff23bcb13c78adc08627b2
parent: 2176941003e95b0c595fc37ca1a7a85e21f10d54
author: Ori Bernstein <[email protected]>
date: Wed Apr 22 06:02:59 EDT 2015
Update documentation, and remove nop/useless options to match.
--- a/mbld/main.myr
+++ b/mbld/main.myr
@@ -25,8 +25,6 @@
while !std.optdone(optctx)
match std.optnext(optctx)
| ('h', arg): usage(args[0])
- | ('s', arg): bld.opt_ldscript = arg
- | ('f', arg): bld.opt_bldfile = arg
| ('I', arg): bld.opt_incpaths = std.slpush(bld.opt_incpaths, arg)
| ('S', _): bld.opt_genasm = true
| ('R', arg): bld.opt_instroot = arg
@@ -69,7 +67,6 @@
.inputs=optctx.args,
.runtime=bld.opt_runtime,
.incpath=bld.opt_incpaths,
- .ldscript=bld.opt_ldscript,
.libdeps=[][:]
]
if bintarg
@@ -78,7 +75,7 @@
bld.buildlib(b, &mt)
;;
else
- findproj(b, bld.opt_bldfile)
+ findproj(b, "bld.proj")
bld.load(b)
/*bld.configure()*/
/* default: buildall */
--- a/mbld/mbld.1
+++ b/mbld/mbld.1
@@ -4,8 +4,13 @@
.SH SYNOPSIS
.B mbld
.I [all | clean | install | uninstall | test]
-.I -[hblIsfrR]
-.I [file...]
+.I -[hsSfr]
+.I [-b bin]
+.I [-l lib]
+.I [-I inc]
+.I [-R root]
+.I [-r runtime]
+.I [file... | targets...]
.br
.SH DESCRIPTION
.PP
@@ -14,12 +19,13 @@
an executable.
.PP
-By default, it reads from an input file called 'bldfile', but if given the
+By default, it reads from an input file called 'bld.proj', but if given the
option '-b' or '-l', it will build a binary or library, respectively, from
the arguments specified on the command lines.
.PP
-Myrbuild will default to building for the current architecture.
+Myrbuild will default to building for the current architecture and operating
+system.
.PP
The myrbuild options are:
@@ -29,39 +35,92 @@
Print a summary of the available options.
.TP
-.B -b name
+.B -b \fIbinname\fP
Compile source into a binary named 'name'. If neither this option nor
the '-l' option are given, myrbuild will create a binary called 'a.out'.
.TP
-.B -l 'name'
-Compile source given into a library called 'lib<name>.a', and a matching
-usefile called 'name'. Only static libraries are currently supported.
+.B -I \fIpath\fP
+Add 'path' to the search path for unquoted use statments. This option
+does not affect the search path for local usefiles, which are always
+searched relative to the compiler's current working directory. Without
+any options, the search path defaults to /usr/include/myr.
.TP
-.B -s 'script'
-Pass the linker script 'script' to the linker. If this option is not
-provided, no script is passed to the linker.
+.B -l
+.I libname
+Compile source given into a library called 'lib\fIname\fP.a' (or the equivalent
+for the target platform), and a matching usefile called 'name'. Only static
+libraries are currently supported. Ignores the contents of \fIbld.proj\fP
+and \fIbld.sub\fP if they exist.
.TP
-.B -r 'rt'
+.B -S
+Tell the toolchain to generate assembly for the code being compiled as well
+as the .o files, as though '-S' was passed to 6m.
+
+.TP
+\fB-r \fIruntime
Compile a binary using the runtime 'rt'. If the runtime name given
is 'none', then no runtime will be linked. If this option is not provided,
then the default runtime in '$INSTALL_ROOT/myr/lib/_myrrt.o' will be
used.
+.SH ENVIRONMENT VARIABLES
+
.TP
-.B -I path
-Add 'path' to the search path for unquoted use statments. This option
-does not affect the search path for local usefiles, which are always
-searched relative to the compiler's current working directory. Without
-any options, the search path defaults to /usr/include/myr.
+.B DESTDIR
+prepends $DESTDIR to the path to install to. For example, if the installgg
+prefix is /usr, the binary path is bin/, then binaries will get copied
+to $DESTDIR/usr/bin on
+.B mbld install
+.TP
+.B MYR_MC
+Compiles the binaries with '$MYR_MC' instead of the default value of
+6m.
+
+.TP
+.B MYR_MUSE
+Merges usefiles with '$MYR_MUSE' instead of hte default value of
+muse.
+
+.TP
+.B MYR_RT
+Links with the runtime $MYR_RT instead of the default of
+prefix/lib/myr/_myrrt.o.
+
+.SH FILES
+
+.TP
+.I bld.proj
+The root project file. All paths in bldfiles are relative
+to the most recent one in the directory heirarchy.
+
+.TP
+.I bld.sub
+A sub build. This contains targets, and may specify dependencies
+on other targets within the same project.
+
.SH EXAMPLE
.EX
mbld
+.EE
+
+.PP
+The command above will load bld.proj and all associated sub builds,
+and run the commands to incrementally rebuild the code.
+
+.EX
mbld -l foo bar.myr baz.myr
.EE
+
+.PP
+The command above will ignore bld.proj and produce a library
+named \fIlibfoo.a\fP, consisting of the files \fIbar.myr\fP
+and \fIbaz.myr\fP
+
+
.SH FILES
The source for muse is available from
--- a/mbld/opts.myr
+++ b/mbld/opts.myr
@@ -7,13 +7,11 @@
var opt_sys : byte[:]
var opt_runtime : byte[:]
var opt_genasm : bool
- var opt_ldscript : byte[:]
var opt_incpaths : byte[:][:]
var opt_instroot : byte[:]
var opt_manpath : byte[:]
var opt_destdir : byte[:]
var opt_outdir : byte[:]
- var opt_bldfile : byte[:]
var opt_debug : bool
/* undocumented/unsupported opts */
@@ -32,13 +30,11 @@
var opt_binname = ""
var opt_libname = ""
var opt_runtime = ""
-var opt_ldscript = ""
var opt_incpaths /* FIXME: taking a constant slice is a nonconstant initializer */
var opt_instroot = ""
var opt_manpath = ""
var opt_destdir = ""
var opt_debug = false
-var opt_bldfile = "bld.proj"
var opt_mc = "6m"
var opt_as = "as"
var opt_muse = "muse"