当前位置: 首页 > news >正文

The Jam/MR Executable Program

https://web.mit.edu/darwin/src/modules/jam/Jam.html

 

jam

The Jam/MR Executable Program
Jam/MR 2.2

 

USAGE

	jam [ -a ] [ -n ] [ -v ] [ -d debug ] [ -f rulesfile ... ] [ -j jobs ] [ -s var=value ... ] [ -t target ... ] [  target ... ]

DESCRIPTION

jam, the Jam/MR executable program, recursively builds target files from source files using dependency and build specification rules defined in rulesfile. jam parses rulesfile to identify targets and sources, examines the filesystem to determine which targets need updating, and issues OS commands to update targets.

Normally, rulesfile is compiled into jam, allowing jam to be run as a stand-alone program. A base set of build rules is provided in the file "Jambase", and is described in Using Jamfiles and Jambase and the Jambase Reference. For general information, refer to the Jam/MR Language document.

If target is provided on the command line, jam attempts to build target; otherwise jam attempts to build the target 'all'.

 

OPTIONS

jam may be invoked with the following options:

       -a     Build all targets anyway, even if they are up-to-date.-d<n>  Enable cummulative debugging levels from 1 to <n>.  Interesting values are:1 Show actions (the default)2 Show "quiet" actions and display all action text3 Show dependency analysis, and target/source timestamps/paths 4 Show shell arguments5 Show rule invocations and variable expansions6 Show directory/header file/archive scans7 Show variable settings8 Show variable fetches9 Show variable manipulation, scanner tokens-d+<n> Enable debugging level <n>.-d0    Turn off all debugging levels.  Only errors are notsuppressed.-f<rulesfile>Read <rulesfile> instead of Jambase.-j<n>Run  up to <n> shell commands concurrently (UNIXonly).  The default is 1.-k     Continue after build error.  The default behavior is to exit after the first build failure.-n     Don't actually execute the updating actions, but doeverything else.  This changes the debug level default to -d2.-s<var>=<value>Set  the variable <var> to <value>, overriding bothinternal variables and variables imported from  theenvironment.-t<target>Rebuild <target>, even if it is up-to-date, and/or build dependencies of <target> as if <target> were newer.-v     Print the version of jam and exit.

 

OPERATION

jam has three phases of operation: parsing, binding, and updating.

Parsing

In the parsing phase, jam reads the rules file(s), evaluates variables, identifies and invokes rules, identifies targets, and builds the dependency graph.

Which rules files get read depends on the site-specific implementation of jam. The normal implementation is this: jam reads the Jambase rules file, the text of which is stored inside the jam executable itself. Jambase may "include" other rules files, and the last rule invoked from Jambase is "include Jamfile", which reads file "Jamfile" from the current directory. Jamfile is expected to specify which targets get built from the source files in the current directory. (All of this is explained in detail in Using Jamfiles and Jambase.) If there's no Jamfile in the current directory, jam emits a message and exits.

Environment variable settings are imported into Jam/MR variables. To pass a value to a variable on the jam command line, overriding the variable's environment value, use the -s option. To see variable assignments made during jam's execution, use the -d+7 option.

Rules are defined in rules files using the Jam/MR language, and are invoked in rules files after they are defined. Targets are identified by rule invocations. At the completion of the parsing phase, all targets are uniquely identified and a dependency graph is constructed.

 

Binding

After parsing, jam recursively descends the dependency graph and binds every file target with a location in the filesystem. The existence and modification times of the bound files are used to determine which targets need updating. If jam detects a circular dependency in the graph, it issues a warning.

A file target is bound with a location as follows:

  • If $(LOCATE) is set, the target is bound to the path described by the first element in $(LOCATE).

     

  • If $(LOCATE) is not set, and the target has any updating actions associated with it, the target is bound to the current directory of the jam invocation.

     

  • If $(LOCATE) is not set, and the target has no updating actions associated with it, and $(SEARCH) is set, jam searches the directories in the $(SEARCH) list. The first directory in the list in which the target is found becomes the target's bound path. If the target is not found, it is bound to the current directory of the jam invocation.

     

  • If neither $(SEARCH) nor $(LOCATE) are set, the target is bound to the current directory of the jam invocation.

     

  • If the target's identifier contains a rooted pathname, none of the above applies, and the target's bound location is that path.

     

  • Unrooted pathnames used in $(SEARCH), $(LOCATE), or target identifiers are relative to the current directory where jam was invoked.

     

  • Target-specific values of $(SEARCH) and $(LOCATE) always have precedence over global values in binding.

     

After binding each target, jam determines whether the target needs updating, and marks the target if necessary for the updating phase. A target is marked for updating for any of these three reasons:

  • It is missing.
  • Its filesystem modification time is older than any of its sources.
  • Any of its sources are marked for updating.

For targets of the built-in rules ALWAYS, LEAVES, NOCARE, TEMPORARY, NOTFILE, and NOUPDATE, jam's updating behavior is slightly different:

 

ALWAYS
The target is always updated.
LEAVES
The target is only updated if it is missing or if its leaf sources are newer. Leaf sources are those dependencies of the target that have no dependencies themselves.
NOCARE
The target is ignored if it is missing and has no updating actions. Normally, jam issues a warning and skips other targets that depend on missing targets without updating actions.
TEMPORARY
If the target is missing, then its source's modification time is used when comparing against dependencies.
NOTFILE
The target is only updated if any of its sources are marked for updating.
NOUPDATE
The target is only updated if it is missing. Also, if it exists, it will appear eternally old; that is, older than anything that depends on it.

