Makefile: Passing command line arguments to file inside Makefile

后端 未结 2 2015
滥情空心
滥情空心 2021-02-04 16:23

Inside my Makfile I have the following,

smktestrun: smktest
    @../projects/test.sh

And I call this using:

Make smktestrun
<         


        
2条回答
  •  生来不讨喜
    2021-02-04 17:04

    You could define a variable in Makefile.

    smktestrun: smktest
        @../projects/test.sh ${ARG}
    

    Then the command line of make is:

    make smktestrun ARG="something"
    

提交回复
热议问题