help-make
[Top][All Lists]
Advanced

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

targets starting with '/'


From: Noel Yap
Subject: targets starting with '/'
Date: Tue, 27 Apr 2004 11:13:07 -0400
User-agent: Mozilla Thunderbird 0.5 (Windows/20040212)

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




reply via email to

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