[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Pattern rules and absolute paths on prerequisite patterns
From: |
King Dale (TTE) |
Subject: |
Pattern rules and absolute paths on prerequisite patterns |
Date: |
Thu, 8 Sep 2005 13:45:07 -0500 |
Put this Makefile into your home directory (the ~directory):
objdir := ~/foo/obj
imagedir := ~/foo/images
.PHONY: all
all: $(imagedir)/foobar.out
$(objdir) $(imagedir):
@mkdir -p $@
$(objdir)/foo.obj : Makefile | $(objdir)
cp $< $@
$(imagedir)/%bar.out: $(objdir)/%.obj | $(imagedir)
cp $< $@
Cd to the ~ directory and run make. You will get an error about no rule to make
the foobar.out file.
Edit the makefile so objdir does not contain the "~/". Run make on this version
and it will build correctly.
Somehow absolute paths in pattern rules are treated specially.
I want to work in absolute paths only so using relative paths is not an option
for me.
For the record this is both with the Cygwin version of gnu make and with make
3.80 on Linux.
- Pattern rules and absolute paths on prerequisite patterns,
King Dale (TTE) <=