[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #30762] another make -n exception
From: |
anonymous |
Subject: |
[bug #30762] another make -n exception |
Date: |
Thu, 12 Aug 2010 22:52:47 +0000 |
User-agent: |
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E) |
URL:
<http://savannah.gnu.org/bugs/?30762>
Summary: another make -n exception
Project: make
Submitted by: None
Submitted on: Thu 12 Aug 2010 10:52:45 PM UTC
Severity: 3 - Normal
Item Group: Documentation
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Component Version: None
Operating System: None
Fixed Release: None
Triage Status: None
_______________________________________________________
Details:
The following simple Makefile demonstrates a "-n" issue:
----------------------------
-include fred.d
fred.o:
echo FRED.O > fred.o
cat fred.o
fred.d:
echo "fred.o:" > fred.d
cat fred.d
-----------------------------
Assume an empty directory (other than Makefile above).
make -n
should, according to documentation for -n, show:
echo FRED.O > fred.o
cat fred.o
but, it actually shows (and executes):
-------------------------
echo "fred.o:" > fred.d
cat fred.d
fred.o:
echo FRED.O > fred.o
cat fred.o
-------------------------
In other words, because of the "include" and a declaration to create the file
"fred.d", make actually makes the file (and recursively restarts with the new
fred.d). This is a correct action, but it is not well documented.
Documentation in Section 9.3 says that if -n is specified, recipe lines are
not run, with the exceptions of + and ${MAKE} lines. However, this example
shows a case where a recipe line might be run, even though it does not have
one of those markers.
Section 3.3 does state: "Once it has finished reading makefiles, make will
try to remake any that are out of date or don't exist.", but for someone
debugging a Makefile, this location is obscure and not optimal.
To help makefile authors figure out what's going on, I would suggest adding
to Section 9.3 something of the form:
----------------- add below to section 9.3 -----------------
In situations where a remake of sub-makefiles can occur, such as with an
"include", recipe lines used to remake a missing or out-of-date included file
will be executed even if -n, -q, or -t has been specified.
----------------- add above to section 9.3 -----------------
Sincerely,
Stan Tomlinson
address@hidden
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?30762>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [bug #30762] another make -n exception,
anonymous <=