Interesting, it looks like this has something to do with chaining:
.PHONY: all
all: /tmp/yapn/install/GNUaoeu.mk
/tmp/yapn/install/%.mk: /tmp/yapn/src/%.mk | /tmp/yapn/install/.
cp $(<) $(@)
.PRECIOUS: %/.
%/.:
mkdir -p $(@)
Here's the output:
$ gmake -npqr | grep GNUaoeu.mk
all: /tmp/yapn/install/GNUaoeu.mk
/tmp/yapn/install/GNUaoeu.mk: /tmp/yapn/src/GNUaoeu.mk |
/tmp/yapn/install/.
/tmp/yapn/src/GNUaoeu.mk:
$ gmake
mkdir -p /tmp/yapn/install/.
cp /tmp/yapn/src/GNUaoeu.mk /tmp/yapn/install/GNUaoeu.mk
I rechecked the docs and couldn't find anything that describes this,
along with the below, behaviour. Can someone confirm or deny that this
is a bug, please?
Thanks,
Noel
Noel Yap wrote:
The following makefile works perfectly:
.PHONY: all
all: ../install/GNUaoeu.mk
../install/%.mk: ../build/%.mk | ../install/.
cp $(<) $(@)
../build/%.mk: ../src/%.mk | ../build/.
cp $(<) $(@)
.PRECIOUS: %/.
%/.:
mkdir -p $(@)
It's output is:
$ gmake -npqr | grep GNUaoeu.mk
all: ../install/GNUaoeu.mk
../install/GNUaoeu.mk: ../build/GNUaoeu.mk | ../install/.
../build/GNUaoeu.mk: ../src/GNUaoeu.mk | ../build/.
../src/GNUaoeu.mk:
$ gmake
mkdir -p ../build/.
cp ../src/GNUaoeu.mk ../build/GNUaoeu.mk
mkdir -p ../install/.
cp ../build/GNUaoeu.mk ../install/GNUaoeu.mk
rm ../build/GNUaoeu.mk
But if I start using absolute paths, things stop working:
.PHONY: all
all: /tmp/yapn/install/GNUaoeu.mk
/tmp/yapn/install/%.mk: /tmp/yapn/build/%.mk | /tmp/yapn/install/.
cp $(<) $(@)
/tmp/yapn/build/%.mk: /tmp/yapn/src/%.mk | /tmp/yapn/build/.
cp $(<) $(@)
.PRECIOUS: %/.
%/.:
mkdir -p $(@)
$ gmake -npqr | grep GNUaoeu.mk
gmake: *** No rule to make target `/tmp/yapn/install/GNUaoeu.mk',
needed by `all'. Stop.
all: /tmp/yapn/install/GNUaoeu.mk
/tmp/yapn/install/GNUaoeu.mk:
$ gmake
gmake: *** No rule to make target `/tmp/yapn/install/GNUaoeu.mk',
needed by `all'. Stop.
IIRC, there's special treatment for targets that start with '/'. Can
someone point me to where in the docs it talks about this, please?
Thanks,
Noel
_______________________________________________
Help-make mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/help-make
_______________________________________________
Help-make mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/help-make