LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-24-2006, 08:06 AM   #1
pir
LQ Newbie
 
Registered: Oct 2005
Posts: 3

Rep: Reputation: 0
nested makefile? Any good pointers?


Hi!


Is there any way to make a module A that is not runnable and can be baked into another module B, without the Makefile of B knows the CFLAGS and LIBS?

I am a really lousy Makfile writer and also a very lazy guy.

I have a dream of a hiearchy of Makfiles that are responsible for compiling and linking its own code producing some kind of file that can be used by other modules. When a module, B, needs another module, A, it just uses that precompiled file and doesn't need to know which libraries used when it (A) was compiled or needs to know any other linking information other what is used in the module that it is responsible for (that is B source). I suppose that it can be made with some kind of static libraries, but it doesnt seem so nice.

This far I need to have all LIBS and CFLAGS ever used in all Makefiles... then when I tried to use Qt I realized that qmake produced so complicated Makfiles for my lazy mind to interpret. Too many LIBS and other stuff to use it with my other Makefiles.

What I hope is that there is someway to tell g++ not to completely link a program. Just link all libraries needed... and stop just before making a runnable program. You know what I'm saying? So when using this precompiled file I dont need to know the needed CLAGS and LIBS because it already is linked into that module.

If you hade the energy to read this far: Thanks, hope you have any tips.
/p
 
Old 01-25-2006, 04:56 AM   #2
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,596

Rep: Reputation: 80
You can write a makefile for each module and a global makefile for calling the make command on other sub modules. Just use the make command in your makefile.
man make
You can use the make command to build each module independently from other modules.
I'm not sure if that's what you want, please reformulate if that's not what you want.
 
Old 01-25-2006, 06:15 AM   #3
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
?
you mean shared objects?

google this:
recursive make considered harmful

Last edited by bigearsbilly; 01-25-2006 at 06:18 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
what is the meaning of Makefile,Makefile.am,Makefile.in cynthia_thomas Linux - General 3 12-08-2005 05:00 AM
Is there a good Makefile-generating IDE for Linux? DaneM Programming 6 09-19-2005 07:24 AM
how to get (makefile -f makefile )output into the textview widget in Pygtk sailu_mvn Programming 3 02-28-2005 03:57 AM
generate Makefile from Makefile.in without calling ./configure ? chris78 Programming 2 05-02-2004 12:23 PM
Nested structures :S? alitrix Programming 11 11-15-2003 07:13 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration