[jamming] Complete, and utter automation with Jam

John Waugh john.waugh at gmail.com
Fri Aug 18 22:39:03 PDT 2006


I just realized I forgot to include jamming in my reply - oops

On 8/18/06, John Waugh <john.waugh at gmail.com> wrote:
>
> Hello,
>
> When you say:
>
> >> 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.
>
> How should it "know" to link to data.c ?
> Is this purely by naming convention?
>
> In other words, are you proposing the condition that if XXX.h is included,
> then XXX.c should be added to the list of sources ?
>
> There are plenty of cases where XXX.h may be included and that may mean
> that AAA.c, BBB.c, and DDD.c are the ones it should "know" to include, but
> that does not have the advantage of a naming convention.
>
> If you plan to always use this naming convention, and if you want to make
> Jam respect it (which it doesn't by default), then you may want to look into
> writing your own HDRRULE.
> If that is the case, read on:
>
> Basically, the rule that is specified by HDRRULE (which you can write
> yourself) will be called each time a source file is scanned for #includes.
> The list of #included files will be in $(>) and the original file (such as
> main.cpp) will be in $(<)
>
> You can then do anything you want with these, such as changing the
> extension of files in $(>) from .h to .c and adding those files as sources -
> thus respecting your naming convention, if I interpret you correctly.
>
> Make sense?
>
> -John
>
>
> On 8/18/06, Daniel White <twinbee41 at skytopia.com> 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
> > >>
> >
> >
> >
> > --
> > www.skytopia.com
> > _______________________________________________
> > jamming mailing list  -   jamming at perforce.com
> > http://maillist.perforce.com/mailman/listinfo/jamming
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://maillist.perforce.com/pipermail/jamming/attachments/20060818/3b703d08/attachment.html


More information about the jamming mailing list