help-make
[Top][All Lists]
Advanced

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

Implicit rules overriding defined rules


From: EXT-Pennington, Dale K
Subject: Implicit rules overriding defined rules
Date: Thu, 5 Mar 2009 08:24:15 -0600

Folks,

I have an existing make setup on an IBM AIX 6.1 box using gmake 3.80,
that has the following pattern matching rules :

$(OBJ_DIR)/%.o : %.f
        @$(CC) $(CFLAGS) -c $< -o $@

(%.o) : $(OBJ_DIR)/%.o
        @ar $(ARFLAGS) $@ $<

As I said this works find. But now I am porting to a Red Hat Linux
(kernel 2.6) that is has gmake 3.81, and interesting things are
happening.

To start with, if I just invoke with gmake, the default implicit rules
are kicking in, which among other things means instead of leaving the
intermediate object files in OBJ_DIR they are dropped in the directory
the makefile is in.  If however, I suppress the builtin rules, by
invoking gmake -r, my pattern matching rules ARE used, and I get the
expected results.

Well, I almost get them. I guess 3.81 does a better analysis of
intermediate files, and is deleting the .o's at the end of the make,
which 3.80 did not. But that should be handleable.

The main thing is, how do I get gmake to use my rules, and not theirs,
whichout having to tell all our developers to add a -r to all their
gmake invocations (which they will miss about half the time I would
guess), and why is gmake ignoring the rules I defined in favor of its
own rules ?

Thanks,
Dale Pennington




reply via email to

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