Re: make on multiple platforms
- From: karthikbalaguru <karthikbalaguru79@xxxxxxxxx>
- Date: Tue, 30 Oct 2007 22:27:29 -0700
On Oct 31, 12:48 am, Khookie <chris.k...@xxxxxxxxx> wrote:
Hi
I'm sure not if this is the right newsgroup since this is (possibly) a
question about make, but hopefully someone here might know the best
way about this.
I've built a program that compiles well on my Ubuntu PC.
However, I also wanted to compile it on my Mac (which has MacPorts
installed & the necessary libraries installed).
Now with MacPorts, all the include/lib paths are different, hence the
makefile I have doesn't work too well unless I create another one
(which I've done for now).
Is there a way I can just have one makefile, which has both settings,
and can compile accordingly?
Why do you try compiling applications of different environment
in irrelevant environments. Get the correct setup . That will
help you.
If you are trying to port from one environment into another
environment. Then , try correlating the Makefile syntax of
both the environment and incorporate the corresponding changes
into the new environment.
Take care of compiler dependency, linker dependency, calling
conventions, bitfields, byte alignment, datatypes and others
w.r.t porting.
If you need to make the makefile compatible with both the
environment, i doubt it is possible with a single makefile as the
Makefile syntax can vary from environment to environment. Maybe, you
can have different independnt makefiles for both the environments .
But there is a way in the Makefile to manage multiple environments.
In this solution, the makefile for each module is placed in the /
native directory, and GCC flags (<platform>.mk) are placed in the make/
platform directory for each platform. During building, the makefile of
each module automatically finds the <platform>.mk file at run time and
includes them to constitute an integral native build script. The
script also chooses platform-specific code in a particular directory.
Try the manpages of Makefile, it has got good information.
Karthik Balaguru
.
- References:
- make on multiple platforms
- From: Khookie
- make on multiple platforms
- Prev by Date: ***********Super C Language************
- Next by Date: Re: printf("%d",float)
- Previous by thread: Re: make on multiple platforms
- Next by thread: Re: A Trend Towards Lower Software Maintenance Budgets?
- Index(es):
Relevant Pages
|