"Multiple Target Templates" Error Makefile

My makefile crashes with an error:

Makefile:34: *** multiple target patterns. Stop. 

What does this mean, how can I fix it?

( The GNU instruction written by Captain Obvious does not help).




Found. I had a rule in the form:

 $(FOO): bar 

where FOO was installed from a shell command that polluted it with a colon error message.

+55
makefile
Jan 20 '10 at
source share
5 answers

I had it on a makefile

 MAPS+=reverse/db.901:550:2001.ip6.arpa lastserial: ${MAPS} ./updateser ${MAPS} 

This is because of : in the file name. I solved it with

                       -------- notice
                      ///
                     vv
 MAPS + = reverse / db.901 \: 550 \: 2001.ip6.arpa
 lastserial: $ {MAPS}
     ./updateser $ {MAPS}
+41
Sep 14 '10 at 17:32
source share

Besides the need to avoid colons, as in the original answer, I found that the indentation is disabled, and you may get the same problem. In one makefile, I had to replace the spaces with a tab, and this allowed me to bypass the error.

+7
Feb 15 '13 at 17:51
source share

I just want to add if you get this error because you are using Cygwin make and the automatically generated files, you can fix it with the following sed,

 sed -e 's@\\\([^ ]\)@/\1@g' -e 's@[cC]:@/cygdrive/c@' -i filename.d 

You may need to add more characters than just a space in the list of exceptions in the first substitution, but you get this idea. The concept here is that / cygdrive / c is an alias for c: that cygwin make will recognize.

And can also throw

 -e 's@^ \+@\t@' 

just in case, when you started with spaces in the accident (although I / think / this will usually be a “missing separator” error).

+4
Sep 24 '13 at 17:28
source share

I met the same error. After the battle, I discovered that this was due to the "Space" in the folder name.

For example:

Previously my folder name: "Qt Projects"

Later I changed it to: "QtProjects"

and my problem was resolved.

This is a very simple but sometimes serious problem.

+2
Aug 31 '15 at 6:04
source share

I had this problem (colon in the target name) because I had -n in my GREP_OPTIONS environment GREP_OPTIONS . Apparently, this caused configure to create the Makefile incorrectly.

0
Sep 17 '14 at 17:14
source share



All Articles