开发者

Is it possible to have case insensitive targets with GNU make?

Is it possible to design a makefile so that

make program_name

produces the same result as

make PROGRAM_NAME

?

I know I can do the following in the makefile

program_name : PROGRAM_NAME

but I don't know if there is a way to streamline this 开发者_StackOverflow中文版for multiple targets. We have about 50 or so targets.


Crude but effective:

PROGRAM_NAME:
    @echo do something for $@

ANOTHER_TARGET:
    @echo do something else for $@

YET_ANOTHER:
    @echo and something else for $@

% :
    @$(MAKE) `echo $@ | tr [:lower:] [:upper:]`
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