Rhiakath Guru
Joined: 10 Feb 2006 Posts: 572 Location: Hell...
|
Posted: Fri Nov 30, 2012 2:00 pm Post subject: makefile OR operation in ifeq |
|
|
Hi there.
I'm trying to do something like
Code: |
if ( architecture == arm ) OR ( user_target == arm )
ARCH=arm
CC = ...
CC_OPTS = ...
<yadda yadda yadda>
endif
if ( architecture == x86 ) OR ( user_target == x86 )
ARCH=x86
CC = ...
CC_OPTS = ...
<yadda yadda yadda>
endif
|
So far, i have it in this ( INCREDIBLY UGLY ) piece of makefile.
Code: |
# automatic architecture detection
ARCHITECTURE=x86
ifeq ($(shell uname -m),x86)
ARCHITECTURE=x86
endif
ifeq ($(shell uname -m),x86_64)
ARCHITECTURE=amd64
endif
ifeq ($(shell uname -m),armv5tejl)
ARCHITECTURE=arm
endif
# in case user specifies the architecture to compile to
ifeq ($(MAKECMDGOALS),arm)
ARCHITECTURE=arm
endif
ifeq ($(MAKECMDGOALS),x86)
ARCHITECTURE=x86
endif
ifeq ($(MAKECMDGOALS),x86_64)
ARCHITECTURE=x86_64
endif
MOC = moc
ifeq ($(ARCHITECTURE), x86)
CFLAGS += -m32
LDFLAGS += -m32
ARCH_SUFFIX = _x86
endif
ifeq ($(ARCHITECTURE), amd64)
CFLAGS += -m64
LDFLAGS += -m64
ARCH_SUFFIX = _amd64
endif
ifeq ($(ARCHITECTURE), arm)
ARCH_SUFFIX = _arm
CC = /usr/local/arm/gnuarm-3.4.3/bin/arm-linux-gcc
endif
|
So , basically i just wanted to join the 3 if's for each architecture in one single if.
Is it possible?
Thanks. _________________ pc-rhiakath ~ $ emerge -s happiness
Searching..
[ Results for search key : happiness ]
[ Applications found : 0 ]
-------------------------------------------
I see dead pixels... |
|