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