Escaping colons in filenames in a Makefile

后端 未结 6 1747
再見小時候
再見小時候 2020-12-03 20:59

Is there a way to get GNU make to work correctly with filenames that contain colons?

The specific problem I\'m running into happens to involve a pattern rule. Here\

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-03 21:39

    I am not positivie this should work, but the reason it says "missing destination file" is simple:

    %.bar: ; cp $< $@
    

    That line says to copy the target from the first dependency. your a:b.bar does not have any dependency, so the cp fails. what did you want it to copy ? a:b.foo ? in that case, you would need:

    %.bar: %.foo ; cp $< $@
    

提交回复
热议问题