If $(HDRSCAN) is set on a file target, jam scans the file for header file include lines. It scans the file by matching each line against a regexp(3) pattern that has ()'s surrounding the included file name. The pattern is provided by the user through the special variable $(HDRSCAN) (see HDRPATTERN in Jambase for an example). The result of the scan is formed into a rule invocation, with the scanned file as the target and the found included file names as the sources. The rule invoked is named by the special variable $(HDRRULE). jam only scans files if $(HDRSCAN) is set, and $(HDRSCAN) is normally set target-specific.

Between binding and updating, jam announces the number of targets to be updated.

 

Updating

After binding, jam again recursively descends the dependency graph, this time executing the update actions for each target marked for update during the binding phase. If a target's updating actions fail, then all targets which depend on it are skipped.

The -j flag instructs jam to build more than one target at a time. If there are multiple actions on a single target, they are run sequentially.

The special variable $(JAMSHELL) gives jam a command execution shell to be used instead of /bin/sh. This variable's value must be a multi-element list, corresponding to the argument vector for the command shell. An element "%" is replaced with the command string to execute. An element "!" is replaced with the multiprocess slot number, which is (inclusively) between 1 and the maximum number of concurrent jobs specified with the -j flag (default 1). If no element of the list is "%", the command string is tacked on as the last argument. The default value is: "/bin/sh -c %".

 

DIAGNOSTICS

In addition to generic error messages, jam may emit one of the following:

       warning: unknown rule XA  rule  was invoked that has not been defined withan "actions" or "rule" statement.using N temp target(s)Targets marked as being temporary (but  nonethelesspresent) have been found.updating N target(s)Targets are out-of-date and will be updated.can't find N target(s)Source  files  can't  be  found  and  there  are noactions to create them.can't make N target(s)Due to sources not being found, other targets  cannot be made.warning: X depends on itselfA  target  depends  on  itself  either  directly orthrough its sources.don't know how to make XA target is not present and no  actions  have  beendefined to create it.X skipped for lack of YA  source failed to build, and thus a target cannotbe built.warning: using independent target XA target that does is not a dependency of any othertarget is being referenced with $(<) or $(>).X removedjam  removed  a  partially built target after beinginterrupted.

 

BUGS, LIMITATIONS

The -j flag can cause jam to get confused when single actions update more than one target at a time. jam may try to execute actions to build those targets' dependencies before the targets themselves have all been built.

With the -j flag, errors from failed commands can get staggeringly mixed up. Also, because targets tend to get built in a quickest-first ordering, dependency information must be quite exact. Finally, beware of parallelizing commands that drop fixed-named files into the current directory, like yacc(1) does.

A poorly set $(JAMSHELL) is likely to result in silent failure.

 

SEE ALSO

 

  • Using Jamfiles and Jambase
  • Jambase Reference
  • The Jam/MR Language

Documentation and source are available at www.perforce.com/jam/jam.html.

 

AUTHOR

Jam/MR's author is Christopher Seiwald (seiwald@perforce.com). Documentation is provided by Perforce Software, Inc.

 


Back to top.

Copyright 1997 Perforce Software, Inc.
Comments to info@perforce.com
Last updated: Oct 19, 1997

http://www.jsqmd.com/news/371380/

相关文章:

  • 科研人福利:AI降重工具Top7盘点
  • 学术党必看!AI降重工具排名榜单
  • 从视频学会折纸?ByteDance团队让AI首次通过看视频掌握复杂技能
  • 数据安全
  • AI提示工程云端部署方案对比:Serverless vs K8s vs 虚拟机(适用场景分析)
  • 北大团队发布Chain of Mindset:让AI灵活切换思维模式的推理框架
  • 耶鲁大学团队如何让电脑助手学会“看懂“桌面操作
  • 7大AI降重工具测评,提升论文通过率
  • 《GraphQL批处理与全局缓存共享的底层逻辑》
  • 学术AI工具盘点:10个论文写作网站详解
  • 完整教程:Spring Boot 多数据源解决方案:dynamic-datasource-spring-boot-starter 的奥秘(上)
  • 《GraphQL状态图建模与低时延控制能力解析》
  • 论文写作AI工具:10款网站功能全解析
  • IPV6安全保护
  • jam
  • 2025.2.9 做题记录
  • linux三剑客基础入门
  • Kubernetes部署Cilium网络插件命令 - wanghongwei
  • 肯尼斯·费雷尔的价值因子研究
  • 【YOLOv12多模态涨点改进】独家创新首发| CVPR 2025 | 引入FDSM频率域动态地选择模块,高效融合红外和可见光多模态特征,精准保留有用信息、抑制冗余与噪声,助力目标检测、图像分割、分类
  • 提示工程架构师实战教程:群体智能提示优化方法论在金融领域应用
  • 【YOLOv12多模态涨点改进】CVPR 2025 | 引入RLAB残差线性注意力块,有效融合并强调多尺度特征,多种创新改进点,助力多模态融合目标检测、图像分割、图像分类,医学图像分割等任务有效涨点
  • Redis在大数据日志处理中的应用:ELK+Redis架构解析
  • 4个领先的大模型微调工具
  • 基于大数据的物联网预测性维护系统设计
  • 10款AI论文写作工具:功能与体验解析
  • 【YOLOv12多模态涨点改进】独家复现创新首发 | CVPR 2025 | 引入 FEFM 频率穷举融合机制和二次创新CFEM交叉融合增强模块,适合红外与可见光融合,多模态融合目标检测、实例分割
  • 市盈率低于15的重要性
  • 毕业论文AI辅助:10大高效工具推荐
  • 提示工程架构师参与指南:开源社区推动Agentic AI可持续发展的6个贡献方向