Makefile dependencies don't work for phony target

后端 未结 4 1510
孤城傲影
孤城傲影 2020-12-31 02:29

Here is a reduced version of my Makefile:

.PHONY: all 

all: src/server.coffee
  mkdir -p bin
  ./node_modules/.bin/coffee -c -o bin src/server.coffee
         


        
4条回答
  •  暖寄归人
    2020-12-31 03:05

    According to the Make documentation:

    The prerequisites of the special target .PHONY are considered
    to be phony targets. When it is time to consider such a target, 
    make will run its recipe unconditionally, regardless of whether 
    a file with that name exists or what its last-modification time is.
    

    http://www.gnu.org/software/make/manual/html_node/Special-Targets.html

    Make runs the recipe of PHONY targets unconditionally - prerequisites don't matter.

提交回复
热议问题