bash completion of makefile target

前端 未结 6 2002
小蘑菇
小蘑菇 2021-01-31 01:59

Suppose I have a simple makefile like:

hello:
   echo \"hello world\"

bye:
   echo \"bye bye\"

Then in bash I want something like:

6条回答
  •  佛祖请我去吃肉
    2021-01-31 02:22

    This seems to be default in at least Debian Lenny:

    $ grep Makefile /etc/bash_completion
        # make reads `GNUmakefile', then `makefile', then `Makefile'
        elif [ -f ${makef_dir}/Makefile ]; then
            makef=${makef_dir}/Makefile
        # before we scan for targets, see if a Makefile name was
        # deal with included Makefiles
    

    The header of this file states:

    #   The latest version of this software can be obtained here:
    #
    #   http://bash-completion.alioth.debian.org/
    #
    #   RELEASE: 20080617.5
    

提交回复
热议问题