bug-make
[Top][All Lists]
Advanced

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

[bug #20394] vpath directive drops entries


From: anonymous
Subject: [bug #20394] vpath directive drops entries
Date: Sat, 07 Jul 2007 08:09:40 +0000
User-agent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.2 (like Gecko) Kubuntu 6.06 Dapper

URL:
  <http://savannah.gnu.org/bugs/?20394>

                 Summary: vpath directive drops entries
                 Project: make
            Submitted by: None
            Submitted on: Samstag 07.07.2007 um 08:09 UTC
                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

    _______________________________________________________

Details:

With GNU make v3.81 (as well as earlier versions, eg. 3.81beta4 and v3.80),
the vpath directive for libraries seems to "forget" entries under certain
circumstances.

Example:

A project with the following directory layout:

Makefile
foo1/
 foo1/Makefile
foo2/
 foo2/Makefile
foo3/
 foo3/Makefile
foo4/
 foo4/Makefile
foo5/
 foo5/Makefile
foo6/
 foo6/Makefile
foo7/
 foo7/Makefile
foo8/
 foo8/Makefile
include/
lib/

and this top-level Makefile:


#####################
SUBDIRS  := foo1 foo2 foo3 foo4 foo5 foo6 foo7 foo8
TARGET   := app
LIBDIRS  := $(patsubst %,-L%,$(SUBDIRS))
LIBS     := $(patsubst %,-l%,$(SUBDIRS))


vpath %.h include
vpath %.a lib $(SUBDIRS)


all: subdirs $(TARGET)

subdirs:
        @(for module in $(SUBDIRS); \
                do \
                        $(MAKE) -w -C $$module -f Makefile $(MAKECMDGOALS); \
                done)

$(TARGET): $(LIBS)
        $(CC) -o $@ $(LIBDIRS) $(LIBS)
#####################


and this as each of the subdir-Makefiles:


LIBNAME := $(shell basename `pwd`)
LIBFILENAME := lib$(LIBNAME).a
LIBTARGET := $(LIBFILENAME)

all: $(LIBTARGET)

$(LIBTARGET):
        touch $@


----

Output:


$ make
make[1]: Entering directory `/home/luna/tmp/testmake3/foo1'
touch libfoo1.a
make[1]: Leaving directory `/home/luna/tmp/testmake3/foo1'
make[1]: Entering directory `/home/luna/tmp/testmake3/foo2'
touch libfoo2.a
make[1]: Leaving directory `/home/luna/tmp/testmake3/foo2'
make[1]: Entering directory `/home/luna/tmp/testmake3/foo3'
touch libfoo3.a
make[1]: Leaving directory `/home/luna/tmp/testmake3/foo3'
make[1]: Entering directory `/home/luna/tmp/testmake3/foo4'
touch libfoo4.a
make[1]: Leaving directory `/home/luna/tmp/testmake3/foo4'
make[1]: Entering directory `/home/luna/tmp/testmake3/foo5'
touch libfoo5.a
make[1]: Leaving directory `/home/luna/tmp/testmake3/foo5'
make[1]: Entering directory `/home/luna/tmp/testmake3/foo6'
touch libfoo6.a
make[1]: Leaving directory `/home/luna/tmp/testmake3/foo6'
make[1]: Entering directory `/home/luna/tmp/testmake3/foo7'
touch libfoo7.a
make[1]: Leaving directory `/home/luna/tmp/testmake3/foo7'
make[1]: Entering directory `/home/luna/tmp/testmake3/foo8'
touch libfoo8.a
make[1]: Leaving directory `/home/luna/tmp/testmake3/foo8'
make: *** No rule to make target `-lfoo8', needed by `app'.  Stop.



Interestingly, it works again if any one of these actions is taken:
* the lib/ directory is removed
* the include/ directory is removed
* one of the entries of SUBDIRS is removed
* the line with *vpath %.h include* is removed
* the line with *vpath %.h include* is put _after_ the *vpath %.a ...*
* in the line with *vpath %.a ...*, the entry *lib* is moved to the end of
the list




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Samstag 07.07.2007 um 08:09 UTC  Name: make_vpath_error.tar.gz  Size:
845B   By: None
Example directory structure, as described above
<http://savannah.gnu.org/bugs/download.php?file_id=13261>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?20394>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.gnu.org/





reply via email to

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