John Marshall
2013-11-21 14:08:35 UTC
URL:
<http://savannah.gnu.org/bugs/?40657>
Summary: Suffix rules and prerequisites
Project: make
Submitted by: jmarshall
Submitted on: Thu 21 Nov 2013 14:08:34 GMT
Severity: 3 - Normal
Item Group: Documentation
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Component Version: 3.81
Operating System: Any
Fixed Release: None
Triage Status: None
_______________________________________________________
Details:
The "Suffix Rules" info node states
"Suffix rules cannot have any prerequisites of their own. If they have any,
they are treated as normal files with funny names, not as suffix rules."
However this appears to be incorrect. Here is the example following that
text, with -DHELLO added so we can see it for certain:
$ cat badsuffix.mk
.c.o: foo.h
$(CC) -DHELLO -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
$ touch hello.c
$ make -f badsuffix.mk -n hello.o .c.o
cc -DHELLO -c -o hello.o hello.c
make: *** No rule to make target `foo.h', needed by `.c.o'. Stop.
$ make -f badsuffix.mk -p | grep -B4 -A1 'badsuffix.mk.*line 2'
[snip]
%.o: %.c
# commands to execute (from `badsuffix.mk', line 2):
$(CC) -DHELLO -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
--
.c.o: foo.h
# Implicit rule search has not been done.
# Modification time never checked.
# File has not been updated.
# commands to execute (from `badsuffix.mk', line 2):
$(CC) -DHELLO -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
So both a suffix rule and a rule for a funnily-named file have been made, and
only one got the prerequisite. Perusal of the NEWS file suggests that this
may have changed in 3.58 ("Suffix rules may have dependencies (which are
ignored)"), but it seems that the documentation has not caught up.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?40657>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
<http://savannah.gnu.org/bugs/?40657>
Summary: Suffix rules and prerequisites
Project: make
Submitted by: jmarshall
Submitted on: Thu 21 Nov 2013 14:08:34 GMT
Severity: 3 - Normal
Item Group: Documentation
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Component Version: 3.81
Operating System: Any
Fixed Release: None
Triage Status: None
_______________________________________________________
Details:
The "Suffix Rules" info node states
"Suffix rules cannot have any prerequisites of their own. If they have any,
they are treated as normal files with funny names, not as suffix rules."
However this appears to be incorrect. Here is the example following that
text, with -DHELLO added so we can see it for certain:
$ cat badsuffix.mk
.c.o: foo.h
$(CC) -DHELLO -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
$ touch hello.c
$ make -f badsuffix.mk -n hello.o .c.o
cc -DHELLO -c -o hello.o hello.c
make: *** No rule to make target `foo.h', needed by `.c.o'. Stop.
$ make -f badsuffix.mk -p | grep -B4 -A1 'badsuffix.mk.*line 2'
[snip]
%.o: %.c
# commands to execute (from `badsuffix.mk', line 2):
$(CC) -DHELLO -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
--
.c.o: foo.h
# Implicit rule search has not been done.
# Modification time never checked.
# File has not been updated.
# commands to execute (from `badsuffix.mk', line 2):
$(CC) -DHELLO -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
So both a suffix rule and a rule for a funnily-named file have been made, and
only one got the prerequisite. Perusal of the NEWS file suggests that this
may have changed in 3.58 ("Suffix rules may have dependencies (which are
ignored)"), but it seems that the documentation has not caught up.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?40657>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/