• C

Nested If in Makefiles

Hi,
I want to add a nested if in my makefile. How can I do something like this?
This is the pseudo code below.

ifneq '$(MODE)' 'unix'
ifneq '$(MODE)' 'solaris'  && ifneq '$(MODE)' 'linux'

Do something there....

endif
endif

What is the best way to do this?

Thanks
Jamie
jamie_lynnAsked:
Who is Participating?
 
grg99Connect With a Mentor Commented:
try:


ifneq '$(MODE)' 'unix'
ifneq '$(MODE)' 'solaris'  
ifneq '$(MODE)' 'linux'
... do this if not unix and not solaris and not linux
endif
endif
endif


0
 
grg99Commented:
Depends on which "make" you're using.   All the "ifxxxx" commands are non-standard and they vary in syntax between makes.

0
 
jamie_lynnAuthor Commented:
I am using GNU make
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.