I am searching for a way to get the output and the exit code of a command to variables in a makefile.
Basicly I want this: (bash)
output=$(whoami)
returnval=$?
echo "OUT:"
echo $output
echo "RET:"
echo $returnval
to be in a makefile
note: should work in a rule section
Thanks
EDIT: SOLVED
$(eval OUTPUT_RC="$(shell whoami;echo $$?)")
$(eval OUTPUT="$(shell echo $(OUTPUT_RC) | sed -e "s/^\(.*\)\(.\{2\}\)$$/\1/")")
$(eval RC="$(shell echo $(OUTPUT_RC) | sed -e "s/^.*\(.\)$$/\1/")")
echo $(OUTPUT)
echo $(RC)