🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #207

GNU make version 3.62: VPATH

#207
From: Robert Serr 507-0429, 312
Date: Thu, 23 Jul 1992 00:18
32 lines
2619 bytes
To the bug fixer,
	I have found what I think is a bug in the vpath command in version 3.62 of GNU MAKE.  It doesn't work the way I would think it would after reading the documentation, but please inform me if it is supposed to work this way. 
	I have two directories, one containing source (/work) and one containing binaries (/bin).  They are on the same level (from work I do cd ../bin to get to /bin).  I have prog1.c in /work which is more recent than the copy of prog1.o in /bin.  My make file is also in /work.  I set the vpath using both of the commands listed in the make file below, and it behaves the same way.  When I run GNU MAKE, it will NOT recompile prog1.c like it should (since it is more recent than ../bin/prog1.o).  It will instead li
nk prog1.o.  
	I would think that since vpath is supposed to make files seem as thought they are in the same directory, that the time stamps of these files should be compared, and that the more recent file should be used.      
	I ran GNU MAKE -d to see what the thinking was.  It looks like once a dependent (.o file) has been found in the alternative directory (../bin), that GNU MAKE will only search for implicit dependencies starting from the alternative directory (../bin/prog1..c, ../bin/prog1.p etc.).  If the dependent (.o file) is in the current directory (.), then GNU MAKE will search for implicit dependencies in the alternative directory, as well as the current directory (prog1.c, prog1.p, ../bin/prog1.c, etc.).  I would th
ink that it should go both ways.  
	Here is the Makefile:

############################################################################

# I tried both of the following ways:
VPATH = ../bin
#vpath %.o ../bin

CFLAGS = -g

objects = main.o prog1.o prog2.o prog3.o prog4.o

dum: $(objects)
	cc -o dum $(CFLAGS) $^

main.o: main.h

# end of Makefile
#############################################################################

Would you please have a look at this and let me know as soon as possible if this is a bug, or if for some reason that it is supposed to be this way?  If it is supposed to be this way, is there a way around it?

	Thank you very much.

			Bob Serr - bserr@andersen.com
Technical Details
Message-ID: <9207230018.AA13644@Andersen.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!andersen.UUCP!bserr

Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!andersen.UUCP!bserr
From: bserr@andersen.UUCP (Robert Serr  507-0429, 312)
Subject: GNU make version 3.62:  VPATH
Message-ID: <9207230018.AA13644@Andersen.COM>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Thu, 23 Jul 1992 00:18:53 GMT
Approved: bug-gnu-utils@prep.ai.mit.edu
Lines: 31