⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 parallelism

📁 make debug tool. You can use this tool to debug Makefile
💻
字号:
#                                                                    -*-perl-*-$description = "Test parallelism (-j) option.";$details = "This test creates a makefile with two double-colon defaultrules.  The first rule has a series of sleep and echo commandsintended to run in series.  The second and third have just anecho statement.  When make is called in this test, it is giventhe -j option with a value of 4.  This tells make that it maystart up to four jobs simultaneously.  In this case, since thefirst command is a sleep command, the output of the secondand third commands will appear before the first if indeedmake is running all of these commands in parallel.";if (!$parallel_jobs) {  return -1;}if ($vos) {  $sleep_command = "sleep -seconds";}else {  $sleep_command = "sleep";}run_make_test("all : def_1 def_2 def_3def_1 : ; \@echo ONE; $sleep_command 3 ; echo TWOdef_2 : ; \@$sleep_command 2 ; echo THREEdef_3 : ; \@$sleep_command 1 ; echo FOUR",              '-j4', "ONE\nFOUR\nTHREE\nTWO");# Test parallelism with included files.  Here we sleep/echo while# building the included files, to test that they are being built in# parallel.run_make_test("all: 1 2; \@echo success-include 1.inc 2.inc1.inc: ; \@echo ONE.inc; $sleep_command 2; echo TWO.inc; echo '1: ; \@echo ONE; $sleep_command 2; echo TWO' > \$\@2.inc: ; \@$sleep_command 1; echo THREE.inc; echo '2: ; \@$sleep_command 1; echo THREE' > \$\@",              "-j4",              "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n");unlink('1.inc', '2.inc');# Test parallelism with included files--this time recurse first and make# sure the jobserver works.run_make_test("recurse: ; \@\$(MAKE) --no-print-directory -f #MAKEFILE# INC=yes allall: 1 2; \@echo successINC = noifeq (\$(INC),yes)-include 1.inc 2.incendif1.inc: ; \@echo ONE.inc; $sleep_command 2; echo TWO.inc; echo '1: ; \@echo ONE; $sleep_command 2; echo TWO' > \$\@2.inc: ; \@$sleep_command 1; echo THREE.inc; echo '2: ; \@$sleep_command 1; echo THREE' > \$\@",              "-j4",              "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n");unlink('1.inc', '2.inc');# Grant Taylor reports a problem where tokens can be lost (not written back# to the pipe when they should be): this happened when there is a $(shell ...)# function in an exported recursive variable.  I added some code to check# for this situation and print a message if it occurred.  This test used# to trigger this code when I added it but no longer does after the fix.run_make_test("export HI = \$(shell \$(\$\@.CMD))first.CMD = echo hisecond.CMD = $sleep_command 4; echo hi.PHONY: all first secondall: first secondfirst second: ; \@echo \$\@; $sleep_command 1; echo \$\@",              '-j2', "first\nfirst\nsecond\nsecond");# Michael Matz <matz@suse.de> reported a bug where if make is running in# parallel without -k and two jobs die in a row, but not too close to each# other, then make will quit without waiting for the rest of the jobs to die.run_make_test(".PHONY: all fail.1 fail.2 fail.3 okall: fail.1 ok fail.2 fail.3fail.1 fail.2 fail.3:	\@sleep \$(patsubst fail.%,%,\$\@)	\@echo Fail	\@exit 1ok:	\@sleep 4	\@echo Ok done",              '-rR -j5', 'Fail#MAKE#: *** [fail.1] Error 1#MAKE#: *** Waiting for unfinished jobs....#MAKE#: *** Waiting for unfinished jobs....Fail#MAKE#: *** Waiting for unfinished jobs....#MAKE#: *** [fail.2] Error 1#MAKE#: *** Waiting for unfinished jobs....#MAKE#: *** Waiting for unfinished jobs....Fail#MAKE#: *** Waiting for unfinished jobs....#MAKE#: *** [fail.3] Error 1#MAKE#: *** Waiting for unfinished jobs....#MAKE#: *** Waiting for unfinished jobs....Ok doneCommand-line arguments:	"-f work/features/parallelism.mk.4 -rR -j5"',             512);# Test for Savannah bug #15641.#run_make_test('.PHONY: allall:; @:-include foo.dfoo.d: comp	@echo building $@comp: mod_a.o mod_b.o; @:mod_a.o mod_b.o:	@exit 1', '-j2', '');1;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -