LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   writing else if condition in makefile (https://www.linuxquestions.org/questions/linux-newbie-8/writing-else-if-condition-in-makefile-796283/)

luvpriya777 03-18-2010 09:56 AM

writing else if condition in makefile
 
I need to write an else-if condition in a makefile, and though the format is posted on several websites, nothing seem to be working, andI get an error everytime. Could anybody please write a small example with an else-if conditional in a maekefile?

Zuulie 03-18-2010 11:50 AM

Yes, at least one syntax was broken in make (GNU Make 3.81). The conditional ifeq (et al) seems to work OK:
Code:

TEST=NoProbbs

all : Makefile
ifeq ($(TEST),NoProbbs)
        STATUS=OK
else
        STATUS=NOTOK
endif

There are more details here:
http://theory.uwinnipeg.ca/localfile..._72.html#SEC71


All times are GMT -5. The time now is 12:59 PM.