1999-09-14 02:03:19 +00:00
|
|
|
# -*-perl-*-
|
|
|
|
|
|
|
|
$description = "The following test creates a makefile to test the
|
|
|
|
simple functionality of make. It is the same as
|
|
|
|
general_test1 except that this one tests the
|
|
|
|
definition of a variable to hold the object filenames.";
|
|
|
|
|
|
|
|
open(MAKEFILE,"> $makefile");
|
|
|
|
|
|
|
|
# The contents of the Makefile ...
|
|
|
|
|
|
|
|
print MAKEFILE <<EOF;
|
2023-04-02 21:32:09 +00:00
|
|
|
VPATH = work
|
1999-09-14 02:03:19 +00:00
|
|
|
objects = main.o kbd.o commands.o display.o insert.o
|
|
|
|
edit: \$(objects)
|
|
|
|
\t\@echo cc -o edit \$(objects)
|
|
|
|
main.o : main.c defs.h
|
|
|
|
\t\@echo cc -c main.c
|
|
|
|
kbd.o : kbd.c defs.h command.h
|
|
|
|
\t\@echo cc -c kbd.c
|
|
|
|
commands.o : command.c defs.h command.h
|
|
|
|
\t\@echo cc -c commands.c
|
|
|
|
display.o : display.c defs.h buffer.h
|
|
|
|
\t\@echo cc -c display.c
|
|
|
|
insert.o : insert.c defs.h buffer.h
|
|
|
|
\t\@echo cc -c insert.c
|
|
|
|
EOF
|
|
|
|
|
|
|
|
close(MAKEFILE);
|
|
|
|
|
|
|
|
|
2023-04-02 21:32:09 +00:00
|
|
|
mkdir('work');
|
|
|
|
@files_to_touch = ("work${pathsep}main.c","work${pathsep}defs.h",
|
|
|
|
"work${pathsep}kbd.c","work${pathsep}command.h",
|
|
|
|
"work${pathsep}commands.c","work${pathsep}display.c",
|
|
|
|
"work${pathsep}buffer.h","work${pathsep}insert.c",
|
|
|
|
"work${pathsep}command.c");
|
1999-09-14 02:03:19 +00:00
|
|
|
|
|
|
|
&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
|
|
|
|
cc -c insert.c\ncc -o edit main.o kbd.o commands.o display.o insert.o\n";
|
|
|
|
|
|
|
|
if (&compare_output($answer,&get_logfile(1))) {
|
|
|
|
unlink @files_to_touch;
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|