minmake is a Java/XML based platform-independent make tool....
Move to
Next Prev
Up Top
See also
minerva
minervad
minervagui
minervac
minervax
minervar
minmake
mjava
mjavac
mjar
IF Computer > MINERVA > Manual > Reference > Invocation > minmake

minmake

minmake is a Java/XML based platform-independent make tool.

minmake does the same job as UNIX make or Windows nmake.

By default, minmake looks for its task in the file "make.xml" of the current directory.

Here is a complete example for a project managed with minmake:

make.xml - make file for an application of 4 modules

mdefs.xml - general rules for MINERVA projects

usagi.xml - host environment declarations

make.xml observes the XML format. Syntax is as follows:

make.xml
	<make [default="DefaultRule"]>
		(Include)*
		(Var)*
		(Rule|GenRule)*
	</make>

Include <include>Filename</include>

Var <var> <name>VariableName</name> (Value)* </var>

Value <value>SomeText</value>

Rule <rule> Target (Dep)* (Body|Comment)* </rule>

GenRule <genrule> Target (Dep)* (Body|Comment)* </genrule>

Target <target>TargetName</target>

Dep <dep>Dependency</dep>

Comment <comment>SomeText</comment>

Body <body [dir="WorkingDirectory"] [input="Filename"] [output="Filename"] [append="Filename"] >SomeCommand</body>

All path references, commands, and comments may contain variables. Variables are referenced by "$(VariableName)". Before being used, variables must be declared in a Var section.

The variable "HOSTNAME" is predefined and gives the hostname of the machine in which minmake was invoked. This allows for example to define different rules or variables depending an a specific machine, like path names for system libraries, using <include>$(HOSTNAME).xml</include> .

When variables are referenced it is possible to modify parts of the obtained value with the construct "$(Variable:.orig-suffix=.new-suffix)". To substitute all occurrances of ".min" in a variable "V" with ".mbc" use "$(V:.min=.mbc)" .

Pathnames, commands, and comments in GenRules may contain wildcards. In the dependency section, '*' can be used as a wildcard. Every occurance of '*' is counted from the left to right. With $i (i in 1-9) in the Comment or Body section the part occupied by '*' can be referenced.

Example: A rule to compile MINERVA files:

	<genrule>
		<target>*.mbc</target>
		<dep>$1.min</dep>
		<comment>compile $1.min</comment>
		<body>$(MINERVAC) $1.min</body>
	</genrule>

This defines the following: A file with the suffix .mbc depends on a file with the same name but suffix .min . Before compiling, minmake shall output the comment "compile <file>.min". Compilation itself is done with the command "$(MINERVAC) <Filename>.min", wheren "MINERVAC" is a variable that has been defines before.

The individual contructs:

The section var defines variables.

e.g.:

	<var>
		<name>JAVA</name>
		<value>jview d:/nologo=true /cp:a</value>
	</var>

<var> <name>MINERVA_HOME</name> <value>c:\minerva</value> </var>

<var> <name>MINERVAC</name> <value>$(JAVA) $(MINERVA_HOME) com.ifcomputer.minerva.Application -c $(MINERVA_HOME)/minerva.mca</value> </var>

Variables may have more than one value:

	<var>
		<name>SOURCE</name>
		<value>file-1.min</value>
		<value>file-2.min</value>
		<value>file-3.min</value>
	</var>

In this case the value of the variable is the concatination of the invidual value fields with a space character. For the example above this results in SOURCE="file-1.min file-2.min file-3.min".

The section Rule defines rules. These rule are processed when needed by minmake (as known from traditional make). The section Rule can only give rules for specific files, i.e. there are no wildcards allowed in the target part. Rule does not require a body part. In that case, depedency rules are defined.

If there is both a GenRule and a Rule, then only the more specific Rule is processed. GenRules and Rules with only dep sections (i.e. without body sections) are always processed.

Rules may optionally have multiple Attributes.

The attribute "input" requests that the given file be used as standard input for the command.

The attribute "output"requests that the given file be used as standard output for the command.

The attribute "append" requests that the standard output be added to the given file.

The attribute "dir" requests that the command be executed in the given directory. This is important for recursive make files.

e.g.

	<rule>
		<target>all</target>
		<body dir="lib">$(MAKE) all</body>
		<body dir="kernel">$(MAKE) all</body>
		<body dir="bips">$(MAKE) all</body>
	</rule>

So this command only walks into the directories bin, kernel, lib respectively and executes make there.

minmake accepts the following command line parameters:

-f <Filename>	load  the given minmake-file (default: make.xml)
Name=Value	assing value Value to the variable Variable
Goal		Rule to be activated. Default is determined by the
		attibute "default" of <make>.
		minmake may be called with multiple goals.
		If no goal is given, the the goal given in the
		attribute "default" is processed.
		If this is not defined and no goal given explicitly,
		then the goal "all" is processed.

minmake knows a few predefined commands. Predefined commands can be used just as normal commands. The advantage of predefined commands is only to hide operating system dependencies.

The following commands are predefined:

	del <file> ...
		delete all given files, recursively if directories

copy <file> ... <directory> copy files into a directpry, recursively if directories

copy <file1> <file2> copy file1 to file2

move <file1> <file2> rename file1 to file2

mkdir <directory> ... make directies if non existant. All needed intermediate directories are also made. (e.g. "mkdir a/b/c" suffices instead of "mkdir a a/b a/b/c"

echo text output some text

cat <file> ... all given files are written in sequence to standard output. To redirect into another file use the attribute "output" or "append" e.g. <body output="res.txt">cat file1.txt file2.txt file3.txt</body>

Except for "cat" all predefined commands ignore the attributes of the body construct. All predefined commands ignore the "dir" attribute.

read on...
MINERVA
ifcomputer logo
f
Expert Services on the Web
Language
English
Japanese
Server
USA
Japan
Site Access
Local Index
Local Contents
Site Contents
Site Index
Printer Friendly
For imode
For PDA
Search
document: http://www.ifcomputer.co.jp/MINERVA/Manual/Reference/Invocation/minmake/home_en.html
published 2008/7/7 update 2002/3/19 (c) 1996-2006 IF Computer Japan
IF Computer 5-28-2 Sendagi, Bunkyo-ku Tel +81-3-5814-3352 info@ifcomputer.com
Customer Support Tokyo 113-0022 Japan   http://www.ifcomputer.com
scroll to top managed with ubiCMS