Makefile Issue

Perry Smith pedz@easesoftware.com
Sat May 13 11:47:00 GMT 2006


Well, of course, you could do any of those approaches.  None of them  
will be significantly different.

I would assume that to make Modules 1-7, the process is very  
similar.  If you go the separate makefile route, I would put the  
common things in a common make file and then include it in the  
module1-7 makefiles.  (It does not need to say "makefile" -- it could  
be named anything.)

The top level makefile can invoke make with the other makefiles using  
the -f option: make -f module1.mk for example.  (the .mk suffix is  
just something I made up -- its not significant to make.)  So you  
would have seven of those lines in the top level makefile.

I would try hard to have one makefile if that is plausible.  The  
reason is that for a change to a file that is not common to all the  
modules, only the minimum amount of work will be done to get things  
recompiled.  But, the separate calls to make will not cost time much  
either.

With GNU's make, you can have target specific variables.  So, for  
example, the list of object files needed for each module can be  
specified all in the same makefile using the same name for the  
macro.  Then the macro that does the link will pick the target  
specific value when it does the link for each particular target  
(module in this case).

For clarity, you could have these put into separate files and then  
include them into one master makefile.  Or, as I mentioned before,  
you could have the master makefile invoke make separately for each  
module.

Good luck,
Perry


On May 13, 2006, at 3:14 AM, Parikshat Dubey wrote:

> Hi All!
>
> I am stuck with one big problem as i have to spawn seven modules.
>
> Module1,Module2,Module3,Module4,Module5,Module6,Module7.That is all  
> these seven modules are running on one node or system.There is one  
> more module you can name it 'Spawn Module' which will spawn all the  
> seven modules i.e. spawn module will start all these modules. I am  
> stuck .
>
> I donot know what to do?Whether to write separate make file for  
> each module  from module 1 to module 7
> and make a separate make file for spawn module which will  use all  
> the makes of module 1 to module 7(I know how to write makefile but  
> I donot know how to use all the separate makes for each module to  
> make one final makefile if this is the case.)
> Or
> to write only one makefile and no need of making separate makefiles.
>
> Can any body help me out.I need the solution as early as possible  
> as things have halted for me right now.I will be really thankful  
> and grateful if somebody will help me out.
>
> ThanksandRegards
> ParikshatDubey
>
> _________________________________________________________________
> Get Marriage Proposals by Email. Join FREE! http://www.shaadi.com/ 
> matrimonial-banners/landingpage-jun06.php?ptnr=msnhottag
>
>



More information about the Gcc-help mailing list