help-make
[Top][All Lists]
Advanced

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

Re: unwanted implicit rule


From: Chad_Loder
Subject: Re: unwanted implicit rule
Date: Wed, 4 Jul 2001 17:17:13 -0400

You can turn off implicit rules by running GNU make with the -r flag...for
example:

$ make -r all

<GUESSWORK>

I *think* you can also turn off the implicit rules by doing this in your
makefile:

# turn off magic make rules
.SUFFIXES:

...although I seem to remember this being slower than using -r because
GNU make still looks for implicit rules for every target (even though you
have
removed them all).  Anyone know the story?

</GUESSWORK>

Of course, now you'll have to explicitly specify any implicit rules you
were
using.

Hope this helps.

     chad loder
     principal engineer
     rapid 7, inc.






Nicholas Leippe <address@hidden>@gnu.org on 07/04/2001 04:17:12 PM

Please respond to address@hidden

Sent by:  address@hidden


To:   address@hidden
cc:

Subject:  unwanted implicit rule

Hello,

I'm attempting to add rules to a Makefile to handle
QT Designer .ui files.  The dependencies are as follows:

foo.ui (the source file created by QT Designer)

foo.ui.h       <- foo.ui         (my own rule)

foo.ui.cpp     <- foo.ui.h       (my own rule)

foo.ui.moc.cpp <- foo.ui.h       (my own rule)

foo.ui.o       <- foo.ui.cpp     (implicit %.o:%.cpp)

foo.ui.moc.o   <- foo.ui.moc.cpp (implicit %.o:%.cpp)

so, my rules are:

%.moc.cpp: %.h
           moc $< -o $@

%.ui.h: %.ui
           uic -o %@ $<

%.ui.cpp: %.ui.h
           uic -o $@ -impl $< $(patsubst %.ui.h,%.ui,$<)

however, when I run, it creates the following implicit
dependency:

# Not a target:
src/simple.ui: src/simple.ui.o
#  Implicit rule search has been done.
#  Implicit/static pattern stem: `src/simple.ui'
#  Last modified 2001-07-04 01:47:16
#  File has not been updated.
# No variables.
#  commands to execute (built-in):
        $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@

thus creating a circular dependency:

simple.ui <- simple.ui.o <- simple.ui.cpp <- simple.ui.h <- simple.ui

This wouldn't be a problem if it didn't choose to drop
the wrong one.  It drops the

simple.ui.o <- simple.ui.cpp

dependency which fails with:

make: Circular src/simple.ui.o <- src/simple.ui.cpp dependency dropped.
g++ -O3 -march=i686 -I/usr/local/qt/include -Isrc -c -o src/simple.ui.o
g++: No input files
make: *** [src/simple.ui.o] Error 1

rather than dropping the

simple.ui <- simple.ui.o

dependency leaving the graph in a state which is
impossible to find an implicit rule chain to build from.

I have no idea how this is happening, nor what hat it's
pulling the command for the rule from.  In an attempt to
get rid of it, I tried adding an empty implicit pattern rule:

%.ui: %.ui.o

which according to the info page should disable any
other implicit rule for the pattern.  But, this
doesn't seem to have any affect.  Any ideas?


Nick

_______________________________________________
Help-make mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/help-make







reply via email to

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