Date: Wed, 6 Dec 2000 08:20:31 -0800 (PST) From: dhw@whistle.com To: FreeBSD-gnats-submit@freebsd.org Cc: jrj@cc.purdue.edu, oliva@lsd.ic.unicamp.br Subject: bin/23328: make forgets about some .SUFFIXES sometimes Message-ID: <200012061620.eB6GKVh06467@m1022069438.whistle.com> Resent-Message-ID: <200012061630.eB6GU1u67142@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 23328
>Category: bin
>Synopsis: make forgets about some .SUFFIXES sometimes
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Dec 06 08:30:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: David Wolfskill
>Release: FreeBSD 4.2-STABLE i386
>Organization:
Whistle Communications
>Environment:
Originally noted in 4.1.1-S as of 29 September; reproduced in
4.2-S as of 21 November. Original failure was in trying to
build amanda 2.4.2 (released) with "make"; it appears that
some constructs created by automake tickled the bug in "make",
while "gmake" was not affected (unsurprisingly).
>Description:
Certain contents of .SUFFIXES lines work normally, while slight
modifications (including permutations of suffix entries) will
cause "make" to "forget" how to handle files with certain
suffixes.
>How-To-Repeat:
Create a test directory; copy in the following Makefile:
--------->%-------- cut here -----------------
.SUFFIXES:
# .SUFFIXES: .c .h .lo .o .obj .sh .pl
.SUFFIXES: .c .h .lo .o .obj .pl .sh
.sh:
cat $< > $@
chmod +x $@
.pl:
cat $< > $@
chmod +x $@
S= jj.sh kk.pl
T= jj kk
all: jj kk
clean:
rm -f ${T}
realclean:
rm -f ${S} ${T}
test:
touch ${S}
----------------- snip! --------%<---------
First, "make test"; this should create jj.sh & kk.pl.
Then "make -n all"; I get:
cat jj.sh > jj
chmod +x jj
make: don't know how to make kk. Stop
(I just used the -n so I don't need to clean so often.)
Then un-comment the commented .SUFFIXES line (line #2), and
comment out the 3rd .SUFFIXES line instead. Re-do the "make -n
all"; I get:
cat jj.sh > jj
chmod +x jj
cat kk.pl > kk
chmod +x kk
Re-running the above tests under "script", with the "-d A"
debugging flag, yields the following differences between the
outputs:
--- bad Wed Dec 6 08:13:34 2000
+++ good Wed Dec 6 08:13:44 2000
@@ -1,4 +1,4 @@
-Script started on Wed Dec 6 08:12:32 2000
+Script started on Wed Dec 6 08:13:08 2000
m1022069438[1]% make -n -d A all
Global:.MAKEFLAGS = -n -d
Global:.MAKEFLAGS = -n -d A
@@ -234,11 +234,11 @@
inserting .c(0)...at end of list
inserting .o(3)...at end of list
defining transformation from `.sh' to `'
-inserting .sh(6)...before .sh(22)
+inserting .sh(5)...already there
inserting (0)...at end of list
transformation .sh complete
defining transformation from `.pl' to `'
-inserting .pl(5)...already there
+inserting .pl(6)...before .sh(22)
inserting (0)...at end of list
transformation .pl complete
Global:S = jj.sh kk.pl
@@ -412,11 +412,11 @@
# To:
# From:
# Search Path:
-# `.pl' [0]
+# `.sh' [0]
# To:
# From:
# Search Path:
-# `.sh' [1]
+# `.pl' [1]
# To:
# From:
# Search Path:
@@ -533,6 +533,8 @@
adding suffix rules
trying jj.c...Searching for jj.c...failed.
not there
+ trying jj.pl...Searching for jj.pl...failed.
+not there
trying jj.sh...Searching for jj.sh...in '.'
got it
jj:@ = jj
@@ -551,33 +553,42 @@
jj:? = jj.sh
cat jj.sh > jj
chmod +x jj
-update time: 8:12:40 Dec 06, 2000
+update time: 8:13:14 Dec 06, 2000
SuffFindDeps (kk)
No known suffix on kk. Using .NULL suffix
adding suffix rules
trying kk.c...Searching for kk.c...failed.
not there
- trying kk.sh...Searching for kk.sh...failed.
-not there
- trying kk.sh...Searching for kk.sh...failed.
-not there
- trying kk.y...Searching for kk.y...failed.
-not there
- trying kk.l...Searching for kk.l...failed.
-not there
+ trying kk.pl...Searching for kk.pl...in '.'
+got it
kk:@ = kk
kk:* = kk
-Searching for kk...failed.
-Examining kk...Searching for kk...failed.
-non-existent...non-existent and no sources...out-of-date.
-kk:? =
-kk:> =
-make: don't know how to make kk. Stop
+ applying .pl -> to "kk"
+SuffFindDeps (kk.pl)
+kk.pl:@ = kk.pl
+kk.pl:* = kk
+Searching for kk.pl...in '.'
+kk.pl:@ = kk.pl
+kk.pl:* = kk
+kk:< = kk.pl
+Examining kk.pl...modified 7:26:56 Dec 06, 2000...up-to-date.
+Examining kk...non-existent...modified before source...out-of-date.
+kk:> = kk.pl
+kk:? = kk.pl
+cat kk.pl > kk
+chmod +x kk
+update time: 8:13:14 Dec 06, 2000
+Examining all...non-existent...modified before source...out-of-date.
+all:> = jj
+all:? = jj
+all:> = jj kk
+all:? = jj kk
+update time: 8:13:14 Dec 06, 2000
#*** Input graph:
#
# *** MAIN TARGET ***
# 2 unmade children
-# non-existent (maybe): aborted
+# last modified 8:13:14 Dec 06, 2000: made
all : jj kk
@@ -610,6 +621,7 @@
# kk [kk]
# .END [.END]
# jj.sh [jj.sh]
+# kk.pl [kk.pl]
#*** Global Variables:
.LIBS =
.INCLUDES =
@@ -721,9 +733,9 @@
#*** Command-line Variables:
#*** Directory Cache:
-# Stats: 3 hits 14 misses 0 near misses 7 losers (30%)
+# Stats: 5 hits 9 misses 0 near misses 7 losers (41%)
# directory referenced hits
-# . 2 2
+# . 2 4
# /usr/share/mk 1 1
#*** Suffixes:
@@ -747,11 +759,11 @@
# To:
# From:
# Search Path:
-# `.pl' [0]
+# `.sh' [2]
# To:
# From:
# Search Path:
-# `.sh' [5]
+# `.pl' [5]
# To:
# From:
# Search Path:
@@ -860,4 +872,4 @@
m1022069438[2]% ^Dexit
-Script done on Wed Dec 6 08:12:43 2000
+Script done on Wed Dec 6 08:13:17 2000
>Fix:
Another circumvention appears to be to comment out the first
(empty) ".SUFFIXES" line.
Unfortunately, in a situation where the Makefile itself is
generated by other tools (such as automake), one doesn't
necessarily have enough control to avoid the behavior in
question... which appears pretty bogus, regardless.
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200012061620.eB6GKVh06467>
