2 $description = "Check GNU make conditionals.";
4 $details = "Attempt various different flavors of GNU make conditionals.";
6 open(MAKEFILE,"> $makefile");
8 # The Contents of the MAKEFILE ...
10 print MAKEFILE <<'EOMAKE';
19 ifeq ($(arg1),$(arg2))
20 @echo arg1 equals arg2
22 @echo arg1 NOT equal arg2
25 ifeq '$(arg2)' "$(arg5)"
26 @echo arg2 equals arg5
28 @echo arg2 NOT equal arg5
31 ifneq '$(arg3)' '$(arg4)'
32 @echo arg3 NOT equal arg4
38 @echo variable is undefined
40 @echo variable undefined is defined
45 @echo arg4 is NOT defined
52 &run_make_with_options($makefile,"",&get_logfile,0);
54 $answer = "arg1 NOT equal arg2
61 &compare_output($answer,&get_logfile(1));
64 # Test expansion of variables inside ifdef.
66 $makefile2 = &get_tmpfile;
68 open(MAKEFILE, "> $makefile2");
70 print MAKEFILE <<'EOF';
91 ifdef $(call FUNC,DEF)3
95 all:; @echo DEF=$(DEF) DEF2=$(DEF2) DEF3=$(DEF3)
101 &run_make_with_options($makefile2,"",&get_logfile,0);
102 $answer = "DEF=yes DEF2=yes DEF3=yes\n";
103 &compare_output($answer,&get_logfile(1));
106 # This tells the test driver that the perl test script executed properly.