Makefile always running target

后端 未结 2 752
梦如初夏
梦如初夏 2021-01-13 04:18

I may miss something very obvious with this Makefile:

convert: devel/bar
  touch convert

init: devel/foo
  echo \'init\'

devel/foo:
  mkdir -p devel
  touc         


        
相关标签:
2条回答
  • 2021-01-13 04:46

    There probably is no file named init? So it tries to update devel/bar (since it depends on init).

    Consider using .PHONY

    0 讨论(0)
  • 2021-01-13 04:56

    You're not creating a file called init, so init is always out-of-date. Therefore everything that depends on it is always out-of-date.

    0 讨论(0)
提交回复
热议问题