[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to change $(CC) for just some targets
From: |
Brian J. Murrell |
Subject: |
Re: how to change $(CC) for just some targets |
Date: |
Thu, 03 Jun 2010 14:50:15 -0400 |
On Thu, 2010-06-03 at 11:42 -0700, Christian Rössel wrote:
> Hi Brian,
Hey Christian,
Thanx for taking the time.
> I use a separate Makefile for MPI targets.
This is what I did last time around. In fact I created a "mpi" subdir
for my MPI sources. I'm looking to avoid doing that again for this
particular use case.
> The Makefile.am starts with
>
> CC = $(MPICC)
> CXX = $(MPICXX)
> F77 = $(MPIF77)
> FC = $(MPIFC)
> LIBS += $(MPILIBS)
>
> where the MPI* variables are set by calls to AX_MPI
AX_MPI. Nice. I will have to look into that one.
> For me, this approach works just fine. However, you need to put the MPI
> Makefile.am into a separate directory as, afaik, there can be only one
> Makefile.am per directory.
Indeed, this is my understanding also.
> But you need not to move your sources, though.
Hrm. Interesting. We did move the MPI sources into the separate subdir
with the new Makefile. How did you avoid moving the sources too? Did
you just prefix all of the filenames, etc. in your subdir/Makefile.am
with "../"? i.e.
foo_CFLAGS = $(PTHREAD_CFLAGS)
foo_SOURCES = ../parser.c ../cfg.c ../foo.c ../parser.h ../platform.h
foo_LDFLAGS := $(PTHREAD_CFLAGS)
foo_LDADD := $(LIBREADLINE) libbar.a $(PTHREAD_LIBS)
foo_DEPENDENCIES := libbar.a
Cheers,
b.
signature.asc
Description: This is a digitally signed message part