38

I got this error while (re)building, using cygwin make.exe version :3.81.

Error : *** target pattern contains no `%'.
Blorgbeard
  • 101,031
  • 48
  • 228
  • 272
Reno
  • 33,594
  • 11
  • 89
  • 102

11 Answers11

41

This error is due to a presence of a ":". Therefore it no longer supports windows paths. You need to download version 3.80 and replace the make.exe in the \bin directory.

Apparently it needs cygintl12.dll too.

Reno
  • 33,594
  • 11
  • 89
  • 102
  • +1: I came to this error from a different starting point (trying to compile using cmake & make 3.81 on Ubuntu). But your answer helped my nevertheless... The name of the parent of my build directory contained a ':'. After reading your answer I renamed it...assuming this somehow causes trouble in make...and it worked! – mmmmmmmm Feb 12 '13 at 08:35
  • Changing the environment variable paths to unix compatible paths worked for me. I found the following links helpful: https://www.gnu.org/software/make/manual/html_node/Error-Messages.html https://www.gnu.org/software/make/manual/html_node/Static-Usage.html#Static-Usage – Luis Nov 13 '14 at 17:54
  • 1
    @Leco - can you please add your solution as a separate answer? (with more details) – Reno Nov 14 '14 at 06:25
  • @Reno Sure thing. Give me a few days or so and I'll add it. – Luis Nov 14 '14 at 14:38
27
  • rollback to make 3.80 (Geant4)

    • cd /usr/bin
    • mv make.exe make_381.exe
    • wget http://geant4.cern.ch/support/extras/cygwin/make.exe
    • chmod +x make.exe
  • install libintl2 from cygwin setup for the required cygintl-2.dll

papahabla
  • 1,448
  • 18
  • 18
10

I got the same error when trying to build a project on Linux or OSX, that was previously built on a Windows machine and had some .o.d files hanging around in the output folder.

Once I manually deleted the .o.d files the problem was resolved. Apparently the "Clean" command of my IDE (CodeLite in this case) wasn't deleting the .o.d files.

Todd Sjolander
  • 1,459
  • 1
  • 15
  • 28
Hristo Pavlov
  • 101
  • 1
  • 2
  • totally saved me. I had my code running fine on Windows but not on OSX. After deleting files my idk-build clean command worked and after that idk-build also worked. – revolutionary Nov 29 '16 at 00:34
5

Most likely due to the presence of a colon following a drive letter. For example consider

build : $(NativeHeaders)/*

If

NativeHeaders=../../../cpp/generated

then all is well, but

NativeHeaders=C:/dev/folder/cpp/generated

results in the error that you get.

Bathsheba
  • 231,907
  • 34
  • 361
  • 483
4

I was getting this error because I didn't have a Tab (\t) character at the beginning of my commands. I had expandtab in my vim set so it was replacing a tab character with 4 spaces. When I turned that off and changed spaces to a tab it was fixed

Reza S
  • 9,480
  • 3
  • 54
  • 84
2

I had the target pattern contains no '%' error while building with the Android NDK using cygwin.

I found the following link helpful:

Errors Generated by Make

  • ‘missing target pattern. Stop.’
  • ‘multiple target patterns. Stop.’
  • ‘target pattern contains no `%'. Stop.’
  • ‘mixed implicit and static pattern rules. Stop.’

These are generated for malformed static pattern rules. The first means there’s no pattern in the target section of the rule; the second means there are multiple patterns in the target section; the third means the target doesn’t contain a pattern character (%); and the fourth means that all three parts of the static pattern rule contain pattern characters (%)–only the first two parts should. If you see these errors and you aren’t trying to create a static pattern rule, check the value of any variables in your target and prerequisite lists to be sure they do not contain colons. See Syntax of Static Pattern Rules.

And so, my solution included changing my system variables from Windows format to Unix format like so:

  • Instead of C:\Android\android-ndk-r10c, I used /cygdrive/c/Android/android-ndk-r10c for the NDK path.

Similarly, I changed the NDK project path to /cygdrive/c/Android/project/src/main/jni.

Luis
  • 3,451
  • 1
  • 27
  • 41
  • So you didn't figure out how to fix the paths used by make itself? This issue also occurs when make builds a list of files, and it appears that list of files is not fixed to be usable in a target. – smaudet Jun 20 '17 at 08:07
1

In my case I was using CMake under Cygwin when I got this error. It turned out the Windows version of CMake was executed. Subsequently, Windows paths were used in the make file. I installed Cygwin's version of CMake through the setup program and got it working.

Tsjakka
  • 71
  • 7
1

I had this problem on Linux when the build directory contained a ":" caused by doing a mercurial checkout which created a directory named "server:port".

paulm
  • 5,629
  • 7
  • 47
  • 70
0

I had to change the following in my make file to be compatible with Make_381:
before:
ARDUINO_BASE_DIR = C:\programs/arduino

now:
ARDUINO_BASE_DIR = \\programs/arduino

Gulzt
  • 132
  • 2
  • 9
0

Try this if you're running Eclipse C/C++ and referencing files from Cygwin under Windows, make sure c:/cygwin/bin or c:/cygwin64/bin comes after your preferred compiler tools in your Windows Path environment.

Example: Path = ;C:\yagarto\bin;C:\yagarto-tools\bin;C:\cygwin64\bin;

After making the changes, exit Eclipse and restart for it to take effect (simply restarting Eclipse without exiting won't fix the problem.

0

In my project, obj folder was probably corrupted and I was getting this error. Manually deleted obj folder. Then ndk-build completed fine.

Roy
  • 673
  • 11
  • 21