bug-make
[Top][All Lists]
Advanced

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

GNU make: Please give an example for the 'if' function (chapter 8 .5 of


From: Haeusler Reinhard
Subject: GNU make: Please give an example for the 'if' function (chapter 8 .5 of 'make.html')
Date: Tue, 23 Sep 2003 14:42:36 +0200

Dear GNU-Team,

please can you give an example for the usage of the 'if' function ("$(if condition,then-part[,else-part])", see chapter 8.5 of the document "make.html" for "GNU make Version 3.80").

I wanted to set a variable depending on another variable to different values.

The wanted statement should be:

VAR2 = $(if ??? $(VAR1), S1, s, $(if ??? $(VAR1), M, m))  # ??? means: don't know!

The alternate statement was:
ifeq "$VAR1" "S1"
  VAR2 = s
endif
ifeq "$VAR1" "M"
  VAR2 = m
endif

Possible a similar example should be inserted also in the document "make.html".

Many thanks and best regards,
Reinhard Häusler

Reinhard Häusler
Siemens PSE KB C 1
Mail: address@hidden


reply via email to

[Prev in Thread] Current Thread [Next in Thread]