특정 대상에 대해 makefile에서 foreach를 사용하고 있습니다. 이 의도makefile 대상의 foreach & silencer
my_Target:
$(foreach x,$(MY_TARGET_DIRS), @echo " BUILD $(x)";$(Q)$(MAKE) --directory=$(x) LIB_DIR=$(MY_LIB_DIR) $(MY_TARGET_RULES);)
는 문자열이 진행되고 구축하는 얘기 인쇄 된 후 메이크는, MY_TARGET_DIRS의 모든 지정된 디렉토리를 포함 호출합니다.
는 Q 변수는 다음과 같이 정의된다 :
# Silent per default, 'make V=1' shows all compiler calls.
ifneq ($(V),1)
Q := @
endif
따라서 V = 1로 정의 된 경우 make 명령이 장황된다. V = 1 출력 로그에 대한
이다 : 나는 V = 1을 정의하지 않는 경우
는, 출력 로그는make my_Target V=1
BUILD /dir1
make[1]: Entering directory `/dir1'
make[1]: Nothing to be done for `elf'.
make[1]: Nothing to be done for `bin'.
make[1]: Leaving directory `/dir1'
/bin/sh: @echo: command not found
make[1]: Entering directory `/dir2'
make[1]: Nothing to be done for `elf'.
make[1]: Nothing to be done for `bin'.
make[1]: Leaving directory `/dir2'
동안 :
make my_Target
BUILD /dir1
/bin/sh: @make: command not found
/bin/sh: @echo: command not found
/bin/sh: @make: command not found
make: *** [my_Target] Error 127
내가 원하는 동작을 얻을 수있는 방법 바르게?
안녕!
아주의'@는'메이크 구조 (안 떠들썩한 일), 그리고에있을 _must 조리법의 시작 _. 배쉬는 인식 할 수없는 상징에 질식하고있다. – HardcoreHenry
http://make.mad-scientist.net/managing-recipe-echoing/에서 에코 처리의 대체/더 나은 (?) 방법을 볼 수도 있습니다. – MadScientist