I think the following summarizes the problem.

Given the makefile:

.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 $(@)


Chaining doesn't work:


$ gmake -npqr | grep '\.mk:'
gmake: *** No rule to make target `/tmp/yapn/install/GNUaoeu.mk', needed by `all'.  
Stop.
/tmp/yapn/build/%.mk: /tmp/yapn/src/%.mk /tmp/yapn/build/.
/tmp/yapn/install/GNUaoeu.mk:
$ gmake
gmake: *** No rule to make target `/tmp/yapn/install/GNUaoeu.mk', needed by `all'.  
Stop.


It looks like the install pattern rule isn't even in the database. Can someone confirm this, please?


Thanks,
Noel

Noel Yap wrote:

Sorry, the subject should've read "pattern rules", not "implicit rules".

Noel

Noel Yap wrote:

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 [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/help-make



_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make



_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make



_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to