How to pass argument from Makefile to a program? [closed]
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 years ago . Improve this question I want to pass directory of Makefile to a function. For example: Makefile $(DIR) = makefile directory program int main(int argc,char argv[]) char directory = argv[1] How can I do that? EDIT Clarificaion. I want my app to work outside of the directory that i compiled it in. 回答1