Alfred Landrum | 1 Nov 2000 03:10

Cross Including Jamfiles - Bad Idea?

Howdy,

[see dir structure below]

If I cd into /top, everythings works as planned.  But if I cd into
/top/exec, it can't find targets libfoo or libbar.
I want to be able to run jam from /top/exec, and have it find (and
potentially update) libfoo and libbar.

I see two solutions.  One, make libfoo and libbar globally defined.  Or, I
could try to include libfoo's and libbar's Jamfile from exec's Jamfile.
This will take some work, because I think we'll need to put "header guards"
in the library's Jamfiles.
I don't want to globally define them; it won't scale.

Any suggestions?

# Example directory structure
/top/exec
/top/libfoo
/top/libbar

# Jamfile in /top/exec
SubDir TOP exec ;
Main exec : main.c ;
LinkLibraries exec : libfoo libbar ;

# Jamfile in /top
SubDir TOP ;
SubInclude TOP exec ;
(Continue reading)

Amaury FORGEOT-d'ARC | 2 Nov 2000 09:46
Picon

Réf. : [jamming] Cross Including Jamfiles - Bad Idea?


> I could try to include libfoo's and libbar's Jamfile from exec's Jamfile.
> This will take some work, because I think we'll need to put "header guards"
> in the library's Jamfiles.

You can avoid these "header guards" in the library's Jamfiles
with this trick:
in a sub-Jamfile, the $(s) variable is set to the arguments of
the current invocation of the SubInclude rule (see Jambase).

In your case, you could add to the Jamfile in /top/exec:

# if we called Jam from this directory, build libraries
if ! $(s)
{
     SubInclude TOP libfoo ;
     SubInclude TOP libbar ;
}

Amaury.

Danny Dulai | 7 Nov 2000 00:05
Favicon

1 file to two dependancies

i have an object file that needs to go into two libraries, how can i do
that if both libraries and the object file are in the same directory?

-- 
___________________________________________________________________________
Danny Dulai                                           Feet. Pumice. Lotion.
http://www.ishiboo.com/~nirva/                            nirva <at> ishiboo.com

Received: from netstal.com (spssa01.securepop.ch [164.128.235.15])
	by frankenrouter.perforce.com (8.9.3/8.9.1) with SMTP id IAA12684
	for <jamming <at> perforce.com>; Mon, 6 Nov 2000 08:45:56 -0800 (PST)
Received: from NM-MAIL-Message_Server by netstal.com
	with Novell_GroupWise; Mon, 06 Nov 2000 17:35:48 +0100
Message-Id: <sa06ebf4.074 <at> netstal.com>
X-Mailer: Novell GroupWise Internet Agent 5.5.3.1
Date: Mon, 06 Nov 2000 17:35:05 +0100
From: "Niklaus Giger" <n.giger <at> netstal.com>
To: <jamming <at> perforce.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by frankenrouter.perforce.com id IAA12685
Subject: [jamming] Command line limit on WindowsNT
Sender: jamming-admin <at> perforce.com
Errors-To: jamming-admin <at> perforce.com
X-BeenThere: jamming <at> perforce.com
X-Mailman-Version: 2.0beta2
Precedence: bulk
List-Id: Discuss the build tool Jam/MR with other users <jamming.perforce.com>
(Continue reading)

Edward Lam | 8 Nov 2000 06:53
Picon
Favicon

Re: Command line limit on WindowsNT

--- Niklaus Giger <n.giger <at> netstal.com> wrote:
> Using this this for some of our real projects I ran
> into the infamous command line length
>  limit of WindowsNT.

I'd be interested in your changes, Niklaus.  I never
really did understand what's the precise problem with
the command line length though.  This discussion has
been raised before on this mailing list and there
didn't seem to be a definitive answer. How did you
resolve the problem?

-Edward

__________________________________________________
Do You Yahoo!?
Thousands of Stores.  Millions of Products.  All in one Place.
http://shopping.yahoo.com/

Received: from mx.yellow.bonsai.com (eville4-fxp3.parker.net [206.14.51.86])
	by frankenrouter.perforce.com (8.9.3/8.9.1) with ESMTP id MAA53294
	for <jamming <at> perforce.com>; Tue, 28 Nov 2000 12:41:29 -0800 (PST)
Received: from halon.sybase.com (halon.sybase.com [192.138.151.33])
	by mx.yellow.bonsai.com (8.9.3/8.9.3) with ESMTP id LAA11138
	for <jamming <at> perforce.com>; Tue, 28 Nov 2000 11:17:34 -0800
Received: from smtp1.sybase.com (sybgate.sybase.com [130.214.220.35])
	by halon.sybase.com  with ESMTP id LAA01148
	for <jamming <at> perforce.com>; Tue, 28 Nov 2000 11:14:28 -0800 (PST)
Received: from gwwest.sybase.com (gwwest.sybase.com [130.214.96.21])
	by smtp1.sybase.com  with SMTP id LAA27425
(Continue reading)

Amaury.FORGEOTDARC | 30 Nov 2000 09:25
Picon

Re: How to check file status

> We need to make sure that "runtime.zip" exists before compiling some
> java files.  Is there any way to tell jam to check this file exists
> before even trying to build?

You could make it the first target of your build:

rule checkFirst
{
    DEPENDS first : $(<) ;
    ALWAYS runtime.zip ;
}
if $(NT)
{
   actions checkFirst
   {
       if not exist $(<) exit 1
   }
}
if $(UNIX)
{
   actions checkFirst
   {
       test -f $(<)
   }
}

checkFirst runtime.zip ;

Then use the -q option of Jam to make it quit on the first failed action.

(Continue reading)


Gmane