[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ifeq in an if statement



On Sun, Jan 27, 2008 at 01:20:45AM +0100, Laszlo Boszormenyi wrote:
> If I add findstring like:
>         @if [ -f $(GRADM_PAM) ] ; then \
>                 echo "Installing gradm_pam..." ; \
>                 $(INSTALL) -m 4755 $(GRADM_PAM) $(DESTDIR)/sbin ; \
> ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
>                 $(STRIP) $(DESTDIR)/sbin/$(GRADM_PAM) ; \
> endif
>         fi
> I get:
> /bin/sh: -c: line 3: syntax error near unexpected token `,'
> /bin/sh: -c: line 3: `ifeq (,)'
> make[1]: *** [install] Error 2
> 
> What do I miss?

If a backslash appears just before a newline, both will be ignored.
This is a very nice, but it also means your ifeq statement doesn't start
at the beginning of a line, and it is therefore not parsed by make.  As
you can see from the error message, it's sh, not make, which is
complaining about not understanding the ifeq, which makes sense.

The other suggestion to set STRIP to true is probably a nice solution
for your problem.  If you really want to use ifeq, you'll need to put
the entire logical line in it (the whole block, until the line without a
\ at the end), and use an else with the same block plus the STRIP line.

Thanks,
Bas

-- 
I encourage people to send encrypted e-mail (see http://www.gnupg.org).
If you have problems reading my e-mail, use a better reader.
Please send the central message of e-mails as plain text
   in the message body, not as HTML and definitely not as MS Word.
Please do not use the MS Word format for attachments either.
For more information, see http://pcbcn10.phys.rug.nl/e-mail.html

Attachment: signature.asc
Description: Digital signature


Reply to: