dario.damico | 25 Oct 06:08 2012
Picon

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:

http://stackoverflow.com/questions/13045315/jam-object-rule-and-directories

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:

    weird/
        Jamfile
        b.c
        src/
            a.c
            c.c

The src/a.c file is like this:

    #include "src/a.h"

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

(Continue reading)

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.

Thanks,

Chris

_______________________________________________
jamming mailing list  -  jamming <at> maillist.perforce.com
http://maillist.perforce.com/mailman/listinfo/jamming
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:

-----8<-------

rule Test {
  Depends all : $(1) ;
}

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

Depends all : source.txt ;

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

-----8<-------

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?

Thanks,
Alen

_______________________________________________
jamming mailing list  -  jamming <at> maillist.perforce.com
http://maillist.perforce.com/mailman/listinfo/jamming

Davidson, Giles | 27 Jun 17:22 2012

Jam on AS400 - GLOB does not work.

Hi,

 

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?

 

Thanks

Giles

_______________________________________________
jamming mailing list  -  jamming <at> maillist.perforce.com
http://maillist.perforce.com/mailman/listinfo/jamming
Anuj Goyal | 2 Jul 05:15 2011
Picon

Major Programs Using Jam?

What major projects (open source or commercial) still use Jam?
_______________________________________________
jamming mailing list  -  jamming <at> maillist.perforce.com
http://maillist.perforce.com/mailman/listinfo/jamming

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:

C++Example
    |-- 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:

ALL_LOCATE_TARGET = build ;
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,

Chris

_______________________________________________
jamming mailing list  -  jamming <at> maillist.perforce.com
http://maillist.perforce.com/mailman/listinfo/jamming
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 ;
C++FLAGS =
    -I/usr/include
    -DNDEBUG
    -D_GNU_SOURCE
    -D__STDC_LIMIT_MACROS
    -D__STDC_CONSTANT_MACROS
    -O3
    -fomit-frame-pointer
    -fno-exceptions
    -fPIC
    -Woverloaded-virtual
    -Wcast-qual ;   # should be generated from `llvm-config --cxxflags`
LINK = $(DC) ;
DFILES =
    src/ob2c/main.d
    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/Ext.cpp
    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.

Cheers,

Chris

_______________________________________________
jamming mailing list  -  jamming <at> maillist.perforce.com
http://maillist.perforce.com/mailman/listinfo/jamming
Diane Holt | 19 May 23:21 2011
Picon

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: http://maillist.perforce.com/pipermail/jamming/2002-April/000927.html

As mentioned in there, I added a:

JAM_SEMAPHORE on $(target) = nodeName ;

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

Thanks,
Diane

_______________________________________________
jamming mailing list  -  jamming <at> maillist.perforce.com
http://maillist.perforce.com/mailman/listinfo/jamming
John Waugh | 18 May 19:26 2011
Picon

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.

-John
_______________________________________________
jamming mailing list  -  jamming <at> maillist.perforce.com
http://maillist.perforce.com/mailman/listinfo/jamming

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> maillist.perforce.com
http://maillist.perforce.com/mailman/listinfo/jamming

Hubert Mackenberg | 16 Mar 15:52 2011

Problems with simple expression evaluation


Hi,

I do not understand the result of some simple expression evaluation.
I have:

test.jam:

    VAR = "FALSE" ;

    if ! ($(VAR) = "TRUE")
    {
      echo "VAR is not TRUE" ;
    }
    else
    {
      echo "VAR is TRUE" ;
    }

    EXIT ;

If I run

      jam.exe -f test.jam

I get

      VAR is TRUE

But that's not what I expect. If I change the if statement to

     if $(VAR) != "TRUE"

then I get 'VAR is not TRUE' as expected.

I know I can just change my code. But I'd like to understand
what's wrong with 'test.jam' above. Does anyone have an
explanation?

Thanks,
Hubert

#
" Ce courriel et les documents qui lui sont joints peuvent contenir des informations confidentielles ou
ayant un caractère privé. S'ils ne vous sont pas destinés, nous vous signalons qu'il est strictement
interdit de les divulguer, de les reproduire ou d'en utiliser de quelque manière que ce soit le contenu.
Si ce message vous a été transmis par erreur, merci d'en informer l'expéditeur et de supprimer
immédiatement de votre système informatique ce courriel ainsi que tous les documents qui y sont attachés."
******
" This e-mail and any attached documents may contain confidential or proprietary information. If you are
not the intended recipient, you are notified that any dissemination, copying of this e-mail and any
attachments thereto or use of their contents by any means whatsoever is strictly prohibited. If you have
received this e-mail in error, please advise the sender immediately and delete this e-mail and all
attached documents from your computer system."
#

_______________________________________________
jamming mailing list  -  jamming <at> maillist.perforce.com
http://maillist.perforce.com/mailman/listinfo/jamming


Gmane