bugmake - Bugs: bug #45438, -include file prerequisites not...


bug #45438: -include file prerequisites not found, give no error

Submitter:  Joe Sewell <ultrajoe>
Submitted:  Mon 29 Jun 2015 06:15:42 PM UTC
Severity:  3 - Normal Item Group:  Bug
Status:  Duplicate Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  3.81 Operating System:  POSIX-Based
Fixed Release:  3.82 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup

Tue 30 Jun 2015 09:23:02 PM UTC, comment #4: 

This was fixed in GNU make 3.82 (released July 2010):

$ make-3.81

$ make-3.82
make: *** No rule to make target `a.c', needed by `a.o'.  Stop.

Paul D. Smith <psmith>
Group administrator
Tue 30 Jun 2015 07:10:32 PM UTC, comment #3: 

Not allowed to upgrade, but thanks for the info.

Joe Sewell <ultrajoe>
Mon 29 Jun 2015 06:45:53 PM UTC, comment #2: 

Upgrade.  This was fixed some time in the last five years.

Mon 29 Jun 2015 06:23:17 PM UTC, comment #1: 

May be related to #29074, but doesn't sound like a duplicate.

Joe Sewell <ultrajoe>
Mon 29 Jun 2015 06:15:42 PM UTC, original submission:  

Consider the following makefile:

# Remove ALL default rules
(%): %
%.out: %
%.c: %.w %.ch
%.tex: %.w %.ch
%:: %.v
%:: RCS/%,v
%:: RCS/%
%:: s.%
%:: SCCS/s.%

SOURCES = a.c b.c

OBJS = $(SOURCES:%.c=%.o)

DEPFILES = $(SOURCES:%.c=%.c.d)

EXE = a

.PHONY: all
all: $(EXE)

$(DEPFILES): %.c.d : %.c
        @echo "Determining dependencies for $(<F)"
        @$(CC) -E -MM -MF$@ -MP $<

$(OBJS): %.o: %.c
        @echo "Compiling $(<F)"
        @$(CC) -c $< -o $@

$(EXE): $(OBJS)
        @echo "Linking $(@F)"
        @$(CC) $+ -o $@

# This seems to be the troublemaking line!
-include $(DEPFILES)

If one or both source files do not exist, processing for the -include directive notices this, but generates no error, I suppose because of the -include. By the time it gets to the other targets, however, the already-processed files are "Pruned." The end result is no generated error message, but make exits with a status of 2. (Sorry, I'd love to give the output of a make -d on this, but my Linux machine is on an isolated secured network. For similar reasons I am unable to see if this has been fixed in later versions, though perusing the bug list tells me it has not.)

Joe Sewell <ultrajoe>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by ultrajoe (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-06-30 psmith StatusNone Duplicate
        Open/ClosedOpen Closed
        Fixed ReleaseNone 3.82

    Back to the top

    Powered by Savane 3.13-3cd0.
    Corresponding source code