bug-make
[Top][All Lists]
Advanced

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

[bug #28983] forcing a target matching a pattern rule shadows the rule's


From: Ilguiz Latypov
Subject: [bug #28983] forcing a target matching a pattern rule shadows the rule's actions
Date: Sat, 08 May 2010 00:10:10 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.11pre) Gecko/20100506 Shiretoko/3.5.11pre

Follow-up Comment #7, bug #28983 (project make):


The following tests show that .PHONY's pre-requisites are normally rebuilt
regardless of existence of a file with the same name.

This works,


$ cat test-force.mak 

default: file.o

.PHONY: file.o

file.o:
        echo Building address@hidden > $@

$ make -f test-force.mak 
echo Building file.o... > file.o

$ ls -al file.o
-rw-r--r-- 1 ilatypov Domain Users 19 May  7 19:58 file.o

$ rm file.o

$ make -f test-force.mak 
echo Building file.o... > file.o

$ ls -al file.o
-rw-r--r-- 1 ilatypov Domain Users 19 May  7 19:58 file.o

$ make -f test-force.mak 
echo Building file.o... > file.o



And this works,


$ cat test-force2.mak 

default: file.o

.PHONY: file.o

file.c:
        echo Auto-generating address@hidden > $@

file.o: file.c
        @echo Building $@ from $^...
        cat $^ > $@

$ rm file.c file.o

$ make -f test-force2.mak 
echo Auto-generating file.c... > file.c
Building file.o from file.c...
cat file.c > file.o

$ make -f test-force2.mak 
Building file.o from file.c...
cat file.c > file.o

$ make -f test-force2.mak 
Building file.o from file.c...
cat file.c > file.o

$ rm file.o

$ make -f test-force2.mak 
Building file.o from file.c...
cat file.c > file.o


But this does not,


$ cat test-force3.mak 

default: file.o

.PHONY: file.o

file.c:
        echo Auto-generating address@hidden > $@

%.o: %.c
        @echo Building $@ from $^...
        cat $^ > $@

$ rm -f file.c file.o

$ make -f test-force3.mak 
make: Nothing to be done for `default'.


This allows me to think that my expectation in the original bug report was
valid.  And a pattern rule should not be affected by the phoniness of a
target.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?28983>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

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