1*69606e3fSchristos# -*-perl-*- 2*69606e3fSchristos 3*69606e3fSchristos$description = "The following test creates a makefile to test the 4*69606e3fSchristossimple functionality of make. It is the same as 5*69606e3fSchristosgeneral_test1 except that this one tests the 6*69606e3fSchristosdefinition of a variable to hold the object filenames."; 7*69606e3fSchristos 8*69606e3fSchristosopen(MAKEFILE,"> $makefile"); 9*69606e3fSchristos 10*69606e3fSchristos# The contents of the Makefile ... 11*69606e3fSchristos 12*69606e3fSchristosprint MAKEFILE <<EOF; 13*69606e3fSchristosVPATH = $workdir 14*69606e3fSchristosobjects = main.o kbd.o commands.o display.o insert.o 15*69606e3fSchristosedit: \$(objects) 16*69606e3fSchristos\t\@echo cc -o edit \$(objects) 17*69606e3fSchristosmain.o : main.c defs.h 18*69606e3fSchristos\t\@echo cc -c main.c 19*69606e3fSchristoskbd.o : kbd.c defs.h command.h 20*69606e3fSchristos\t\@echo cc -c kbd.c 21*69606e3fSchristoscommands.o : command.c defs.h command.h 22*69606e3fSchristos\t\@echo cc -c commands.c 23*69606e3fSchristosdisplay.o : display.c defs.h buffer.h 24*69606e3fSchristos\t\@echo cc -c display.c 25*69606e3fSchristosinsert.o : insert.c defs.h buffer.h 26*69606e3fSchristos\t\@echo cc -c insert.c 27*69606e3fSchristosEOF 28*69606e3fSchristos 29*69606e3fSchristosclose(MAKEFILE); 30*69606e3fSchristos 31*69606e3fSchristos 32*69606e3fSchristos@files_to_touch = ("$workdir${pathsep}main.c","$workdir${pathsep}defs.h", 33*69606e3fSchristos "$workdir${pathsep}kbd.c","$workdir${pathsep}command.h", 34*69606e3fSchristos "$workdir${pathsep}commands.c","$workdir${pathsep}display.c", 35*69606e3fSchristos "$workdir${pathsep}buffer.h","$workdir${pathsep}insert.c", 36*69606e3fSchristos "$workdir${pathsep}command.c"); 37*69606e3fSchristos 38*69606e3fSchristos&touch(@files_to_touch); 39*69606e3fSchristos 40*69606e3fSchristos&run_make_with_options($makefile,"",&get_logfile); 41*69606e3fSchristos 42*69606e3fSchristos# Create the answer to what should be produced by this Makefile 43*69606e3fSchristos$answer = "cc -c main.c\ncc -c kbd.c\ncc -c commands.c\ncc -c display.c 44*69606e3fSchristoscc -c insert.c\ncc -o edit main.o kbd.o commands.o display.o insert.o\n"; 45*69606e3fSchristos 46*69606e3fSchristosif (&compare_output($answer,&get_logfile(1))) { 47*69606e3fSchristos unlink @files_to_touch; 48*69606e3fSchristos} 49*69606e3fSchristos 50*69606e3fSchristos1; 51