> > 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 [EMAIL PROTECTED] University of Alaska, Fairbanks Phone: 907-450-8678 _______________________________________________ Bug-make mailing list Bug-make@gnu.org http://lists.gnu.org/mailman/listinfo/bug-make