📄 dash-k
字号:
# -*-perl-*-$description = "Test the make -k (don't stop on error) option.\n";$details = "\The makefile created in this test is a simulation of buildinga small product. However, the trick to this one is that oneof the dependencies of the main target does not exist.Without the -k option, make would fail immediately and notbuild any part of the target. What we are looking for here,is that make builds the rest of the dependencies even thoughit knows that at the end it will fail to rebuild the main target.";open(MAKEFILE,"> $makefile");# The Contents of the MAKEFILE ...print MAKEFILE <<EOF;VPATH = $workdiredit: main.o kbd.o commands.o display.o\t\@echo cc -o edit main.o kbd.o commands.o display.omain.o : main.c defs.h\t\@echo cc -c main.ckbd.o : kbd.c defs.h command.h\t\@echo cc -c kbd.ccommands.o : command.c defs.h command.h\t\@echo cc -c commands.cdisplay.o : display.c defs.h buffer.h\t\@echo cc -c display.cEOF# END of Contents of MAKEFILEclose(MAKEFILE);@files_to_touch = ("$workdir${pathsep}main.c","$workdir${pathsep}defs.h", "$workdir${pathsep}command.h", "$workdir${pathsep}commands.c","$workdir${pathsep}display.c", "$workdir${pathsep}buffer.h", "$workdir${pathsep}command.c");&touch(@files_to_touch);if ($vos) { $error_code = 3307;}else { $error_code = 512;}&run_make_with_options($makefile, "-k --basename-filenames", &get_logfile, $error_code);# Create the answer to what should be produced by this Makefile$answer = "cc -c main.c$make_name: *** No rule to make target `kbd.c', needed by `kbd.o'.cc -c commands.ccc -c display.c$make_name: Target `edit' not remade because of errors.Command-line arguments: \"-f work/options/dash-k.mk -k --basename-filenames\"";# COMPARE RESULTS&compare_output($answer, &get_logfile(1));unlink(@files_to_touch) unless $keep;# TEST 1: Make sure that top-level targets that depend on targets that# previously failed to build, aren't attempted. Regression for PR/1634.$makefile2 = &get_tmpfile;open(MAKEFILE, "> $makefile2");print MAKEFILE <<'EOF';.SUFFIXES:all: exe1 exe2; @echo making $@exe1 exe2: lib; @echo cp $^ $@lib: foo.o; @echo cp $^ $@foo.o: ; exit 1EOFclose(MAKEFILE);&run_make_with_options($makefile2, "-k --basename-filenames", &get_logfile, $error_code);$answer = "exit 1work/options/dash-k.mk.1:9: *** [foo.o] Error 1#0 foo.o at work/options/dash-k.mk.1:9#1 lib at work/options/dash-k.mk.1:7#2 exe1 at work/options/dash-k.mk.1:5#3 all at work/options/dash-k.mk.1:3$make_name: Target `all' not remade because of errors.Command-line arguments: \"-f work/options/dash-k.mk.1 -k --basename-filenames\"";&compare_output($answer, &get_logfile(1));1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -