$description = "The following test creates a makefile to test the \n"
              ."simple functionality of make.  It is the same as \n"
              ."general_test1 except that this one tests the \n"
              ."definition of a variable to hold the object filenames.";

open(MAKEFILE,"> $makefile");

# The Contents of the MAKEFILE ...

print MAKEFILE "VPATH = $workdir\n";
print MAKEFILE "objects = main.o kbd.o commands.o display.o insert.o\n";
print MAKEFILE "edit:  \$(objects)\n";
print MAKEFILE "\t\@echo cc -o edit \$(objects)\n";
print MAKEFILE "main.o : main.c defs.h\n";
print MAKEFILE "\t\@echo cc -c main.c\n";
print MAKEFILE "kbd.o : kbd.c defs.h command.h\n";
print MAKEFILE "\t\@echo cc -c kbd.c\n";
print MAKEFILE "commands.o : command.c defs.h command.h\n";
print MAKEFILE "\t\@echo cc -c commands.c\n";
print MAKEFILE "display.o : display.c defs.h buffer.h\n";
print MAKEFILE "\t\@echo cc -c display.c\n";
print MAKEFILE "insert.o : insert.c defs.h buffer.h\n";
print MAKEFILE "\t\@echo cc -c insert.c\n";

# END of Contents of MAKEFILE

close(MAKEFILE);


@files_to_touch = ("$workdir${pathsep}main.c","$workdir${pathsep}defs.h",
               "$workdir${pathsep}kbd.c","$workdir${pathsep}command.h",
               "$workdir${pathsep}commands.c","$workdir${pathsep}display.c",
               "$workdir${pathsep}buffer.h","$workdir${pathsep}insert.c",
	       "$workdir${pathsep}command.c");

&touch(@files_to_touch);

&run_make_with_options($makefile,"",&get_logfile);

# Create the answer to what should be produced by this Makefile
$answer = "cc -c main.c\ncc -c kbd.c\ncc -c commands.c\ncc -c display.c\n";
$answer .= "cc -c insert.c\ncc -o edit main.o kbd.o commands.o display.o ";
$answer .= "insert.o\n";

if (&compare_output($answer,&get_logfile(1)))
{
  unlink @files_to_touch;
}

1;
