2 $description = "Check GNU make conditionals.";
4 $details = "Attempt various different flavors of GNU make conditionals.";
14 ifeq ($(arg1),$(arg2))
15 @echo arg1 equals arg2
17 @echo arg1 NOT equal arg2
20 ifeq \'$(arg2)\' "$(arg5)"
21 @echo arg2 equals arg5
23 @echo arg2 NOT equal arg5
26 ifneq \'$(arg3)\' \'$(arg4)\'
27 @echo arg3 NOT equal arg4
33 @echo variable is undefined
35 @echo variable undefined is defined
40 @echo arg4 is NOT defined
50 # Test expansion of variables inside ifdef.
72 ifdef $(call FUNC,DEF)3
76 all:; @echo DEF=$(DEF) DEF2=$(DEF2) DEF3=$(DEF3)',
78 'DEF=yes DEF2=yes DEF3=yes');
81 # Test all the different "else if..." constructs
92 ifeq ($(arg1),$(arg2))
93 result += arg1 equals arg2
94 else ifeq \'$(arg2)\' "$(arg5)"
95 result += arg2 equals arg5
96 else ifneq \'$(arg3)\' \'$(arg3)\'
97 result += arg3 NOT equal arg4
99 result += variable is undefined
101 result += arg4 is defined
107 all: ; @echo $(result)',
112 # Test some random "else if..." construct nesting
121 ifeq ($(arg1),$(arg2))
123 else ifeq \'$(arg2)\' "$(arg2)"
129 else ifneq \'$(arg3)\' \'$(arg3)\'
145 # This tells the test driver that the perl test script executed properly.