RE: makefile question

 

 

True, There are lots of ways you can do this.  The way I sent I compile all
my binaries into a /bin directory each Make file gets the environment of the
parent so I can set up my bin directories and my object and all that in one
small make file then I import makefiles depending on if I am compiling under
Hp unix, Linux, sun, Amiga, MsDos, Linux, Cygwin, or Mingw.  The make file
works under all of those.  It used to work under Vax but I haven't had a vax
server to try on so long I am afraid most of the new libraries would blow up
at the thought.

 

I am actually thinking of changing it like you say so I have a release and
debug directory like Microsoft does but truth is I just pass it a command
line and it does all that now.  I will change to that when I change totally
to jamfiles.  I have the Jamfiles working I just need to finally switch of
course that will break my hp Unix and sun build but I haven't built for
those platforms in forever.  The Amiga build will probably also break but
who do you know still has one and actually uses it as a server?

 

Ken

 

Ken

 

From: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of tribble
Sent: Saturday, December 27, 2008 12:42 AM
To: programmingblind@xxxxxxxxxxxxx
Subject: Re: makefile question

 

There are 2 other things I'd like to add to Ken's makefile --

First, I'm sure Ken has looked at this more recently than me and is probably
right, but is each line of the makefile interpreted inside its own shell? or
in the surrounding context? I remember when I used to write makefiles I used
to sometimes put parentheses around the line so when I type cd, it wouldn't
change the folder for the surrounding context. Just a thought.

 

Second, when I used to work on large makefiles, we would not put the
makefile for the whole project one level up, but rather in a parallel
directory. That way you could build multiple executables, each in its own
directory. For example, if you want 2 versions of a library, one with
exception handling code included and the other not, (C++ of course), you
would create 2 directories mkPlain and mkEH, and compile all the object
files with the exception handling code compiled in, then go to the other and
compile it without.

So in mkEH\makefile put

    (cd ..\lib; $(MAKE) lib.dll; mv lib.dll ../mkEH )

 

Excuse the typos.  Correct me if I'm off; it's been a while.  And I don't
know if you are running on a unix shell or windows environment somewhere.

Happy hacking.

--le

 

----- Original Message ----- 

From: Tyler Littlefield <mailto:tyler@xxxxxxxxxxxxx>  

To: programmingblind@xxxxxxxxxxxxx 

Sent: Friday, December 26, 2008 11:42 PM

Subject: Re: makefile question

 

awesome, thanks. so I just need to add a cd;make to the root for each of the
folders.

wonder if there's an easier way of doing that (like storing the list of dirs
in a variable) or something... I'll have to check in to it.

 

----- Original Message ----- 

From: Ken Perry <mailto:whistler@xxxxxxxxxxxxx>  

To: programmingblind@xxxxxxxxxxxxx 

Sent: Friday, December 26, 2008 8:32 PM

Subject: RE: makefile question

 

 

 

You add the make file in the next level in the make file of the first level
as one of the commands to execut in the lower level.  I have a 3 level tree
in my current make file system and in the first level it looks something
like this :

 

all:          $(BINDIR)$(SERVER)

                cd scripts;make "MAKEFILE=${MAKEFILE}"

                cd utilities;make 

                cd key;make

cd compiler;make "MAKEFILE=${MAKEFILE}"

cd language;make "MAKEFILE=${MAKEFILE}"

                cd mplex;make "MAKEFILE=${MAKEFILE}"

cd Utility;make "MAKEFILE=${MAKEFILE}"

 

d 

 

From: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Tyler
Littlefield
Sent: Friday, December 26, 2008 2:26 PM
To: programmingblind@xxxxxxxxxxxxx
Subject: makefile question

 

Hello list,

I've got a quick question.

I've got a set of programs, each in their own separate folder with makefiles
to match.

This works, but when I want to build the whole package I have to go from
directory to directory.

Is there a way perhaps, to make a makefile compile with other makefiles
under separate directories? I'd just like one main makefile that will run
the makefiles in sub directories, and pass in the argument.

So, if I'm at the root of the directory and I want to clean the package,
make clean would go to directories a,b,c,d,e and run make clean, etc.

TIA,

 

Other related posts: