sounds like a good idea. Here's a proposed example usage:
-include Makefile.module
Makefile.module: FORCE
modulecmd gnumakefile module load foo/1.2 bar/3.4> $@
FORCE:
############# Makefile.module would look like (hopefully) ########
PATH:=/sw/foo/1.2/bin:/sw/bar/3.4/bin:$(PATH)
FOOHOME:=/sw/foo/1.2
LD_LIBRARY_PATH:=/sw/foo/1.2/lib:$(LD_LIBRARY_PATH)
---
An alternate would be
PATH:=$(shell modulecmd pathonly module load foo/1.2 bar/3.4)
but this would only allow setting the path.
I think that make automatically assumes that all included files are
dependencies first, so that Makefile.module would always be made when you run
'make'.
Note that this example does not make use of init files, since the purpose of
the init file is to set the "module" alias, which is not useful in Makefiles.
-Mark
Mark Lakata, Staff Engineer 1225 Charleston Road voice 650-567-5170
MIPS Technologies Mountain View CA 94043 fax 650-567-5002
On Wed, 8 May 2002, Harlan Stenn wrote:
> I notice modules init files for various shells, perl, and python.
>
> Has somebody written one for, say, GNU make?
>
> I'm trying to explore the possibility of using the beast for CM stuff, so
> folks can easily use the right tools for a build using "make" and having
> that override things like the user's PATH.
>
> Yes, I'm trying to find the least offiensive/evil solution to a complex
> situation...
>
> H
>
|