[완료]makefile에서 shell스크립트 실행후 스크립트의 리턴값을 받고싶습니다.

mogin1의 이미지

makefile에서 shell스크립트 실행후 makefile상에서 스크립트의 리턴값을 받고싶습니다.
어떤식으로 해야하나요?
아래는 제가 작성한 예제코드입니다.

makefile내용
all:
@./test.sh

test.sh내용
#!/bin/sh
echo test^^
result=$(sed -n '/리비전/p' svninfo.txt | sed '/마지막 수정 리비전/d')
echo $result
여기서 $result의 내용을 makefile에 전달 하고 싶습니다.

ktd2004의 이미지

RESULT=`./test.sh`; \
echo $$RESULT
bushi의 이미지

RESULT = $(shell ./test.sh)
 
all:
      @echo $(RESULT)

get_revision_cmd = sed -n -e '/리비전/p' -e '/마지막 수정 리비전/d' $(1)
REV = $(shell $(call get_revision_cmd,svninfo.txt))
 
all:
      @echo $(REV)

SVNREV=$(shell svnversion)
 
all:
     @echo $(SVNREV)

OTL
mogin1의 이미지

두분 모두 감사드립니다.
SVNREV=$(shell svnversion)

all:
@echo $(SVNREV)
이거 대박 이네요.. ㅠㅠ 저걸몰라서 저리 복잡하게 했다니..