📄 patternrules
字号:
# -*-perl-*-$description = "Test pattern rules.";$details = "";use Cwd;$dir = cwd;$dir =~ s,.*/([^/]+)$,../$1,;# TEST #1: Make sure that multiple patterns where the same target# can be built are searched even if the first one fails# to match properly.#run_make_test('.PHONY: allall: case.1 case.2 case.3a: void# 1 - existing file%.1: void @exit 1%.1: #MAKEFILE# @exit 0# 2 - phony%.2: void @exit 1%.2: 2.phony @exit 0.PHONY: 2.phony# 3 - implicit-phony%.3: void @exit 1%.3: 3.implicit-phony @exit 03.implicit-phony:','','');# TEST #2: make sure files that are built via implicit rules are marked# as targets (Savannah bug #12202).#run_make_test('TARGETS := foo foo.out.PHONY: all foo.inall: $(TARGETS)%: %.in @echo $@%.out: % @echo $@foo.in: ; @:','','foofoo.out');# TEST #3: make sure intermidite files that also happened to be# prerequisites are not removed (Savannah bug #12267).#run_make_test('$(dir)/foo.o:$(dir)/foo.y: @echo $@%.c: %.y touch $@%.o: %.c @echo $@.PHONY: installinstall: $(dir)/foo.c',"dir=$dir","$dir/foo.ytouch $dir/foo.c$dir/foo.o");unlink("$dir/foo.c");# TEST #4: make sure precious flag is set properly for targets# that are built via implicit rules (Savannah bug #13218).#run_make_test('.DELETE_ON_ERROR:.PRECIOUS: %.bar%.bar:; @touch $@ && exit 1$(dir)/foo.bar:',"dir=$dir","#MAKE#: *** [$dir/foo.bar] Error 1",512);unlink("$dir/foo.bar");# TEST #5: make sure targets of a macthed implicit pattern rule never# never considered intermediate (Savannah bug #13022).#run_make_test('.PHONY: allall: foo.c foo.o%.h %.c: %.in touch $*.h touch $*.c%.o: %.c %.h echo $+ >$@%.o: %.c @echo wrong rulefoo.in: touch $@','','touch foo.intouch foo.htouch foo.cecho foo.c foo.h >foo.o');unlink('foo.in', 'foo.h', 'foo.c', 'foo.o');# This tells the test driver that the perl test script executed properly.1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -