Complete.Org: Mailing Lists: Archives: discussion: July 2000:
[aclug-L] Re: master makefile
Home

[aclug-L] Re: master makefile

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: discussion@xxxxxxxxx
Subject: [aclug-L] Re: master makefile
From: Tom Hull <thull@xxxxxxxxxxx>
Date: Fri, 28 Jul 2000 11:33:20 -0500
Reply-to: discussion@xxxxxxxxx

The way I do it (in ftwalk) is:

SUBDIRS = tools src test

all :
        for D in $(SUBDIRS); do \
          (cd $$D && $(MAKE) $@); \
        done

fthelp :
        cd src/fthelp && $(MAKE) $(MAKEFLAGS)

ftwalk :
        cd src/ftwalk && $(MAKE) $(MAKEFLAGS)

test :
        cd test && $(MAKE) $(MAKEFLAGS)

I'm not totally happy with this, but at least it's a start,
and it's pretty straightforward. A lot of make tricks strike
me as too much magic.

I use autoconf, and let configure process my Makefile.in into
Makefile. I also separate out an include file for all of the
makefiles to do common definitions.

I think that automake has built-in support for recursive makefiles.
It's probably better than you can (easily) do by hand, but I find
that the makefiles are unreadable, and automake enforces a lot of
prickly GNU-style requirements that may be good ideas but can also
be an annoyance, especially for your own stuff.

Jeff Schaller wrote:
> 
> On Fri, 28 Jul 2000, Carl D Cravens wrote:
> 
> > In my case, I have a bunch of directories that hold HTML
> > template files.  Each page.html has a directory named page,
> > and each directory has its own Makefile.
> >
> > all: index.html about.html fred.html
> >
> > %.html:
> >    cd $(basename $@) && $(MAKE)
> >
> > I'm no make expert.  I haven't figured out how to (or if you
> > can) make it do rules like %.html without a suffix... (that
> > is, give it a list of directory names).
> 
> Sounds like a shell script with a loop to me :)
> 
> #!/bin/bash
> for dir in $*
> do
>         (cd $dir; make)
> done!
> 
> -jeff
> --
> I could easily overemphasize the importance of good grammar.  For example,
> I could say: "Bad grammar is the leading cause of slow, painful death in
> North America," or "Without good grammar, the United States would have
> lost World War II."  -- Dave Barry, "An Utterly Absurd Look at Grammar"
> 
> -- This is the discussion@xxxxxxxxx list.  To unsubscribe,
> visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi

-- 
/*
 *  Tom Hull * thull@xxxxxxxxxxx * http://www.ocston.org/~thull/
 */

-- This is the discussion@xxxxxxxxx list.  To unsubscribe,
visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi


[Prev in Thread] Current Thread [Next in Thread]