How to run a Python script in Makefile

view story

http://unix.stackexchange.com – I want to write a Makefile to find specific files and run a Python script on each file. The Python script accepts sys.stdin input. find $(W)/$(OVE) -name "*.xml" -print | \ while read x ; do \ cat $x | /opt/exp/bin/python2.7 process_results.py > $(W)/$(OVE)/$(dirname $x)_$(basename $x).xml \ done The output is $(dirname $x)_$(basename $x).xml file which is an empty _.xml file. When I run this command on command line, it works properly but in Makefile it doesn't work. Can you help me what is wrong with this command? (HowTos)