help-make
[Top][All Lists]
Advanced

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

Make feature question


From: Marcus A Martin
Subject: Make feature question
Date: Fri, 16 Feb 2001 12:29:53 -0500

I have been redisigning my companies make system and recently ran into a
limitation. I believe there must be a better way and would appreciate it if
someone could help me out.

I frequesntly test a given macro for one of several values, then do a
different action depending of the value of the macro. In C\C++ I would use a
switch statement, in make I am force to a series of ifeq commands, as below.
Is there a better way?

#(from command line)
FOO == three

#(much later)
ifneq ($(FOO),)
 ifeq ($(FOO),one)
  FOO = 1
 else # FOO == one
  ifeq ($(FOO),two)
   FOO = 2
  else  # FOO == two
   if ($(FOO),three)
    FOO = 3
   else
    FOO = 4
  endif # FOO == two
 endif # FOO == one
endif # FOO != NULL




reply via email to

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