Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
makefile OR operation in ifeq
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Rhiakath
Guru
Guru


Joined: 10 Feb 2006
Posts: 572
Location: Hell...

PostPosted: Fri Nov 30, 2012 2:00 pm    Post subject: makefile OR operation in ifeq Reply with quote

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...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum