Wednesday, 15 May 2013

Makefile .PHONY target does not work as expected -



Makefile .PHONY target does not work as expected -

i writing simple makefile practicing .phony target

#!/bin/make dir/%/compile: @echo "the target '$@ had been built'"

in working directory, directory layout below

├── dir │   └── subdir │   └── compile └── makefile

when type make dir/subdir/compile, claimed target date below

make: `dir/subdir/compile' date.

it's right. still claimed target date .phony target added below

#/bin/make .phony: dir/%/compile dir/%/compile: @echo "the target '$@ had been built'"

as know .phony can build target unconditionally no matter target exists or not however, seemed not works should be. help me figure out? thanks

you cannot utilize patterns .phony. true target names work. you're saying literal target named dir/%/compile phony.

makefile

No comments:

Post a Comment