help-make
[Top][All Lists]
Advanced

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

Re: unwanted implicit rule


From: Paul D. Smith
Subject: Re: unwanted implicit rule
Date: Wed, 4 Jul 2001 19:10:54 -0400

%% Nicholas Charles Leippe <address@hidden> writes:

  ncl> %: %.o

  ncl> and it still does the same thing.  Should I look for another rule
  ncl> that is perhaps causing the match?

Something else must be going on.

I can't reproduce your problem, though; maybe you can provide an
example.

Here is the example I used:

  $ cat Makefile
  %.moc.cpp: %.h ; cp $< $@

  %.ui.h: %.ui ; cp $< $@

  %.ui.cpp: %.ui.h ; cp $< $@

  all: foo.ui.o foo.ui.moc.o

  $ touch foo.ui

  $ make
  make: Circular foo.ui <- foo.ui.o dependency dropped.
  cp foo.ui foo.ui.h
  cp foo.ui.h foo.ui.cpp
  g++    -c -o foo.ui.o foo.ui.cpp
  cp foo.ui.h foo.ui.moc.cpp
  g++    -c -o foo.ui.moc.o foo.ui.moc.cpp
  rm foo.ui.cpp foo.ui.h foo.ui.moc.cpp

As best as I can tell, this is what you want to do and works correctly.
This was GNU make 3.79.1.

I added the "%: %.o" rule, then I got a different circular dependency
message, building foo.ui from foo.ui.cpp.  So I added a "%: %.cpp" as
well, then I got no circular dependency messages.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://www.paulandlesley.org/gmake/
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist



reply via email to

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