in a makefile, declaring a phony target as a wildcard

后端 未结 1 1503
夕颜
夕颜 2021-01-24 23:42

I want to declare my wildcard target as phony, but phony doesn\'t support wildcards:

My makefile:

%.config:
        gcc <>


        
相关标签:
1条回答
  • 2021-01-25 00:06

    These are conflicting aims. A phony target is one that doesn't correspond to a real file. In your case, the file exists, but it's not really a target.

    I would suggest not using the name of the config file as the target. Instead, construct a system based on one of the following:

    make something_else
    make CONFIG=something_else.config
    
    0 讨论(0)
提交回复
热议问题