John Waugh | 18 Aug 01:01 2014

Jam 2.6 ?

 I noticed this recent change over at Perforce:

Could it be that an official Jam 2.6 is coming?
Anyone know any details?


jamming mailing list  -  jamming <at>
dario.damico | 25 Oct 06:08 2012

Object rule and directories

I everybody, I have a problem in generating a header file as a result of a scanned
dependency. I initially posted my question on StackOverflow, and I'll be happy to
accept the answer if it is also posted there:

I suspect that the manual is actually saying what I'm doing wrong, but I can't really
see a solution; the problem occurs when the .c file and the .o file to be build are not
in the same directory, and the .c file has a scanned dependency on a .h file which
has to be generated on the fly. The problem can be probably be solved by manually
setting dependencies between the .c and .h file, but I would like to avoid that.

I have the following directory structure:


The src/a.c file is like this:

    #include "src/a.h"

    int main(int argc, char *argv[])
        return 0;

The b.c file is like this:

    #include "src/b.h"

    int main(int argc, char *argv[])
        return 0;

The src/c.c file is like this:

    #include "c.h"

    int main(int argc, char *argv[])
        return 0;

The Jamfile is:

    rule CreateHeader
        Clean clean : $(1) ;

    actions CreateHeader
        echo "int x = 10;" > $(1)

    Object a.o : src/a.c ;
    Object b.o : b.c ;
    Object c.o : src/c.c ;

    CreateHeader src/a.h ;
    CreateHeader src/b.h ;
    CreateHeader src/c.h ;

The following command correctly creates b.o and src/b.h:

    jam b.o

The following command creates src/a.h, but then GCC fails to create a.o; the reason
is quite obviously that the #include in a.c mentions src/a.h while in fact should simply
refer to a.h:

    jam a.o

The following command fails completely, and does not even create c.h; the reason is
probably that when Jam analyzes c.c it generates a dependency on c.h instead of src/c.h,
and in the Jamfile there are no rules for generating c.h:

    jam c.o

This command compiles properly if I explicitly ask to generate src/c.h before asking for c.o:

    jam src/c.h
    jam c.o

In my opinion the jam src/c.h should not be necessary. What's wrong here? Check the Jam
manual for more information, particularly under the section Header File Scanning.

Thank you for your help.

Dario D'Amico

jamming mailing list  -  jamming <at>

Chris Molozian | 8 Sep 01:31 2012

Run Unit Tests for D library

Hey all,

I've added the extra rules from the FT version of Jam (ftjam) to my Jamfile that provide rules and actions to build D code with Perforce Jam.

The D programming language has built in support for Unit Testing by passing the "-unittest" flag to the compiler. Unit testing code is then bundled with the generated executable and executed after static initialization but before the main() function is called.

I'm unsure how to do two things:
  • Create debug (default) and release build actions to allow me to pass the "-unittest" flag in a debug build but ignore unit test code in production releases.
  • Create an action that is run as part of debug builds that executes the generated binary to run it's unit tests.
All help is greatly appreciated.



jamming mailing list  -  jamming <at>
Alen Ladavac | 3 Sep 11:18 2012

Does Jam need an error/warning stronger than "Using independent target X"?

Hi all,

If I do something like this in Jam:


