help-gnu-utils
[Top][All Lists]
Advanced

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

Why does this pattern rule fail?


From: YYTVQIKTXINE
Subject: Why does this pattern rule fail?
Date: 24 Jan 2005 08:43:29 -0800
User-agent: G2/0.2

Why does the following makefile fail to cause subdir1/file.o to be
made?
My understanding of how pattern rules were applied (from the info docs
for make) don't seem to explain why the implicit pattern rule isn't
applied.

Note that the makefile example below if fully self-contained and can be
run without any other files pre-existing. Note also that the VPATH and
vpath setting were only added out of desperate attempts to get it to
work.
Note further that I used the one-line form for commands to eliminate
tab dependencies for cut-and-paste.

Many thanks for your insights.

------------ Cut here -----------
all: subdir1/file.o

VPATH = subdir2
vpath %.c subdir2

subdir1/file.o: subdir2/file.c

subdir2/file.c: | subdir1 subdir2 ; touch $@

subdir1 subdir2: ; mkdir $@

%.o: %.c ; echo "Made from $<" >@
clean: ; rm -fr subdir[12]
------------ Cut here -----------


reply via email to

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