Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!WHEATIES.AI.MIT.EDU!beareq!quants4!schorr From: beareq!quants4!schorr@WHEATIES.AI.MIT.EDU (Andrew Schorr) Newsgroups: gnu.utils.bug Subject: (none) Message-ID: <8903141351.AA29166@quants4> Date: 14 Mar 89 13:51:06 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 52 Roland, I am experiencing the following problem with version 3.39 of GNU Make (I have the same problem with version 3.25): Directory test contains Makefile, main.c, and the sub-directory sun3. Contents of Makefile: Depend: main.c touch $@ # in real life, touch would be replaced by a command to automatically # update the dependency file include Depend prog: main.o $(CC) -o $@ $^ I have the following alias defined: alias Make "make -C $ARCH -f ../Makefile 'VPATH=..' \!*" where the environment variable ARCH is set to sun3. With nothing in the sub-directory sun3, I enter: Make prog The output from make is: make: fopen: Depend: No such file or directory touch Depend make[1]: *** No way to make target `prog'. Stop. I don't understand why I get an error here. Now, without changing anything, I type Make prog again; I get: cc -c ../main.c -o main.o cc -o prog main.o Now, everything is as it should be. If I now touch main.c and enter Make prog again, I get: touch Depend make: `prog' is up to date. Typing Make prog once again, I get: cc -c ../main.c -o main.o cc -o prog main.o It appears that make correctly re-makes the included file Depend. However, when it re-execs itself, it seems unable to find the rules for making the target specified on the command line. I should note that everything works perfectly when the sub-directory is not utilized (i.e. performing the same commands with the alias Make replaced by the command make gives the expected/correct behavior). Thanks for your help, Andrew Schorr