rule Test {
  Depends all : $(1) ;

actions Test {
  copy $(2) $(1)

Depends all : source.txt ;

Test final.txt : intermediate.txt ;
Test intermediate.txt : source.txt ;


When "source.txt" exists, while "intermediate.txt" and "final.txt" don't, this build will fail on the
first run (because it will try to generate final.txt before generating intermediate.txt). It will
however generate intermediate.txt  and will therefore pass on the second run. This problem happens due to
an oversight in the dependency graph here. The "Test" rule should include a "Depends $(1) : $(2)" . We see
this kind of scenario every once in a while, and it gets into production because a developer working on this
is unlikely to try a clean build and will be unaware that the problem exists, especially in larger
codebases, and when using parallel builds makes things like this pass or fail on random.

But... Jam doesn't report this as an error. The only warning close to this is the "warning: using
independent target X". But it only checks whether both inputs and outputs of an action are dependencies of
_something_. It doesn't check whether outputs of an action depend on its inputs. (This why I added
"Depends all : source.txt" above, as having this source mentioned anywhere else will make the warning go
away for all other places.)

What I would like to ask the collective wisdom of this group is this: Is there any reason why there is no error
checking for whether an action takes inputs that are not dependencies of the output?

It seems to me like the lack of this error check is an oversight in jam implementation, rather than
intentional design choice. But I cannot be sure. 

Before I rush implementing the check.... does anyone see a reason why such an action should be valid?


jamming mailing list  -  jamming <at>

Davidson, Giles | 27 Jun 17:22 2012

Jam on AS400 - GLOB does not work.



We are planning to use Jam on the POSIX subsystem of i5OS on the AS400. The GLOB rule does not work – it looks to me as though it is ASCII specific. Has anyone ported Jam to the AS400 or the zOS USS and fixed GLOB for EBCDIC  - and if so could they share the fix?




jamming mailing list  -  jamming <at>
Anuj Goyal | 2 Jul 05:15 2011

Major Programs Using Jam?

What major projects (open source or commercial) still use Jam?
jamming mailing list  -  jamming <at>

Chris Molozian | 21 Jun 19:33 2011

Simple C++ Project

Hey all,

I've moved on from D to C++ with my Jam projects. I can't seem to make a simple build environment work, the project directory looks like:

    |-- build/    <-- should be created and built by Jam
    |-- src/
          |-- Main.cpp
    |-- Jamfile

I'm using a simple Hello World C++ example (Main.cpp):

#include <iostream>

using namespace std;

int main(void) {
    cout << "Hello World!" << endl;
    return 0;

The Jamfile looks like this:

SubDir TOP ;

C++FILES = [ GLOB src : *.cpp ] ;
Main hello : $(C++FILES) ;

The build fails with the following errors:

...found 12 target(s)...
...updating 2 target(s)...
C++ build/src/Main.o
Assembler messages:
Fatal error: can't create build/src/Main.o: No such file or directory

cc -c -o build/src/Main.o  -O  -I. src/Main.cpp

...failed C++ build/src/Main.o ...
...skipped hello for lack of src/Main.o...
...failed updating 1 target(s)...
...skipped 1 target(s)...

Any help is appreciated,


jamming mailing list  -  jamming <at>
Chris Molozian | 28 May 14:43 2011

A few queries about Jam

Hey all,

I hope the mailing list is still active. I've been through all the documentation for Jam and peeked at the Jambase file in the source repository but there's still a couple of things I can't find the idiomatic way to do.

My build consists of using a D compiler to build a project I'm working on involving the LLVM. The Jamfile I've created looks like this:

DCFLAGS = -fPIC -O -inline -release -w -wi -I./imports/llvm-2.9 ;
    -Wcast-qual ;   # should be generated from `llvm-config --cxxflags`
LINK = $(DC) ;
    src/ob2c/info.d ;    # should be scanned from src dir

# override the Link action to correct for the dmd compiler -o flag
actions Link bind NEEDLIBS {
    $(LINK) $(LINKFLAGS) -of$(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS)

MainFromObjects ob2c : $(DFILES:S=.o) ;
Objects $(DFILES) ;
LinkLibraries ob2c : llvm-c-ext ;
Library llvm-c-ext :
    imports/llvm-2.9/llvm/Target.cpp ;

The things I'm not sure how to do are:
  • Can I call an external program (i.e. llvm-config) and store the stdout from it to the C++FLAGS variable?
  • All of my source code is within a src folder, can I tell Jam to scan the directory and subdirectories for source files and store them to the DFILES variable?
  • Is there a way for me to force all target output (e.g. object files, generated libraries, binaries... etc) to be put within a build folder at the same directory level as the Jamfile?
Hope this makes sense, any help and advice would be most appreciated.



jamming mailing list  -  jamming <at>
Diane Holt | 19 May 23:21 2011

Craig McPheeters' JAM_SEMAPHORE

Has anyone ever tried using this? I have a number of targets that are just tarfile extractions. When I run the build -jN, I get N number of extractions happening at the same time. Which would be fine, if tar didn't sometimes error out with a "No such file or directory" (which doesn't make any sense, since the directory certainly exists, and the file will exist once tar extracts it). So I thought I'd give Craig's semaphore stuff a try, see if I could get Jam to serialize these targets so only one tar happens at a time. But I still get N number of tars happening at the same time. So either I'm not using it right, or it doesn't actually work the way I'd hoped it would.

Here's Craig's original mail about it:

As mentioned in there, I added a:

JAM_SEMAPHORE on $(target) = nodeName ;

but I don't see it having any affect on anything.


jamming mailing list  -  jamming <at>
John Waugh | 18 May 19:26 2011

Jam license

I'm (slowly) working on a project to collect various
patches/improvements to Jam from this list and other fork projects
into one place.
If my memory serves, there was at some point an effort to get classic
Jam's source released under a more permissive license.

Does anyone remember if that happened?
I thought it might have been public domain-ed, but can't find
reference to that now that I look for it.

jamming mailing list  -  jamming <at>

Graeme Gill | 5 May 17:01 2011

Jam has a problem creating a top level directory

I notice that jam has a problem in creating a top level
directory. The problem is that if LOCATE is set to "/",
the resulting bound name has a double "/", ie. you
get "//topdir". On Unix this is benign, and the
double is ignored. On Windows (ie. "\\topdir") you
get an error.

The workaround is that if the value you are about to
set LOCATE to is root, append dot to it. ie. set
LOCATE to "/." so that the bound name becomes "/./topdir"
(or "\.\topdir" for Windows).

(Presumably SEARCH has a similar problem).

Graeme Gill.
jamming mailing list  -  jamming <at>