|
NAMEmbldSYNOPSISmbld [-?hcfrSs] [-b bin] [-l lib] [-R src] [-I inc] [-B base] [-r runtime] [all | clean | install | uninstall | test | file... | target...]DESCRIPTIONThe 'mbld' tool takes as input a list of Myrddin or assembly sources, and compiles them in the correct dependency order into either a library or an executable.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. Mbld will default to building for the current architecture and operating system. OPTIONS
ACTIONSMbld already knows how to do most of the common commands. Given a file describing your project, it can build, test, clean, install, uninstall, and benchmark your code.
BUILD FILESBuild files contain lists of targets. Targets generally consist of a target type. This is usually followed by target name, an attribute list, and the list of inputs.Each Myrddin source file may have a corresponding implicit test. If a source file foo.myr is built, then the corresponding test/foo.myr is used as the testcase for foo.myr if it exists. A typical build file may look something like: bin foo = main.myr gen-foo.myr ;; man = foo.1 ;; gen gen-foo.myr = sh -c "echo $FOO > gen-foo.myr" ;; lib foothing = lib.myr ;; The full grammar is listed below: bldfile : bldent+ bldent : "bin" target | "lib" target | "test" target | "bench" target | "gen" target | "cmd" target | "data" flist | "man" flist | "sub" flist | option option : "incpath" "=" list | "libdeps" "=" list | "testdeps" "=" list | "runtime" word | "noinst" target : name [attrs] "=" list flist : [attrs] "=" list list : name+ ";;" attrs : "{" (key [ "=" value])* "}" name : <nonspace> | <quoted word> Bin, test, and bench targets all behave in a very similar way. They all produce a single binary from a list of Myrddin sources, scraping the appropriate library dependencies and building any libraries from the local source directories. Bin targets are installed to ${BASEDIR}/bin when invoking mbld install. Test and bench targets built and run when invoking mbldbench. Tests are run with the cwd set to the directory that contains the test source Lib targets also resemble bin targets, but instead of producing a binary, they produce a .use and .a file pair. These files are installed to ${BASEDIR}/lib/myr when invoking mbldinstall. Gen and cmd targets are also similar to each other, varying largely in when and how they are invoked. Gen targets specify an output file, and are run in response to a target requiring their output. On the other targets are not invoked implicitly at all, unless they have an attribute such as test or bench. Instead, they are invoked explicitly by the user, bundling up some useful command or another, possibly providing system specific variants. Data targets allow the specification of bundled static data. This data may be generated from a gen target, or may simply be shipped as a file. The data is installed to the system specific share directory. For example, on Unix, this may be ${BASEDIR}/share. Man targets are installed to the system-appropriate manual directory. The section is determined by the manpage suffix. For example foo.1 would be installed into section 1 of the manual. Sub targets include a bld.sub or bld.proj from a subdirectory. If the file in the subdirectory is bld.proj then the root of the project is changed for that subbuild. ATTRIBUTESMany targets support attributes. These are the valid attributes allowed in the targets.
FILES
EXAMPLEmbld The command above will load bld.proj and all associated sub builds, and run the commands to incrementally rebuild the code. mbld -l foo bar.myr baz.myr The command above will ignore bld.proj and produce a library named libfoo.a, consisting of the files bar.myr and baz.myr ENVIRONMENT VARIABLES
SOURCESThe source for mbld is available from git://git.eigenstate.org/git/ori/mc.git and lives in the mbld/ directory within the source tree.SEE ALSO6m(1) muse(1) ld(1) as(1)BUGSNone known. Visit the GSP FreeBSD Man Page Interface. |