Difference between revisions of "MAKE"
From ICE Enterprises
ConvertBot (talk | contribs) (handles various build and configuration functions) |
(No difference)
|
Latest revision as of 18:04, 27 April 2020
handles various build and configuration functions
<func> - Function to perform (ALL,CODE,HELP,JAR,BUNDLE). Multiple options can
be combined with a pipe ("CODE|JAR") [DEF=""]
<option> - Option tree to perform operation on or "ALL" for all option tree(s)
in the path. [DEF="ALL"]
Functions:
BUN: The BUNDLE or BUN (alias) function creates OSGi bundles (jars) under
$NMROOT/bundle directory. (Since NeXtMidas 3.3.0)
Same as:
nM> generate/verbose bundle <option> bundle
CODE: The CODE function builds the Java and C code known to the NeXtMidas
system.
Same as:
nM> build all all <option>
DOCS: An alias for "HELP" (see below).
HELP: The HELP function builds the Help system files and their browser
compatible versions. This includes the building of the JavaDoc
files (which document any Java files). The building of the database used
to perform the search in HELP/GUI is only done when this function and
the "ALL" option is specified.
Same as:
nM> help/build ,, <option>
JAR: The JAR function creates Java Web Start compatible jars for web
deployment under $NMROOT/jars directory.
Same as:
nM> generate/sign/verbose jars <option> jars
Note: Under Windows, this function may fail if the destination jar file
is open (e.g. in use by another process running in Web Start).
ALL: The ALL function is identical "CODE|HELP|JAR". Combining "ALL" with any
other functions has no affect (i.e. "ALL|JAR" is the same as "ALL").
Since NeXtMidas 2.5.1, if an unsupported function is specified, MAKE displays
an error message with the list of supported functions.
Note:
When MAKE is run outside the NeXtMidas shell (i.e. via '$ nm make ...'), it
uses tools.NmMake to provide the boot-strap build of NeXtMidas from scratch.
In this mode, Native code is disabled. Option trees that require native code,
such as XBC to preprocess Fortran files and all dependent option trees must
run MAKE in the NeXtMidas shell and with native code enabled (on by default).
View the User's Guide -> Installation and Customization -> Compilation
for more information.
In NeXtMidas 3.5.3, the JVM target (-source and -target javac flags) were
removed from build.props. This means that the lowest desired JDK should
be used to compile the baseline and option trees otherwise trying to run
NeXtMidas on a lower JVM will error with following Exception:
java.lang.UnsupportedClassVersionError: ... Unsupported major.minor version
To downgrade to a lower JVM target (e.g. from Java 8 to Java 7), it is
recommended to rebuild from a refresh tarball/zip of the NeXtMidas baseline.
But if that is not available, then the following steps can take from OS shell:
1. nm make clean
2. nm make all
3. rebuild your option trees (e.g. path add option trees, make all)
Extending Make:
Prior to building an option tree MAKE will look for a BUILDOPT macro in the
MCR area of the option tree being built. If a BUILDOPT macro is found MAKE
will call it and let it handle the building of the option tree. If no BUILDOPT
macro is found the default system one (see BUILDOPT;SYS) will be used.
The BUIDLOPT macro should handle all of the tasks required to build the option
tree. BUILDOPT may call BUILDOPT;SYS if applicable but may NOT call MAKE.
Example of a typical BUILDOPT:
startmacro u:option["MYOPT"]
say "Using custom buildopt for ^{option} option tree."
! Get the standard /NC=, /NH=, and /NJ= switches that MAKE
! passed here and and passes them on to BUILDOPT;SYS later
SWITCH NAME=NC VALUE=NC FUNC=GET DEF=false SDEF=true
SWITCH NAME=NH VALUE=NH FUNC=GET DEF=false SDEF=true
SWITCH NAME=NJ VALUE=NJ FUNC=GET DEF=false SDEF=true
! Do special build steps for this option tree
if NC isFalse then
bld mylibrary libxxx ^option
bld all libxxx ^option
endif
! Then perform the standard build with user specified switches
BUILDOPT;SYS/NC=^{nc}/NH=^{nh}/NJ=^{nj} ^option
endmacro
Warning: When calling BUILDOPT;SYS, always include the ";SYS" since other
option trees are likely to have their own buildopt variants.
Examples:
1. Build all of the Java and C code for the SYS tree and package it in the JAR
files:
nM> make CODE|JAR sys
or
nM> make JAR|CODE sys
Note that in all cases the make macro will perform each function in its
logical order (e.g. "CODE" will be performed before "JAR").
2. Build the help files for all known option trees.
nM> make HELP all
3. Build everything for the "DSP" option tree.
nM> make all dsp
4. Build everything for all known option trees:
nM> make all all
5. Build code (except for native files) for MAP option tree:
nM> make code map /donative=f
6. Build only native files (code) for all option trees on path (Since 3.3.1):
nM> make code /bldtypes=native
7. Exclude all test directories ("*/test/*") when creating JAR files
(since 3.3.4):
nM> make jars /notest
8. Exclude all docs directories ("*/docs/*") when creating JAR files
(since 3.3.4):
nM> make jars /nodocs
Switches:
See BUILDOPT, BUILD, GENERATE, HELP explain files for switches that MUST be
specified at the end of command line after all arguments to MAKE for it to
propagate to those commands.
Here are some common switches for BUILD and GENERATE:
/BLDTYPES= - Types of files to build (Java,Native,Host). When specified takes
precedence over /DOHOST and /DONATIVE. (Since 3.3.1) [DEF=ALL]
/DEBUG - Turn on debugging.
/DOHOST - Compiles the host (C++/Fortran) files [DEF=FALSE, TRUE if XBC on
path). Note: /DOHOST should usually be included with /DONATIVE.
/DONATIVE - Compiles the native (C/C++) files. [DEF=TRUE]
/NODOCS - Do not include /docs directories in JAR files (since 3.3.4)
/NOTEST - Do not include /test directories in JAR files (since 3.3.4)
/SKIP= - For FUNC=JAR, skip specified step(s) options mask value:
JARSTANDARD - Skip standard jar file creation
JARNATIVE - Skip JAR of native library files for current OS
COPYJARS - Skip copying and signing jar files from JAR area
For FUNC=BUNDLE, skip options mask value: (Since 3.3.0)
BUNSTANDARD - Skip standard OSGi bundle file creation
BUNNATIVE - Skip native libraries OSGi bundle file creation
BUNSOURCE - Skip source code OSGi bundle file creation
See Also: BUILDOPT, BUILD, BLD, GENERATE, HELP