help-make
[Top][All Lists]
Advanced

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

Re: functions allowed in prerequisite list?


From: gk
Subject: Re: functions allowed in prerequisite list?
Date: Mon, 04 Nov 2002 19:37:16 -0800

At 10:00 PM 11/4/2002 -0500, Paul D. Smith wrote:
Sorry, I still don't understand what you want to do.  Please provide a
more realistic example using actual filenames and describing the way you
want make to behave when it sees them.

Sorry. I'll try again.
I have already started to work around this issue but here is what I wanted.

First question:
* Does make allow functions in the list of prerequisites?

What I am trying to do:
* I have scripts that auto-generate dependency makefiles for files of a single suffix / file type. Each file type has a script that knows how to parse the source files and determine dependencies within the sources.
For example, source files ending in: '.xms' might be parsed by the command:
/path/to/scripts/xms.mkdepend

I want to name these auto-generated dependency makefiles in relation to the source filenames.
I want my dependency files named in the form $(sourceFileName).mk
(I do not like the convention %.c has dependency file %.d since this loses trace of the relationship between %.c and %.d)

In this example, source file 'foo.xms' will have a related dependency makefile 'foo.xms.mk'

The problem is that I want the pattern rule that builds %.xms.mk have the tool 'xms.mkdepend' as a prerequisite

I will have many different source file types using the same naming conventions so I want one pattern rule to handle all. Thus I was trying to write something like the following that would match foo.xms.mk target and exctract the middle part 'xms':

%.mk : % $(someMakeFunctionThatWillGenerateTheMiddlePart)

Here is an explicit rule for what I want:
foo.xms.mk : foo.xms /path/to/scripts/xms.mkdepend

Is there a way to generalize the above rule for all %.mk files?

I am working around this by including makefiles with explicit rules for each source file type.

Thanks,
Greg Keraunen





reply via email to

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