[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: makefile not taking aliases into account



On 5/8/05, Kamaraju Kusumanchi <kk288@cornell.edu> wrote:
> Michael Marsh wrote:
> > In general, though, it's better to set everything that you need in the
> > makefile, since relying on your aliases makes your makefile highly
> > non-portable.  I usually do something like (using your example):
> > X := y
> > and then using $(X) instead of the alias x in commands.
> Actually for me the reason for sourcing the .bashrc is for portability!
> This is my situation. Consider two machines A and B. I use gfortran
> compiler on these machines with the same makefile. I have latest
> gcc-snapshot on machine A and a bit older gcc-snapshot on machine B. The
> latest gcc-snapshot package names the gfortran executable as
> gfortran-20050507-1 while the older gcc-snapshot calls it gfortran. This
> makes the makefile non-portable (as it relies on compiler set to
> gfortran) across A and B. So I decided to put an alias for gfortran in
> the .bashrc of machine A, so that gfortran will in turn call
> gfortran-20050507-1. Is there any other portable solution way for this
> situation?

Well, nothing's going to be 100% portable without some work on your
part, so you might want to consider using autoconf.  Alternatively,
you could set up something through /etc/alternatives.  I've never done
this, but I think the "--install" option would allow you to create an
f95 (or whatever you'd like to call it) symlink.  That would give you
a single location (say, /usr/bin/f95) on either host.

-- 
Michael A. Marsh
http://www.umiacs.umd.edu/~mmarsh
http://mamarsh.blogspot.com



Reply to: