3
$description = "The following test creates a makefile to test the
4
simple functionality of make. It is the same as
5
general_test1 except that this one tests the
6
definition of a variable to hold the object filenames.";
8
open(MAKEFILE,"> $makefile");
10
# The contents of the Makefile ...
14
objects = main.o kbd.o commands.o display.o insert.o
16
\t\@echo cc -o edit \$(objects)
17
main.o : main.c defs.h
19
kbd.o : kbd.c defs.h command.h
21
commands.o : command.c defs.h command.h
22
\t\@echo cc -c commands.c
23
display.o : display.c defs.h buffer.h
24
\t\@echo cc -c display.c
25
insert.o : insert.c defs.h buffer.h
26
\t\@echo cc -c insert.c
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");
38
&touch(@files_to_touch);
40
&run_make_with_options($makefile,"",&get_logfile);
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
44
cc -c insert.c\ncc -o edit main.o kbd.o commands.o display.o insert.o\n";
46
if (&compare_output($answer,&get_logfile(1))) {
47
unlink @files_to_touch;