Add the beginning of the .ONESHELL special feature.
[make.git] / tests / scripts / misc / general1
blob352fc6adac4c14b0be1907d9c51735dce520c246
1 #                                                                    -*-perl-*-
3 $description = "The following test creates a makefile to test the
4 simple functionality of make.  It mimics the
5 rebuilding of a product with dependencies.
6 It also tests the simple definition of VPATH.";
8 open(MAKEFILE,"> $makefile");
10 print MAKEFILE <<EOF;
11 VPATH = $workdir
12 edit:  main.o kbd.o commands.o display.o \\
13        insert.o
14 \t\@echo cc -o edit main.o kbd.o commands.o display.o \\
15                   insert.o
16 main.o : main.c defs.h
17 \t\@echo cc -c main.c
18 kbd.o : kbd.c defs.h command.h
19 \t\@echo cc -c kbd.c
20 commands.o : command.c defs.h command.h
21 \t\@echo cc -c commands.c
22 display.o : display.c defs.h buffer.h
23 \t\@echo cc -c display.c
24 insert.o : insert.c defs.h buffer.h
25 \t\@echo cc -c insert.c
26 EOF
28 close(MAKEFILE);
31 @files_to_touch = ("$workdir${pathsep}main.c","$workdir${pathsep}defs.h",
32                "$workdir${pathsep}kbd.c","$workdir${pathsep}command.h",
33                "$workdir${pathsep}commands.c","$workdir${pathsep}display.c",
34                "$workdir${pathsep}buffer.h","$workdir${pathsep}insert.c",
35                "$workdir${pathsep}command.c");
37 &touch(@files_to_touch);
39 &run_make_with_options($makefile,"",&get_logfile);
41 # Create the answer to what should be produced by this Makefile
42 $answer = "cc -c main.c\ncc -c kbd.c\ncc -c commands.c\ncc -c display.c
43 cc -c insert.c\ncc -o edit main.o kbd.o commands.o display.o insert.o\n";
45 # COMPARE RESULTS
47 if (&compare_output($answer,&get_logfile(1))) {
48   unlink @files_to_touch;