Re: Pattern rules not recognized on Win32

Brian Dessent <[email protected]>
Newsgroups gmane.comp.gnu.make.windows
Organization My own little world...
Message-ID <[email protected]>
"Gerrit ." wrote:

> %.cost: $(COST_DIR)/%.scost $(COST)
>         $(COST) -o $@ -I $(COST_DIR) $<

When you write a pattern rule like this, all the stated prerequisites
must exist (or be able to be built) in order for the pattern rule to
apply.  COST is defined as

COST=$(BIN_PATH)/cost

However, assuming that cost is a binary, it is probably named "cost.exe"
on Win32, meaning that as written $(COST) does not exist and so the
pattern rule can't apply.  You have to be conscientious about using
$(EXEEXT) if you're going to list executables as prerequisites, e.g.

COST=$(BIN_PATH)/cost$(EXEEXT)

(Assuming that you are using autoconf or something else that sets
EXEEXT.)

The ability to leave off the .exe suffix applies only when invoking a
program.  If you expect make to be able to find it as a prerequisite you
have to include it.

Brian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.