[Top][All Lists]

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

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

From: Joe Sewell
Subject: [bug #45438] -include file prerequisites not found, give no error
Date: Mon, 29 Jun 2015 18:15:44 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0


                 Summary: -include file prerequisites not found, give no error
                 Project: make
            Submitted by: ultrajoe
            Submitted on: Mon 29 Jun 2015 06:15:42 PM GMT
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: 3.81
        Operating System: POSIX-Based
           Fixed Release: None
           Triage Status: None



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.)


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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