[jamming] Complete, and utter automation with Jam

Alen Ladavac alenl-ml at croteam.com
Fri Aug 18 22:45:17 PDT 2006


Hi Daniel,

>>> The main.c file has an include for "data.h", so it should know that it
>>> has
>>> to link to data.c. A human should NOT have to type in data.c into the   
>>> jamfile.

What you are asking for is not possible generally, because then it
would also try to compile stdio.c, whenever you include stdio.h,
wouldn't it? You might make it possible by differentiating e.g.
between <> and "" includes and treating them differently, and by
guaranteeing that every .h file in you project has its own .c file.
But this is very advanced usage of jam, and you will probably have
problem with 3rd party code that will not follow this convention.

HTH,
Alen


Daniel wrote:

> Hi Craig,

> Thanks for your reply!

> So will I need to mention the other C files or is that it?
> Can I literally just put...
> SOURCE = [ Glob $(SUBDIR) : *.cpp ] ;

> ...into the jamfile, and then do nothing else? To be honest,
> I would prefer to specify just the file with the main function
> in, because I can have many such projects in one folder, so it
> wouldn't know which one to pick.

> So in summary, I want one main file passed to Jam, and then
> everything else is sorted out automatically (I don't
> want to mention any other C files etc).

> Cheers,
> Daniel


> On Sat, 19 Aug 2006 02:08:38 +0100, Craig Allsop <cjamallsop at gmail.com>
> wrote:

>> Hi.
>>
>> In jam you use built-in "Glob" rule to scan for source, i.e.
>>
>> SOURCE = [ Glob $(SUBDIR) : *.cpp ] ;
>>
>> Jam also automatically figures out your include dependencies, unlike  
>> make. See the jam web page for more info about Glob. You will most  
>> likely need help from this mailing list as jam does not have an  
>> abundance of examples.
>>
>> Craig.
>>
>> Daniel White wrote:
>>> Hi all,
>>>
>>> I'm a relative newbie to C and to make/jam in general, but I am unhappy
>>> using an IDE to work in, which is why I would love to get to grips with
>>> make, jam, kjam, or one of the other variants.
>>>
>>> Unfortunately, as I have found out, it can be cumbersome to maintain
>>> the make/jamfile, and Make does little to alleviate the situation.
>>> That's when I found Jam, and the page at:
>>> http://www.perforce.com/jam/jam.html
>>>
>>> It's very good, and a definite improvement over make, but unfortunately,
>>> I still have to type in all the names of the source files!
>>> I want to be able to just specify the name of the file with the main
>>> function, along with the compiler arguments, and that's it. Jam (and
>>> all the other make clones) should be able to automatically scan the
>>> source code to see what other .c or .h files depend on it. This
>>> should be trivial. I shouldn't have to worry about adding these names
>>> in manually. Computers are very good at automation, humans are not.
>>>
>>> Sorry if this seems like a rant. You'd think there'd be something
>>> out there that could do what I want. Perhaps there is? Or maybe
>>> even Jam could do it? If any of you could point me to a make clone
>>> which does this, I'd be very grateful.
>>>
>>> Just to make it totally clear, I'll explain a hypothetical situation.
>>> I have three source files.
>>> #include "main.c"
>>> #include "data.h"
>>> #include "data.c"
>>>
>>> The main.c file has an include for "data.h", so it should know that it  
>>> has
>>> to link to data.c. A human should NOT have to type in data.c into the   
>>> jamfile.
>>> Instead Jam should look through the source to check these things out. In
>>> summary, this would allow me to have one Jamfile for all projects   
>>> (excluding
>>> compiler arguments, which I think I could move to the source code  
>>> anyway -
>>> maybe someone here knows how? ).
>>>
>>> Hope someone can help.
>>>
>>> Cheers,
>>> Daniel
>>>






-- 
Alen


More information about the jamming mailing list