Search code examples
netbeansmakefilecygwin

cannot build: No rule to make target


I'm trying to transfer a working project from visual c to netbeans, which I just installed. However, it's not building. Below is the message.

    "/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/cygdrive/c/Users/sam/Documents/NetBeansProjects/timerDAC'
"/usr/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin_4.x-Windows/timerdac.exe
make[2]: Entering directory '/cygdrive/c/Users/sam/Documents/NetBeansProjects/timerDAC'



cygwin warning:
      MS-DOS style path detected: /cygdrive/D/timer DAC code/EOGTester/DaqInTesteing\(New\)Out.c
      Preferred POSIX equivalent is: /cygdrive/D/timer DAC code/EOGTester/DaqInTesteing/(New/)Out.c
      CYGWIN environment variable option "nodosfilewarning" turns off this warning.
      Consult the user's guide for more details about POSIX paths:
        http://cygwin.com/cygwin-ug-net/using.html#using-pathnames


make[2]: *** No rule to make target '/cygdrive/D/timer DAC code/EOGTester/DaqInTesteing\(New\)Out.c', needed by 'build/Debug/Cygwin_4.x-Windows/_ext/1013452424/DaqInTesteing_New_Out.o'.  Stop.
make[2]: Leaving directory '/cygdrive/c/Users/sam/Documents/NetBeansProjects/timerDAC'
nbproject/Makefile-Debug.mk:60: recipe for target '.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory '/cygdrive/c/Users/sam/Documents/NetBeansProjects/timerDAC'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make: *** [.build-impl] Error 2


BUILD FAILED (exit value 2, total time: 1s)

I read that the

No rule to make target

error is usually due to a spelling error. However, this is someone else's project I'm importing, and I have to clue how to find where the spelling error is?

Also, the cygwin warning is mystifying, where the "MS-DOS style path detected" and the "preferred POSIX equivalent" only differs by a "/" and a "\"?


Solution

  • First, you should never use pathnames that contain whitespace with make. Make simply doesn't support this in any real way. Rename your directory timer DAC code so it does not contain whitespace.

    Second, the backslashes here are SUPPOSED to be escaping the parentheses, so ignore that warning. Cygwin is assuming that you meant to use them as directory separators but you didn't.

    I'm not that familiar with the Cygwin port of make, but I believe that the backslashes are not being interpreted correctly. Personally if I were you I'd rename these files so they didn't contain any special characters at all, such as parenthesis.

    If you can't do that, then you should switch to quoting to escape them, rather than backslashes. So, change instances of DaqInTesteing\(New\)Out.c to 'DaqInTesteing(New)Out.c' (using single quotes around the word instead of backslashes to quote the special characters).

    I'm assuming that the odd spelling DaqInTesteing, rather than DaqInTesting, is intentional.

    If these things don't help we'll need to see the part of the makefile which is responsible for building these targets.