Re: make on multiple platforms



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

.



Relevant Pages

  • Re: How did you learn your debugging skills?
    ... > for bug fixes, as I'm sure we'd all agree. ... Could it also edict that a programmer can compile and execute small modules ... invest in copying the makefile into a new makefile, ... > So much for trying to do TDD in that environment! ...
    (comp.programming)
  • Re: Generic and platform-specific Makefiles
    ... AV> If I compile the program on Linux ... AV> the Makefile must not contain that line. ... use predefined knowledge of target platform features ... and one can also use mix of them (e.g. most data are from feature tests, ...
    (comp.unix.programmer)
  • Re: Compiling DBD::Oracle 1.17 with LD_RUN_PATH
    ... Specifally the libclntsh.so file is now bundled in the libclntsh.so.10.1 file (depending on which client) ... Subject: Compiling DBD::Oracle 1.17 with LD_RUN_PATH ... The Makefile for 1.17, on the other hand, doesn't set LD_RUN_PATH. ... By setting LD_RUN_PATH in my environment, I was able to build 1.17 with the ...
    (perl.dbi.users)
  • Re: Need help with cleaning up a working GNU Autotools setup
    ... Makefile, with VPATH set to the surce directory. ... > environment, I may end up in a maintenance nightmare. ... you are talking about autotools for. ... It's none of my business how you go about that. ...
    (comp.os.linux.development.system)
  • Re: makefile format ?
    ... The BUILD environment from the DDK/WDL uses a specific makefile, ... Don Burn (MVP, Windows DDK) ... console or SDK project? ...
    (microsoft.public.development.device.drivers)