Calling python script in makefile run in Cygwin results in No Such File or Directory

Question:

I am executing a Makefile in CYGWIN on Windows. The rule in the makefile calls a python script in another directory and passes arguments.

Here is the rule in the makefile:

$(OUTDIR)/toolchain:
    $(NDK_PATH)/build/tools/make_standalone_toolchain.py  
        --api=24    
        --arch=arm64    
        --install-dir=$@    
        --verbose=2

The output when I run the makefile in Cygwin I get the following error:

C:/Android/Sdk/ndk/25.1.8937393/build/tools/make_standalone_toolchain.py  
        --api=24    
        --arch=arm64    
        --install-dir=/c/Projects/master/thirdparty/builds/android-arm64-v8a-release/toolchain    
        --verbose=2
python3: can't open file '/c/Projects/master/thirdparty/C:/Android/Sdk/ndk/25.1.8937393/build/tools/make_standalone_toolchain.py': [Errno 2] No such file or directory
make: *** [target-config/android-arm64-v8a.mk:11: /c/Projects/master/thirdparty/builds/android-arm64-v8a-release/toolchain] Error 2

It seems to be combining the current working directory with the path that contains the python script and trying to run that, but of course this isn’t working. How do I fix this?

Asked By: Alexa Kirk

||

Answers:

Try the conversion to cygwin path :

$(OUTDIR)/toolchain:
    $$(cygpath $(NDK_PATH)/build/tools/make_standalone_toolchain.py)  
        --api=24    
        --arch=arm64    
        --install-dir=$@    
        --verbose=2
Answered By: Philippe
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.