Xcopy doesn't work when in makefile

I ran into an error [copyResources] Error 4

when trying to create a project that I downloaded on a 64-bit installation of Windows 7. In the Makefile Qt is generated, it contains the following two lines:

copyResources:
    xcopy "D:\Downloads\GraphViz\GraphViz\res" "D:\Downloads\GraphViz\build-GraphViz-Desktop_Qt_5_3_MinGW_32bit-Debug" /e /y 

      

Make failed to achieve this target with an error Invalid number of parameters

. I originally assumed the command was wrong, but if I run it on the command line, it works fine. Even a stranger if I copy and paste this exact command in xcopycall.bat

and change the Makefile to the following

copyResources:
    xcopycall

      

then everything works fine. Going to /

doesn't help, so it's not an escaping issue. Why run it from a batch file and not a Makefile to fix this?

+3


source to share





All Articles