bug-make
[Top][All Lists]
Advanced

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

interaction of make -t, -q, phony targets and $(MAKE)


From: Ralf Wildenhues
Subject: interaction of make -t, -q, phony targets and $(MAKE)
Date: Sat, 28 Feb 2009 13:49:33 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

Hello bug makers,  ;-)

in your infinite wisdom, I am sure you can help my confused head wrap
itself around this behavior of (CVS) make:

cat >Makefile <<\EOF
a b:
        echo $@
        echo $@, $(MAKE)

c d:
        echo $@

e f:
        echo $@, $(MAKE)

g h:
        echo $@, $(MAKE)
        echo $@

.PHONY: a c e g
EOF
rm -f ?
make -t a b c d e f g h         # leads to:
| echo a, make
| a, make
| echo b, make
| b, make
| touch b
| make: Nothing to be done for `c'.
| touch d
| echo e, make
| e, make
| echo f, make
| f, make
| echo g, make
| g, make
| echo h, make
| h, make
| touch h
| touch h

This means phony targets which are not marked as recursive (c) are not
touched nor executed.  Is this a bug?  I would guess not.  If you agree
that it is intentional, then I suggest that this be documented in the
manual, proposed patch below.

BTW, I think this behavior is useful.

The other funny thing is the duplicate touch lines for 'h'.  :-)

More funny though is this:

rm -f ?
make -q a b c d e f g h         # leads to:
| echo e, make
| e, make
| echo f, make
| f, make
| echo g, make
| g, make
| echo h, make
| h, make

You only check the first command line for $(MAKE)?  Is this an
intended optimization or an unintended bug?

Thanks!
Ralf

2009-02-28  Ralf Wildenhues  <address@hidden>

        * doc/make.texi (Instead of Execution): Document interaction of
        -t with phony targets.

Index: doc/make.texi
===================================================================
RCS file: /cvsroot/make/make/doc/make.texi,v
retrieving revision 1.52
diff -u -r1.52 make.texi
--- doc/make.texi       18 May 2008 15:11:40 -0000      1.52
+++ doc/make.texi       28 Feb 2009 12:46:16 -0000
@@ -7741,6 +7741,11 @@
 not run unless they too begin with @samp{+} or contain @samp{$(MAKE)} or
 @address@hidden@}} (@xref{MAKE Variable, ,How the @code{MAKE} Variable Works}.)
 
address@hidden phony targets and recipe execution
+With @samp{-t}, phony targets (@pxref{Phony Targets}) are not updated
+nor executed, unless there are recipe lines beginning with @samp{+} or
+containing @samp{$(MAKE)} or @address@hidden@}}.
+
 The @samp{-W} flag provides two features:
 
 @itemize @bullet




reply via email to

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