0

I want to have a if condition in GNUmakefile with logical && operator.

Eg:-

    TEST:=1
     LOG:=""
     ifeq ($(TEST) == 1 && $(LOG) == "")
       dosomething
     else
        ....
      endif

Can find something @ Makefile ifeq logical AND , it looks ugly way of concatenating the variable and checking the same.. Is there any other nicer way to have a if check for this ?

santosh
  • 421
  • 1
  • 6
  • 14
  • @melpomene, I have already gone through the link and also i mentioned above i the query that it wont answer my question. – santosh Aug 27 '19 at 06:18
  • Asking a new question just to receive the answer "No." seems like overkill. Voting to close as duplicate. – tripleee Aug 27 '19 at 06:24
  • If there are better answers, they should be added to the original question. If not, this question is pointless. – melpomene Aug 27 '19 at 06:32
  • If you have a sufficiently new version of GNU make you can use the `$(and ..)` function: https://www.gnu.org/software/make/manual/html_node/Conditional-Functions.html – MadScientist Aug 27 '19 at 19:16
  • But in this situation your issue is that you want to test if `LOG` is the empty string, which is "false" in make. Unfortunately there's no `$(not ...)` in make so you'll have to do a bit of boolean magic. – MadScientist Aug 27 '19 at 19:19

0 Answers0