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

makefile if/then/else



  Can someone give me an example of how to do if/then/else in a makefile?  I
followed the example in the make info page, but it doesn't seem to work for
me.

  Here's what I tried (for mpg123, if that matters)

ARCH=$(shell dpkg --print-gnu-build-architecture)

build:
	ifeq ($(ARCH),i486)
		make linux
	else
		make linux-$(ARCH)
	endif
	touch build

  .. and I get the error:

/bin/sh: -c: line 1: syntax error near unexpected token `(i486,i386)'
/bin/sh: -c: line 1: `ifeq (i486,i386)'
make: *** [build] Error 2

  Why does make pass the ifeq line to a shell?

-- 
Paul Haggart - Spencerville, Ontario, Canada - Debian Linux - PGP 0xD61313E9
"Well, it all started the day before today.  I remember it just like
 it was yesterday." - The Moleman, from Sam & Max Hit The Road


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: