bug-make
[Top][All Lists]
Advanced

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

Re: gmake on Cray X1


From: Kate Hedstrom
Subject: Re: gmake on Cray X1
Date: Thu, 5 May 2005 14:35:50 -0800
User-agent: Mutt/1.3.27i

> > This is the problem function:
> >
> > subdirectory = $(patsubst %/Module.mk,%, \
> >                  $(word                \
> >                    $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
> >
> > The workaround so far is to have the directory hardcode its own name.
> > We don't have so very many for this to be a burden.
> >
> > Kate
> 
> How is that function used?  I thought the $(word) and $(words)
> functions were available in 3.79.  Or maybe my memory is hazy ... is
> it $(word) that was added?
> 
> Another thing I do is that I go the opposite direction:  I give a list
> of directories (which you could extract via a $(shell) command to
> find piped through sed, etc.), then I include the makefiles under
> those directories.

$(word) or $(words) are in 3.79 but not 3.77. The MAKEFILE_LIST is new
in 3.80. It is used inside the nonrecursive Makefile fragment in the
subdirectory:

local_lib  := libnl.a
local_src  := $(wildcard $(subdirectory)/*.F)
path_srcs  += $(local_src)

local_src  := $(patsubst $(subdirectory)/%.F,%.F,$(local_src))
local_objs := $(subst .F,.o,$(local_src))

libraries += $(local_lib)
sources   += $(local_src)

$(local_lib): $(local_objs)
        $(AR) $(ARFLAGS) $@ $^
--------------------------------
We have to edit the name of local_lib here, so there is no real
hardship in editing a local_dir as well. Both versions are straight out
of the new O'Reilly book, except that we're using Fortran instead of C.

Kate
-- 
Kate Hedström       Arctic Region Supercomputing Center
address@hidden       University of Alaska, Fairbanks
Phone: 907-450-8678




reply via email to

[Prev in Thread] Current Thread [Next in Thread]