make: multiple dependency lines and ..

Hans Buurman hans at duttnph.tudelft.nl
Thu Jul 6 20:07:57 AEST 1989


I am sure somebody will point out if I am mistaken, but...

There seems to something strange with the way make deals with multiple
dependency lines. They will not work properly when the directory .. is
at the head of the target's path.

Repeat by:

make the following file tree:

	.
        |
   -----------------
   |        |      |
Makefile   dir    dir2
	    |      |
	    |      ----------
	    |       |       |
	   foo    file1  Makefile

The Makefiles are listed below:

::::::::::::::
Makefile
::::::::::::::
dir/foo:
	touch dir2/file1 dir/foo

dir/foo: dir2/file1

::::::::::::::
dir2/Makefile
::::::::::::::
../dir/foo:
	touch file1 ../dir/foo

../dir/foo: file1


The following is output from a Sun 4/280 running SunOs 4.0.1. The bug
reproduces on a Sun3/60 running 4.0.1, a Sun 3/60 running 3.5, and a
Vax running Ultrix V2.2. Note that at 68, the touch command is not
executed, while at 73 it is.

hans64> ls
Makefile  dir       dir2
hans65> cd dir2
/home/duttnph/ph/hans/tmp/dir2
hans66> ls
Makefile  file1
hans67> ls ../dir 
hans68> make -d
MAKEFLAGS value: 
  Building ../dir/foo because it is out of date relative to file1
hans69> cat Makefile
../dir/foo:
        touch file1 ../dir/foo

../dir/foo: file1
hans70> !ls
ls ../dir
hans71> cd ..
/home/duttnph/ph/hans/tmp
hans72> cat Makefile
dir/foo:
        touch dir2/file1 dir/foo

dir/foo: dir2/file1
hans73> make -d
MAKEFLAGS value: 
  Building dir/foo because it is out of date relative to dir2/file1
touch dir2/file1 dir/foo
hans74> ls dir
foo
hans75> 


I don't have any sources at my disposal so I cannot say anything about
a fix. A workaround is to use a symbolic link to the directory where
you want the target to go.

-----------------------------------------------------------------------------
Hans Buurman                   | hans at duttnph.tudelft.nl
Pattern Recognition Group      | hans at duttnph.UUCP
Faculty of Applied Physics     | mcvax!hp4nl!dutrun!duttnph!hans
Delft University of Technology | tel. 31 - (0) 15 - 78 46 94



More information about the Comp.bugs.4bsd.ucb-fixes mailing list