VirtualBox

Ignore:
Timestamp:
May 16, 2005 4:54:02 PM (20 years ago)
Author:
bird
Message:

Current make snaphot, 2005-05-16.

Location:
branches/GNU/src/gmake
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/gmake

    • Property svn:ignore
      •  

        old new  
        3434README.DOS
        3535README.W32
         36README.OS2
        3637aclocal.m4
        3738autom4te.cache
  • branches/GNU/src/gmake/tests/scripts/features/conditionals

    r153 r280  
    44$details = "Attempt various different flavors of GNU make conditionals.";
    55
    6 open(MAKEFILE,"> $makefile");
    7 
    8 # The Contents of the MAKEFILE ...
    9 
    10 print MAKEFILE <<'EOMAKE';
    11 objects = foo.obj
     6run_make_test('
    127arg1 = first
    138arg2 = second
     
    2318endif
    2419
    25 ifeq '$(arg2)' "$(arg5)"
     20ifeq \'$(arg2)\' "$(arg5)"
    2621        @echo arg2 equals arg5
    2722else
     
    2924endif
    3025
    31 ifneq '$(arg3)' '$(arg4)'
     26ifneq \'$(arg3)\' \'$(arg4)\'
    3227        @echo arg3 NOT equal arg4
    3328else
     
    4439else
    4540        @echo arg4 is NOT defined
    46 endif
    47 
    48 EOMAKE
    49 
    50 close(MAKEFILE);
    51 
    52 &run_make_with_options($makefile,"",&get_logfile,0);
    53 
    54 $answer = "arg1 NOT equal arg2
     41endif',
     42              '',
     43              'arg1 NOT equal arg2
    5544arg2 equals arg5
    5645arg3 NOT equal arg4
    5746variable is undefined
    58 arg4 is defined
    59 ";
    60 
    61 &compare_output($answer,&get_logfile(1));
     47arg4 is defined');
    6248
    6349
    6450# Test expansion of variables inside ifdef.
    6551
    66 $makefile2 = &get_tmpfile;
    67 
    68 open(MAKEFILE, "> $makefile2");
    69 
    70 print MAKEFILE <<'EOF';
    71 
     52run_make_test('
    7253foo = 1
    7354
     
    9374endif
    9475
    95 all:; @echo DEF=$(DEF) DEF2=$(DEF2) DEF3=$(DEF3)
     76all:; @echo DEF=$(DEF) DEF2=$(DEF2) DEF3=$(DEF3)',
     77              '',
     78              'DEF=yes DEF2=yes DEF3=yes');
    9679
    97 EOF
    9880
    99 close(MAKEFILE)
     81# Test all the different "else if..." constructs
    10082
    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));
     83run_make_test('
     84arg1 = first
     85arg2 = second
     86arg3 = third
     87arg4 = cc
     88arg5 = fifth
     89
     90result =
     91
     92ifeq ($(arg1),$(arg2))
     93  result += arg1 equals arg2
     94else ifeq \'$(arg2)\' "$(arg5)"
     95  result += arg2 equals arg5
     96else ifneq \'$(arg3)\' \'$(arg3)\'
     97  result += arg3 NOT equal arg4
     98else ifndef arg5
     99  result += variable is undefined
     100else ifdef undefined
     101  result += arg4 is defined
     102else
     103  result += success
     104endif
     105
     106
     107all: ; @echo $(result)',
     108              '',
     109              'success');
     110
     111
     112# Test some random "else if..." construct nesting
     113
     114run_make_test('
     115arg1 = first
     116arg2 = second
     117arg3 = third
     118arg4 = cc
     119arg5 = second
     120
     121ifeq ($(arg1),$(arg2))
     122  $(info failed 1)
     123else ifeq \'$(arg2)\' "$(arg2)"
     124  ifdef undefined
     125    $(info failed 2)
     126  else
     127    $(info success)
     128  endif
     129else ifneq \'$(arg3)\' \'$(arg3)\'
     130  $(info failed 3)
     131else ifdef arg5
     132  $(info failed 4)
     133else ifdef undefined
     134  $(info failed 5)
     135else
     136  $(info failed 6)
     137endif
     138
     139.PHONY: all
     140all: ; @:',
     141              '',
     142              'success');
    104143
    105144
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette