2013-11-15 2 views
0

환경 변수를 설정해야한다는 것을 사용자에게 알려야합니다.Makefile에서 변수 이름을 인쇄하는 방법은 무엇입니까?

target: dependency 
    @if test ! -f $(FILE) ; then\ 
     echo Vitally needed $(FILE) is missed. ;\ 
     echo You can change the path to the file by setting $(get_var_name $(FILE)) environment variable.;\ 
    fi 

따라서, 사용자는 다음과 같은 출력을 볼 것입니다 수 있도록 (기능) ... 난 $ (get_var_name라고 한 것을 확인) $ (FILE)의 이름을 얻을 수있는 방법은 무엇입니까? 그래서 같이

Vitally needed very.very.important.file is missed. 
You can change the path to the file by setting FILE environment variable. 

답변

0

:

target: dependency 
    @if test ! -f $(FILE) ; then\ 
     echo Vitally needed $(FILE) is missed. ;\ 
     echo You can change the path to the file by setting FILE environment variable.;\ 
    fi 

File 변수의 이름이 FILE이기 때문에.

+0

그리고 변수 이름을 변경하면 어떻게 될까요? – krokoziabla

+0

@krokoziabla 변수의 이름을 변경하면 변수를 사용하는 모든 장소에서 이름을 변경해야합니다. 이것은 다르지 않다. –

+0

사실. 어제 파티가 있었어. :-) 감사 – krokoziabla

관련 문제