makepp-2.0.98.3/0000755000175000017500000000000012115460733013370 5ustar pfeifferpfeiffermakepp-2.0.98.3/t/0000755000175000017500000000000012115460733013633 5ustar pfeifferpfeiffermakepp-2.0.98.3/t/wildcard_repository.test0000644000175000017500000000534712002461416020627 0ustar pfeifferpfeiffer### SPAR ### 5 755 1067749983 1067749983 is_relevant.pl # # Test we're not root and if unpacking used our uid (nfs) and managed to chmod to a strange value. # my( $mode, $uid ) = (stat 'Makeppfile')[2, 4]; $> && $uid == $> && ($mode & 0777) == 0421; ### 17 421 1164350872 1058653868 Makeppfile # # Test ignoring files and directories which are not readable. # repository .=repository # Don't incorporate files which are # marked locally unreadable. $(phony all): list-of-files all_derived list-of-files: &echo $(wildcard subdirs/**/*) -o $@ %.derived: %: foreach ? &echo -n "derived from " -o $(output) &cat $(input) -o>>$(output) all_derived: *.derived &sed 's/^/$$ARGV /' $(inputs) -o $(output) ### 7 644 1067451880 1056845572 cleanup_script.pl # # This script is run after the test has been executed. # We reset the permissions on the directory we made unreadable, or else # it will be impossible to delete the directory. # chmod 0755, 'subdirs/s2'; chmod 0644, 'subdirs/s1/b', 'h'; ### 1 644 1067451880 1056547287 g main dir ### 0 0 1067451880 1056545590 h ### D 755 1067451880 1058653737 repository ### 1 644 1067451880 1056545548 repository/f repository ### 1 644 1067451880 1056545548 repository/g repository ### 1 644 1067451880 1056545548 repository/h repository ### D 755 1067451880 1058653737 repository/subdirs ### 1 644 1067451880 1056545548 repository/subdirs/d repository ### 1 644 1067451880 1056545548 repository/subdirs/e repository ### D 755 1067451880 1058653737 repository/subdirs/s1 ### 1 644 1067451880 1056545548 repository/subdirs/s1/a repository ### 1 644 1067451880 1056545548 repository/subdirs/s1/b repository ### D 755 1067451880 1058653737 repository/subdirs/s2 ### 1 644 1067451880 1056545548 repository/subdirs/s2/b repository ### 1 644 1067451880 1056545548 repository/subdirs/s2/c repository ### D 755 1067451880 1058653737 repository/subdirs/s3 ### 6 644 1067451880 1056842181 repository/subdirs/s3/makefile # # This makefile tests implicit loading makefiles from repositories when there # is no makefile in the main directory. # z: &touch $@ ### D 755 1067451880 1058653879 subdirs ### D 755 1067451880 1058653879 subdirs/s1 ### 0 0 1067451880 1056547542 subdirs/s1/b ### D 0 1067451880 1058653879 subdirs/s2 ### D 755 1067451880 1058653803 answers ### 1 644 1067451880 1058653801 answers/f.derived derived from repository ### 2 644 1164350177 1058653801 answers/all_derived f.derived derived from repository g.derived derived from main dir ### 1 644 1067451880 1056845682 answers/list-of-files subdirs/s1/a subdirs/d subdirs/e subdirs/s3/makefile subdirs/s1 subdirs/s3 subdirs/s3/z ### 1 644 1067451880 1190053959 answers/n_files 4 1 0 ### 1 644 1067451880 1058653801 answers/g.derived derived from main dir makepp-2.0.98.3/t/wait_timestamp.pl0000644000175000017500000000264211144124453017220 0ustar pfeifferpfeiffer# Wait till both the local clock and the timestamps of files are newer than # those of the given files. If no files are given, wait till the next second. sub wait_timestamp(@) { my $ts = 0; my $tmp; # Pick out the newest file. for( @_ ) { $tmp = (stat)[9]; $ts = $tmp if $tmp && $tmp > $ts; } # If none was given, default to now. $ts ||= time; my $hires = eval { require Time::HiRes }; # Wait until the next second starts, if we can. if( $hires ) { $tmp = Time::HiRes::time(); Time::HiRes::sleep( int( $tmp + 1 ) - $tmp ); # Just in case something got rounded down, go forward in tiny steps: Time::HiRes::sleep( .01 ) while $ts >= time; } else { # More expensive than sleep, but we waste little real time. select undef, undef, undef, .1 while $ts >= time; } # If this is a remote file system, timestamps may not yet have changed. # So recheck in .1 second steps. while() { open my $fh, ">wait_timestamp.$$"; # NOTE: Overwriting an existing empty file may not update its mod time, # so we also have to write to it. print $fh "x"; last if (stat $fh)[9] > $ts; if( $hires ) { Time::HiRes::sleep( .1 ); } else { select undef, undef, undef, .1; } } unlink "wait_timestamp.$$"; } # If called as a standalone program or pseudo-standalone from run(), call the # function. wait_timestamp( @ARGV ) if !caller or caller eq 'Mpp::Subs'; 1; makepp-2.0.98.3/t/verilog.test0000644000175000017500000000205711714051522016203 0ustar pfeifferpfeiffer### SPAR ### 23 644 1143572799 1208276444 Makeppfile fake_simv: in.vc : parser vcs_compilation -true -f $< # true inexistent on native Win &touch $@ in.vc: &echo 'in.v\n-y .\n-v in.vlib\n+libext+.v+' -fo $@ in.v: &echo "`include \"in.vh\"" -fo $@ &echo "module in;" -o >>$@ &echo "reg a;" -o >>$@ &echo "submod inst1(a);" -o >>$@ &echo "libmod inst2(a);" -o >>$@ &echo "endmodule" -o >>$@ submod.v: &echo 'module submod(a);\ninput a;\nendmodule' -o $@ in.vlib: &echo 'module libmod(a);\ninput a;\nendmodule' -o $@ in.vh: &echo "`define IN 1" -fo $@ ### D 755 1141170787 1141170770 answers ### 6 644 1141170733 1141170733 answers/in.v `include "in.vh" module in; reg a; submod inst1(a); libmod inst2(a); endmodule ### 4 644 1141170733 1141170733 answers/in.vc in.v -y . -v in.vlib +libext+.v+ ### 1 644 1141170733 1141170733 answers/in.vh `define IN 1 ### 3 644 1141170733 1141170733 answers/in.vlib module libmod(a); input a; endmodule ### 3 644 1141170770 1141170770 answers/submod.v module submod(a); input a; endmodule makepp-2.0.98.3/t/variables_automatic.test0000644000175000017500000000207011440263613020547 0ustar pfeifferpfeiffer### SPAR ### 28 644 1164353427 971566648 Makefile # # A test of all the automatic variables: # .PHONY: all all: a b %: subdir/% &cp $(inputs) $(outputs) $(foreach): : foreach c d &echo $@ -o $@ subdir/a subdir/b : d c c e &echo $@ $(@D) $(@F) -o $@ &echo $< $(>$@ &echo $^ $(^D) $(^F) -o>>$@ &cat $& $+ -o >>$@ &echo "$(outputs) : $(inputs)" -o>>subdir/b &echo "$(output 2) | $(outputs -1 1) : $(input -1) | $(inputs 2 1)" -o>>subdir/b %: subdir/%.x &echo $* $(*D) $(*F) -o $@ &cp $(dependencies) $(targets) subdir/e.x: &echo $@ -o $@ ### D 755 1067451880 971566798 subdir ### D 755 1067451880 965616562 answers ### 6 644 1067451880 965616517 answers/a subdir/a subdir a d . d d c c e . . . . d c c e c d subdir/e.x ### 2 644 1154465131 965616517 answers/b subdir/a subdir/b : d c c e subdir/b | subdir/b subdir/a : e | c d ### 1 644 1067451880 965616209 answers/c c ### 1 644 1067451880 965616034 answers/d d ### 1 644 1067451880 965616209 answers/e subdir/e.x ### 1 644 1067451880 1190053955 answers/n_files 8 1 0 makepp-2.0.98.3/t/variable_expansion.test0000644000175000017500000003106611721213707020412 0ustar pfeifferpfeiffer### SPAR ### 1 644 1151611756 1212336947 .makepprc over1=over1 over2=over2 over4=not4 'bar=not ok' ### 304 644 1171960619 1329839344 RootMakeppfile # # This makefile tests variable setting and expansion as completely as we can. # .PHONY: all targets := colon_equal_test patsubst_test rc_expansion shell_command \ misc_gnu_make_functions user_func question_equal_test rc_test \ filename_test define_test x y root_test global_test undef_test \ globalize/over_test map_test bracket_test Makepp ifeq $(mktemp) $(mktemp) or ifeq $(mktemp xy) $(mktemp xy) or ifeq $(mktemp xy.X) $(mktemp xy.X) or ifneq $(mktemp) $(mktemp /) or ifneq $(mktemp xy) $(mktemp /) or ifneq $(mktemp xy.X) $(mktemp /) targets += mktemp_error # This assignment is not supposed to take place endif all: $(targets) # # Check the difference between :=, ;= and regular variables, and test the # += and &= constructs. # V1P_NOCOLON = 0 V1P_COLON := 0 V12 = 1 V1_NOCOLON = $(V12) # Initially equal to 1, then finally equal to 2. V1P_NOCOLON += $(V12) V1P_NOCOLON &= $(V12) # Should expand to "2 0 2" at the end. V1P_COLON += $(V12) # Should expand to "0 1" at the end. V1_COLON := $(V12) V12 = 12 V1_COLON &= $(V12) # Should be equal to 12 1. V12 = 2 V2_COLON := $(V12) # Should be equal to 2. i = 5 V1_SEMICOLON ;= $(perl 10 + ++$i) V1_SEMICOLON += $(perl 100 + ++$i) V1_SEMICOLON &= $(perl ++$i . '$') # Should expand each of these once and remember. i = 0 colon_equal_test: &echo $(V1_NOCOLON) $(V2_NOCOLON) -o $@ &echo ${V1_COLON} $(V2_COLON) -o>>$@ &echo $(V1P_NOCOLON) $(V1P_COLON) -o>>$@ &echo $(V1_SEMICOLON) $(V1_SEMICOLON) $(V1_SEMICOLON) -o>>$@ X = 1 QUESEQ ?= 1 $(X) QUESEQ ?= 2 $(X) X = 2 question_equal_test: &echo $(QUESEQ) -o $@ # # Check the pattern substitution operator. # P = a.o b.o c.o d.o Q = ax.o ay.o az.o A := a absurd white space = ab patsubst_test: &echo $(patsubst %.o, %.c, $(P)) -o $@ &echo ${P:.o=.c} $(absurd white space) $(absurd white space:b=z) -o>>$@ &echo $(patsubst a%.o, b%.c, $(Q)) -o>>$@ ifeq $(&cut -d' ' -f0 .makepprc),over1=over1 # Builtin command as function &echo $(Q:$(A)%.o=$(X)%.c) : $(Q:a%=z) -o>>$@ endif # # Check RC-style expansion # MAYBE_EMPTY = GONE := a$( $(MAYBE_EMPTY))b MAYBE_EMPTY = 1 ONE := a$( $(MAYBE_EMPTY))b MAYBE_EMPTY = 2 3 TWO := a$( $(MAYBE_EMPTY))b rc_expansion: &echo "a$(P)b" -o $@ &echo z$(patsubst %.o, %.c, a$(P))y -o>>$@ &echo a$( b c d)e -o>>$@ &echo $(GONE) $(ONE) $(TWO) -o>>$@ # # Check running shell commands: # SHELLVAR != echo Percy Bryce Shell shell_command: ifperl Mpp::is_windows < 2 exec > $@; \ echo "$(shell echo she sells Bourne shells) "; \ echo $(shell echo by the C shore) '' else echo $(shell echo she sells Bourne shells) > $@ echo $(shell echo by the C shore) >> $@ endif &echo $(SHELLVAR) -o>>$@ # # Quick check on miscellaneous GNU-make style functions: # reverse = $(2) $1 map = $(foreach a,$2,$(call $1,$a)) one = $(1) $(2) $(3) two = $(call one,$(1),foo,$(2)) DEP_foo = bar baz quux DEP_baz = quux blarp rest = $(wordlist 2,$(words ${1}),${1}) tclose = $(if $1,$(firstword $1) \ $(call tclose,$(sort ${DEP_$(firstword $1)} $(call rest,$1)))) # The functions above are inspired by GNU make 3.81 testsuite. downcase = ${map $1, $_ = lc} mymap = $(if $2,$(call $1,$(firstword $2)) $(call $0,$1,$(call rest,$2))) surround = ">$1<" three = $$1 $$2 four = $(three) five = $(call three,foo,bar) six = $(call four,foo,bar) seven := $(three) misc_gnu_make_functions: makepp_simple_concatenation=1 misc_gnu_make_functions: &echo $(basename mydir.with.periods/version-1.0-module.c) \ $(basename subdir/xyz) -o $@ &echo $(notdir some/directories/here/file) -o>>$@ &echo $(addprefix a, b c d e) -o>>$@ &echo $(addsuffix a, b c d e) -o>>$@ &echo $(call reverse,bar,foo) -o>>$@ &echo $(call reverse,bar) -o>>$@ &echo $(call reverse,,foo) -o>>$@ &echo $(call reverse,bar,foo,baz) -o>>$@ &echo $(call map,surround,1 2 3 4 5) -o>>$@ &echo $(call mymap,surround,A B C D E) -o>>$@ &echo $(call mymap,downcase,ALL THESE WORDS ARE UPCASE) -o>>$@ &echo $(call tclose,foo) -o>>$@ &echo $(call two,bar,baz) -o>>$@ &echo $(call three,bar,baz) -o>>$@ &echo $(call four,bar,baz) -o>>$@ &echo $(call five,bar,baz) -o>>$@ &echo $(call six,bar,baz) -o>>$@ &echo $(call seven,bar,baz) -o>>$@ &echo $(dir abc/def/ghi file-without-dir) -o>>$@ &echo $(filter %.c %.s, foo.c bar.c baz.s ugh.h) -o>>$@ # Above test from GNU make docs. &echo $(filter-out main1.o main2.o,main1.o foo.o main2.o bar.o) -o>>$@ &echo $(findstring a,a b c) x$(findstring a,b c)y -o>>$@ &echo $(firstword word1 word2 word3) -o>>$@ &echo $(sort a b c a q v b) -o>>$@ &echo '"$(strip a b c )"' -o>>$@ &echo $(subst :, ,a:b:c) -o>>$@ &echo $(suffix src/foo.c src-1.0/bar.c hacks) -o>>$@ &echo $(word 2, foo bar baz) -o>>$@ &echo $(wordlist 2, 3, foo bar baz) -o>>$@ &echo $(words a b c) -o>>$@ &echo $(if , $(print echo generated error), b) $(if true, c, $(print echo generated error)) -o>>$@ # Above test checks for partial evaluation if the if operands. &echo $(foreach var, 1 2 3 4 5 6, number $(var)) -o>>$@ &echo $(join a b c, .o .c) -o>>$@ &echo $(origin RM) $(origin ^) $(origin I_hope_this_is_undefined) $(origin inputs) $(origin PATH) $(origin V12) -o>>$@ # # Test of rc-style substitution: # rc_test: rc_off/rc_off_test &echo prefix_$( a b c d)_suffix -o $@ &cat $^ -o>>$@ # # Test of relative and absolute filenames and multiline $(( )): # filename_test: &echo $(relative_filename rc_off/.././././test) -o $@ &echo $((relative_to a rc_off/Makeppfile, rc_off)) -o>>$@ # # Test of define: # define echo-lines &echo $@ -o $@ &echo This is the second line -o>>$@ endef # Check that appending with define puts a newline, but that a newline in # $(&command) gets turned into a space with deferred expansion. define echo-lines += &echo This is the third line -o>>$@ $(&echo '&echo transformed\nnewline -o>>$@') endef # Check override and that $(&command) preserves \n when expanded in define override define bar := &echo OK -o>>define_test $(&echo '&echo one line -o>>define_test\n&echo another line -o>>define_test') enddef define bar = should not get here enddef define_test: $(echo-lines) $(bar) # # User defined function: # sub f_my_func { return 'a'.&arg.'b'; } user_func: &echo $(my_func $(P)) -o $@ XX = $(Y) # Test the difference between := and Y = 1 # regular assignment for export. Z := $(Y) export XX Z YY := y export FOO1 := $(YY) var = FOO2 export $(var) = $(YY) export $(var:2=3) = y3 export $(subst 2,4, $(var)) = y4 YY = y2 x: ifperl Mpp::is_windows < 2 echo "$$FOO1 $$FOO2 $$FOO3 $$FOO4 $$XX $$Z " > $@ # Call external echo to test export. else echo %FOO1% %FOO2% %FOO3% %FOO4% %XX% %Z% > $@ endif root := $(ROOT) ROOT := bla root_test: rc_off/root_test &cp $(input) $(output) &echo $(root) $(ROOT) -o>>$@ LOCAL = A global G_0 = A global G_A1 = a $(LOCAL) global G_A2 := a $(LOCAL) load_makefile rc_off global_test: rc_off/global_test &echo $(G_A1) : $(G_A2) : $(G_B1) : $(G_B2) : $(G_C1) : $(G_C2) -o $@ &echo $(G_0) : $(G_LATE1) : $(G_LATE2) -o >>$@ # Test putting a conditional and a rule into a variable define bracket_rule = ifdef bracket_rule bracket_test: rc_off/bracket_test &cp $(input) $(output) &echo $[ a b]$[[ 1 2]] -o >>$(output) endif enddef $[bracket_rule] OLDCHARS = abc NEWCHARS = xyz map_test: &echo $((map a-b c d-e, s/(.+)-(.+)/$2-$1/; $_ .= '$')) -o$(output) &echo $(makemap a-b c d-e, tr/$(OLDCHARS)/$(NEWCHARS)/ or $$_ = 'failed') -o>>$(output) &echo $(map a-b c d-e fg, undef $_ if /[cd]/) -o>>$(output) # This comes from former 2004_04_27_target_specific_append.test: y: YYY += yy$@ y: &echo "$(YYY)" -o $@ M%: RootM%file # file- or patsubst used to overwrite $* &echo sh$* $(filesubst RootM%, t%, RootMakeppfile) -o M$* # This comes from former 2004_04_01_append_to_undef.test: B = YYY C += $(B) B = BBB undef_test: &echo 'B = $(B)\nC = $(C)' -o $@ ### D 755 1171960696 1171960688 globalize/ ### 28 644 1171960620 1149012551 globalize/Makeppfile # This should be the last Makefile that gets read. LOCAL = C G_0 = C G_A1 += c $(LOCAL) G_A2 += c $(LOCAL) G_B1 += c $(LOCAL) G_B2 += c $(LOCAL) global G_C1 = c $(LOCAL) global G_C2 := c $(LOCAL) global G_LATE1 G_LATE2 G_LATE1 = late1 G_LATE2 := late2 over1 += 1not override over1 += 1more over1 += 1not override over1 += 1again override over3 = 3 # override an unset var over_test: override over4 = 4 over_test: over4 += 4not over_test: override over4 += 4more over_test: &echo $(over1) : $(over2) : $(over3) : $(over4) -o $@ ### D 755 1171960696 1171960688 rc_off/ ### 60 644 1293060494 1316312410 rc_off/Makeppfile # # Test substitution with rc-style substitution turned off. # makepp_simple_concatenation = 1 words := a b c d e null := X := a $(null) # X has a trailing space. rc_off_test: &echo prefix_$(words)_suffix -o $@ &echo $(X)a -o>>$@ root := $(ROOT) ROOT = bla sub relative { my $dir = Mpp::File::path_file_info( 'a/b/c/d/e/f' )->{'..'}; my $ret = Mpp::File::relative_filename( $dir ) . "\n"; for my $name ( qw(a/b/c/d/e a/b/c/d/4 a/b/c/d a/b/c/3 a/b/c a/b/2 a/b a/1 a) ) { my $finfo = Mpp::File::path_file_info $name; $ret .= Mpp::File::relative_filename( $dir, $finfo ) . ' ' if $name !~ /\d/; # Only for dirs $ret .= Mpp::File::relative_filename( $finfo, $dir ) . ' ' . Mpp::File::relative_filename( $finfo ) . "\n"; } chop $ret; $ret; } root_test: &echo $(root) $(ROOT) $(map $(find-upwards RootMakeppfile $(root) rc_off Makeppfile), tr/RM/rm/) -o>$@ &expr &relative -o>>$@ LOCAL = B G_0 = B G_A1 += b $(LOCAL) G_A2 += b $(LOCAL) global G_B1 = b $(LOCAL) global G_B2 := b $(LOCAL) G_LATE1 = early1 G_LATE2 := early2 override global over2 += 2more load_makefile ../globalize # Should not globalize our already existing locals. global_test: &echo $(G_A1) : $(G_A2) : $(G_B1) : $(G_B2) : $(G_C1) : $(G_C2) -o $@ &echo $(G_0) : $(G_LATE1) : $(G_LATE2) -o >>$@ ab = a b define bracket_rule = bracket_$1: &echo $[ab]$[[ 1 2]] -o $$(output) enddef ab = x y z # make sure define did this $[bracket_rule test] ### D 755 1171960696 1171960666 answers/ ### 2 644 1151612515 1178277103 answers/bracket_test a b1 2 a1 a2 b1 b2 ### 4 644 1171960657 1171960657 answers/colon_equal_test 2 12 1 2 2 0 2 0 1 1$ 12 103 1$ 12 103 1$ 12 103 ### 7 644 1151612515 1177022033 answers/define_test define_test This is the second line This is the third line transformed newline OK one line another line ### 2 755 1149026136 1149015251 answers/global_test a A b A c A : a A b B c C : b A c A : b B c C : c A : c C C : late1 : late2 ### 1 644 1322084693 1322084693 answers/Makepp shakepp takeppfile ### 3 755 1171960541 1171960541 answers/map_test b-a$ c$ e-d$ x-y z failed a-b fg ### 34 644 1067451880 1211098944 answers/misc_gnu_make_functions mydir.with.periods/version-1.0-module subdir/xyz file ab ac ad ae ba ca da ea foo bar bar foo foo bar >1< >2< >3< >4< >5< >A< >B< >C< >D< >E< all these words are upcase foo bar baz blarp quux bar foo baz $1 $2 $1 $2 $1 $2 $1 $2 $1 $2 abc/def/ ./ foo.c bar.c baz.s foo.o bar.o a xy word1 a b c q v "a b c" a b c .c .c bar bar baz 3 b c number 1 number 2 number 3 number 4 number 5 number 6 a.o b.c c default automatic undefined automatic environment file ### 1 644 1067451880 1190053951 answers/n_files 23 1 0 ### 4 644 1067451880 1329839323 answers/patsubst_test a.c b.c c.c d.c a.c b.c c.c d.c ab az bx.c by.c bz.c 2x.c 2y.c 2z.c : z z z ### 1 644 1067451880 967520887 answers/question_equal_test 1 2 ### 4 644 1067451880 1172185915 answers/rc_expansion aa.ob ab.ob ac.ob ad.ob zaa.cy zab.cy zac.cy zad.cy abe ace ade a1b a2b a3b ### 3 644 1067451880 990030852 answers/rc_test prefix_a_suffix prefix_b_suffix prefix_c_suffix prefix_d_suffix prefix_a b c d e_suffix a a ### 12 644 1293060509 1293060509 answers/root_test .. bla ../rootmakeppfile .. . makeppfile a/b/c/d/e . . a/b/c/d/e ../4 a/b/c/d/4 e .. a/b/c/d ../../3 a/b/c/3 d/e ../.. a/b/c ../../../2 a/b/2 c/d/e ../../.. a/b ../../../../1 a/1 b/c/d/e ../../../.. a . bla ### 3 644 1067451880 967520645 answers/shell_command she sells Bourne shells by the C shore Percy Bryce Shell ### 2 644 1151520389 1080869684 answers/undef_test B = BBB C = BBB ### 1 644 1067451880 965338704 answers/user_func aa.o b.o c.o d.ob ### 1 644 1148550085 1076548106 answers/x y y2 y3 y4 1 1 ### 1 644 1083086704 1083086676 answers/y yyy ### D 755 1171960696 1151611756 answers/globalize/ ### 1 644 1151611756 1151611756 answers/globalize/over_test over1 1more 1again : over2 2more : 3 : 4 4more ### D 755 1171960696 1149012551 answers/rc_off/ ### 2 755 1149026140 1149012551 answers/rc_off/global_test a B b B c B : a A b B c C : b B c B : b B c C : c B : c C C : early1 : early2 makepp-2.0.98.3/t/target_specific.test0000644000175000017500000000413110674045032017665 0ustar pfeifferpfeiffer### SPAR ### 36 644 1164353390 1058051904 Makeppfile # # Test target-specific variables. # VAR1 := v1 VAR2 = v2 $(VAR3) VAR3 := v3 $(phony all): $( a b c d e f).derived all.test %.derived: % &cat $(input) -o $(output) &echo $(VAR1) $(VAR2) -o>>$(output) a b c d e f: &echo $@ $(VAR1) $(VAR2) -o $@ e.derived: VAR1 = v1_modified f.derived: VAR3 = v3_modified a: VAR1 = v1a $(VAR3) # Change the type of VAR1 to a = var. b: VAR2 := v2a $(VAR3) # Change the type of VAR2 to a := var. c: VAR1 += $(VAR3) # Append text, keep type the same (:=). c: VAR1 += 2nd_append # Append to target-specific value. d: VAR2 += $(VAR3) # Append text, keep type the same (=). VAR2 = v2_later $(VAR3) VAR3 = v3_later all.test: x.test y.test z.test &cat $(inputs) -o $(output) [xy].test : VAR1 := v1_modified $(foreach): : foreach x.test y.test z.test &echo $(VAR1) $(VAR2) -o $(output) ### D 755 1067451879 1058051933 answers ### 1 644 1067451879 1055985004 answers/a a v1a v3_later v2_later v3_later ### 1 644 1067451879 1055985004 answers/b b v1 v2a v3 ### 1 644 1067451879 1055985004 answers/c c v1 v3 2nd_append v2_later v3_later ### 1 644 1067451879 1055985004 answers/d d v1 v2 v3_later v3_later ### 1 644 1067451879 1055985005 answers/e e v1 v2_later v3_later ### 1 644 1067451879 1055985005 answers/f f v1 v2_later v3_later ### 2 644 1067451879 1055985004 answers/d.derived d v1 v2 v3_later v3_later v1 v2_later v3_later ### 2 644 1067451879 1055985005 answers/f.derived f v1 v2_later v3_later v1 v2_later v3_modified ### 1 644 1067451879 1190053945 answers/n_files 16 1 0 ### 2 644 1067451879 1055985004 answers/a.derived a v1a v3_later v2_later v3_later v1 v2_later v3_later ### 2 644 1067451879 1055985004 answers/c.derived c v1 v3 2nd_append v2_later v3_later v1 v2_later v3_later ### 2 644 1067451879 1055985005 answers/e.derived e v1 v2_later v3_later v1_modified v2_later v3_later ### 3 644 1067451879 1058051921 answers/all.test v1_modified v2_later v3_later v1_modified v2_later v3_later v1 v2_later v3_later ### 2 644 1067451879 1055985004 answers/b.derived b v1 v2a v3 v1 v2_later v3_later makepp-2.0.98.3/t/stress_tests/0000755000175000017500000000000012115460733016400 5ustar pfeifferpfeiffermakepp-2.0.98.3/t/stress_tests/build_cache_concurrent.test0000644000175000017500000001024212047172050023760 0ustar pfeifferpfeiffer### SPAR ### 3 644 1148062992 1224089593 is_relevant.pl is_windows < 1 # Strawberry and ActiveState can crash and !no_link and fork ? wait>0 : exit # Make sure we can fork. ### 65 755 1103935704 1185997009 makepp_test_script.pl # Environment variables STRESS_PREFIX0 .. STRESS_PREFIX without gaps specify # command prefixes for that many parallel running makepp instances, one each in # dir0 .. dir. # The prefixes would typically be "ssh hostname" or "0" for local execution. # The first two default to "0". my $insist = $ENV{STRESS_INSIST}; # Fail unless we had stress. my $end = time + ($ENV{STRESS_SECONDS} || 30); # Approximate -- adjust MAKEPP_TEST_TIMEOUT! my $cache = $ENV{STRESS_BUILD_CACHE} || 'build_cache'; my $no_clean = $ENV{STRESS_NO_CLEAN}; # Allow a parallelly running test to clean a grouped cache. my $force_copy = defined $ENV{STRESS_FORCE_COPY} ? $ENV{STRESS_FORCE_COPY} : .5; # Probability to --force-copy-from-bc (0: none, 1: always) my $i = 0; my @hosts = (0, 0); # Do at least 2 local tests. while( defined( my $val = $ENV{"STRESS_PREFIX$i"} )) { $hosts[$i++] = $val; } makepp \'builtin', '-MMpp::BuildCacheControl', 'create', $cache unless -d $cache; $i = 0; # Fork a child for every host. my %pids; for( @hosts ) { mkdir "dir$i" or die; c_cp 'Makeppfile.in', "dir$i/Makeppfile"; my $pid = fork; unless( $pid ) { # We're the child now my @cmd = ($ENV{PERL}, './stress_test.pl', "dir$i", $end, 0.5, $force_copy, $ENV{PERL}, $Mpp::makepp_path, $cache); if( $_ ) { # Host prefix given for this one. chomp(my $pwd = `/bin/pwd`); @cmd = "$_ \"sh -c 'cd $pwd && exec @cmd'\""; } print "@cmd\n"; exec @cmd; die "exec failed: $!\n"; } die "fork failed: $!\n" if $pid < 0; undef $pids{$pid}; $i++; } use POSIX qw(:sys_wait_h); # Back in the parent. while( 1 ) { select undef, undef, undef, rand 2.5; for( keys %pids ) { if( waitpid $_, WNOHANG ) { die if $?; delete $pids{$_}; } } %pids or last; $no_clean or makepp \'builtin', '-MMpp::BuildCacheControl', qw{clean --verbose --mtime +-1 --in-mtime +-1}, $cache; } unlink 'answers/build_cache_stress' unless $insist || -f 'build_cache_stress'; 1; ### 17 755 1103935704 1185978476 stress_test.pl use Cwd 'chdir'; @ARGV==7 or die; my ($subdir, $end, $sleep, $force_copy, $perl, $makepp, $cache) = @ARGV; chdir $subdir or die; srand($$); my $upcache = ($cache =~ m@^/@) ? $cache : "../$cache"; do { unlink qw{short_file long_file}; -e 'short_file' || -e 'long_file' and die; select undef, undef, undef, rand $sleep; system $perl, $makepp, "--build_cache=$upcache", rand() < $force_copy ? '--force-copy-from-bc' : () and die; } while $end > time; print STDERR "$subdir done\n"; exit 0; ### 19 644 1103936101 1185560328 Makeppfile.in perl_begin $Mpp::BuildCache::error_hook = sub { # If this file doesn't show up, then there hasn't been any stress, so the # test isn't doing its job (and thus it fails even if it reveals no bugs). open my $fh, '>', '../build_cache_stress' or die $!; }; $block = "long lines file\n" x 1024; perl_end $(phony check): short_file long_file.wc &grep '/^short file/' short_file &grep /^65536/ long_file.wc short_file long_file: &echo -o short_file "short file" -&expr -n 'print $$block for 1..64' -o long_file long_file.$( wc junk): long_file : build_cache none &grep -c '/^long lines file$$/o' long_file -o$(output) -w$(output 2) ### D 755 1164319650 1079870636 .makepp/ ### 3 644 1164319650 1167411378 .makepp/log This is a dummy file present so as to satisfy makepp's test harness. N_FILES000 ### D 755 1103936101 1103936159 answers/ ### 0 644 1103936084 1103936090 answers/build_cache_stress ### D 755 1103936101 1103936159 answers/dir0 ### 1 644 1103936084 1103936090 answers/dir0/short_file short file ### 1 644 1103936084 1103936090 answers/dir0/long_file.wc 65536 ### 0 644 1103936084 1185554009 answers/dir0/long_file.junk ### D 755 1103936101 1103936159 answers/dir1 ### 1 644 1103936084 1103936090 answers/dir1/short_file short file ### 1 644 1103936084 1103936090 answers/dir1/long_file.wc 65536 ### 0 644 1103936084 1185561366 answers/dir1/long_file.junk makepp-2.0.98.3/t/static_pattern.test0000644000175000017500000000173510674045032017565 0ustar pfeifferpfeiffer### SPAR ### 21 644 1067451879 965508654 Makeppfile # # Test of static pattern rules. # .PHONY: all all: $( a b c d e f).out # # The old GNU makefile syntax: # a.out b.out c.out : %.out: %.in &echo $< -o $@ &cat $< -o>>$@ # # The :foreach syntax: # %.out: %.in : foreach d.in e.in f.in &echo $< -o $@ &cat $< -o >>$@ ### 1 644 1067451879 965508501 a.in a ### 1 644 1067451879 965508503 b.in b ### 1 644 1067451879 965508505 c.in c ### 1 644 1067451879 965508762 d.in d ### 1 644 1067451879 965508764 e.in e ### 1 644 1067451879 965508766 f.in f ### D 755 1067451879 965508995 answers ### 2 644 1067451879 965508968 answers/a.out a.in a ### 2 644 1067451879 965508968 answers/b.out b.in b ### 2 644 1067451879 965508968 answers/c.out c.in c ### 2 644 1067451879 965508769 answers/d.out d.in d ### 2 644 1067451879 965508769 answers/e.out e.in e ### 2 644 1067451879 965508769 answers/f.out f.in f ### 1 644 1067451879 1190053943 answers/n_files 6 1 0 makepp-2.0.98.3/t/special_chars_unix.test0000644000175000017500000000125010674045032020374 0ustar pfeifferpfeiffer### SPAR ### 20 644 1067451879 965515310 Makeppfile # # A test of makepp's handling of files with special characters in them. # .PHONY: all all: '%\' "a file with spaces" "a:b" "%\\" : "a;b" &echo -E '$@' -o '$@' &cat '$<' -o>>'$@' "a;b": &echo "$@" -o '$@' "a file with spaces": &echo "$@" -o '$@' "a:b": &echo "$@" -o "$@" ### D 755 1067451879 965515332 answers ### 2 644 1067451879 965514355 answers/%\ %\ a;b ### 1 644 1067451879 965515317 answers/a:b a:b ### 1 644 1067451879 965514355 answers/a;b a;b ### 1 644 1067451879 1190053938 answers/n_files 4 1 0 ### 1 644 1067451879 965514355 answers/a file with spaces a file with spaces makepp-2.0.98.3/t/spar0000755000175000017500000003076211714051522014532 0ustar pfeifferpfeiffer#! /usr/bin/env perl our $VERSION = 0.10; use Getopt::Long; Getopt::Long::config qw(bundling no_getopt_compat); my %opt; GetOptions \%opt, 't|table|list', 'x|extract|get', 'c|create', 'd|createdata', 'm|createmakepptest', 'a|append', 'E|exclude=s' => \@exclude, 'X|exclude-from=s', 'e|emacs|emacsmode', 'p|perl|perlcode', (($Getopt::Long::VERSION >= 2.17) ? 'h|help|?' : 'h|help') => sub { eval q{ use Pod::Usage; pod2usage -output => \*STDERR; }; exit; }; my $extractor = q{ my( $lines, $kind, $mode, %mode, $atime, $mtime, $name, $nl ) = (-1, 0); while( ) { s/\r?\n$//; # cross-plattform chomp if( $lines >= 0 ) { print F $_, $lines ? "\n" : $nl; } elsif( $kind eq 'L' ) { if( $mode eq 'S' ) { symlink $_, $name; } else { link $_, $name; } $kind = 0; } elsif( /^###\t(?!SPAR)/ ) { (undef, $kind, $mode, $atime, $mtime, $name) = split /\t/, $_, 6; if( !$name ) { } elsif( $kind eq 'D' ) { $name =~ s!/+$!!; -d $name or mkdir $name, 0700 or warn "spar: can't mkdir `$name': $!\n"; $mode{$name} = [$atime, $mtime, oct $mode]; } elsif( $kind ne 'L' ) { open F, ">$name" or warn "spar: can't open >`$name': $!\n"; $lines = abs $kind; $nl = ($kind < 0) ? '' : "\n"; } } elsif( defined $mode ) { warn "spar: $archive:$.: trailing garbage ignored\n"; } # else before beginning of spar } continue { if( !$lines-- ) { close F; chmod oct( $mode ), $name and utime $atime, $mtime, $name or warn "spar: $archive:$name: Failed to set file attributes: $!\n"; } } for( keys %mode ) { chmod pop @{$mode{$_}}, $_ and utime @{$mode{$_}}, $_ or warn "spar: $archive:$_: Failed to set directory attributes: $!\n"; } }; my $archive = shift; if( $opt{x} || $opt{t} ) { open DATA, $archive or die "$0: can't open `$archive': $!\n"; eval $extractor, exit if $opt{x}; while( ) { next unless /^###\t(?!SPAR)/; chop; my( $kind, $mode, $atime, $mtime, $name ) = (split /\t/, $_, 6)[1..5]; if( $kind eq 'D' ) { print "directory 0$mode, ", scalar localtime $mtime, ", `$name'\n"; } elsif( $kind eq 'L' ) { chop( my $linkee = ); print +($mode eq 'S') ? 'symlink' : 'link ', " `$name' -> `$linkee'\n"; } else { $kind = abs $kind; print "file 0$mode, ", scalar localtime $mtime, ", `$name' ($kind line", ($kind == 1) ? '' : 's', ")\n"; for 1..$kind; } } } elsif( $opt{e} ) { $/ = "\n="; while( ) { print, last if s/^begin Emacs\n+// && s/\n=$//s; } } elsif( $opt{p} ) { print "# spar extraction function # assumes DATA to be opened to the spar sub un_spar() {$extractor}\n"; } elsif( $opt{c} || $opt{d} || $opt{m} || $opt{a} || $archive eq '-' || !-f $archive ) { if( $opt{X} ) { open F, $opt{X}; while( ) { chomp; push @exclude, $_; } } for( @exclude ) { $exclude{$_} = 1 for glob; } if( $opt{a} && -s $archive ) { open SPAR, ">>$archive" or die "$0: can't open >>`$archive': $!\n"; } else { open SPAR, ">$archive" or die "$0: can't open >`$archive': $!\n"; chmod 0755, $archive if $opt{c} and $archive ne '-'; print SPAR $opt{c} ? <\n"; #! /usr/bin/env perl # This file was generated by spar # Run it with perl to unpack it. $extractor __DATA__ EOH } use File::Find; find({ wanted => \&process, follow => 0, preprocess => $opt{m} ? \&makepptestsort : sub { sort @_ } }, @ARGV ? @ARGV : '.'); sub makepptestsort { my %files; @files{@_} = (); my $answers = exists $files{answers} and delete $files{answers}; my @files; for my $re (qr/(?:is_relevant|makepp_test_script)(?:\.pl)?/, qr/(?:Root)?[Mm]akep*file/, qr/.+\.mk/, qr/.+\.p[lm]/) { for( sort keys %files ) { next if !/^$re$/; push @files, $_; delete $files{$_}; } } (@files, sort( keys %files ), $answers ? 'answers' : ()); } sub process { (my $name = $File::Find::name) =~ s!^\./!!; return if $name eq '.'; $File::Find::prune = 1, return if $exclude{$name} or $exclude{$_}; if( -l ) { print SPAR "### L S 0 0 $name\n" . readlink, "\n"; return; } ($dev, $ino, $mode, $nlink, $atime, $mtime) = (stat _)[0..3, 8, 9]; $mode = sprintf "%o", $mode & 07777; if( $nlink > 1 ) { if( -d _ ) { print SPAR "### D $mode $atime $mtime $name/\n"; return; } elsif( $seen{$dev, $ino} ) { print SPAR "### L H 0 0 $name\n$seen{$dev, $ino}\n"; return; } else { $seen{$dev, $ino} = $name; } } open F, $_ or die "$0: can't open <$_: $!\n"; my @file = ; close F; my $length = @file; if( $length and $file[-1] !~ /\n$/ ) { $file[-1] .= "\n"; $length = -$length; } print SPAR join '', "### $length $mode $atime $mtime $name\n", @file; } close SPAR; } else { die "$0: no command given\n"; } __END__ =begin Emacs (setq auto-mode-alist `(("\\.spar$\\|/makepp.+\\.test$" . spar-mode) ,@auto-mode-alist)) (defun spar-show () "Show this subfile in an indirect buffer with right mode. It is in fact the same buffer as the SPAR, so be careful not to change the number of lines, or the SPAR will become inconsistent." (interactive) (let ((obuf (current-buffer)) (fl font-lock-mode) a z buf) (save-excursion (outline-back-to-heading) (beginning-of-line 2) (setq buf (match-string-no-properties 1) a (point)) (outline-next-heading) (setq z (point))) (switch-to-buffer (make-indirect-buffer (current-buffer) buf t)) (narrow-to-region a z) (let ((buffer-file-name buf)) (set-auto-mode)) (and fl (not font-lock-mode) (set-buffer obuf) (font-lock-mode fl)))) (defun spar-fix () "Fix the number of lines declared in the heading of this subfile. If this subfile is within a nested SPAR, the outer heading will not be fixed." (interactive) (save-match-data (outline-back-to-heading) (if (looking-at "### -?\\([0-9]+\\) [0-9]+ [0-9]+ \\([0-9]+\\)") (let ((a (point)) n) (save-match-data (outline-next-heading)) (setq n (prin1-to-string (1- (count-lines a (point))))) (replace-match (format "%.0f" (float-time)) nil nil nil 2) (unless (string= n (match-string-no-properties 1)) (replace-match n nil nil nil 1))) (error "Not on a normal file")))) (defun spar-level () (let ((z (1- (match-end 1))) (n 1)) (save-excursion (goto-char (match-beginning 1)) (while (search-forward "/" z t) (setq n (1+ n)))) n)) (define-derived-mode spar-mode outline-mode "Spar" "Major mode for editing Simple Perl ARchives. Command \\[spar-show] allows editing one subfile section. Command \\[spar-fix] fixes the lenth of one subfile section. Note that SPARs can contain other SPARs. But this mode does not recognize that. Outline levels are the same for nested SPARs as for outer ones, so you cannot normally hide a subtree containing a nested SPAR." (set (make-local-variable 'outline-regexp) "^### .+ \\(.+\\)") (set (make-local-variable 'outline-level) 'spar-level) (setq imenu-generic-expression '(("links" "^### [LS] .+ \\(.+\\)" 1) ("directories" "^### D .+ \\(.+\\)" 1) (nil "^### .+ \\(.+\\)" 1)))) (define-key spar-mode-map "\C-cs" 'spar-show) (define-key spar-mode-map "\C-cf" 'spar-fix) =end Emacs =head1 NAME spar -- Simple Perl ARchive manager =head1 SYNOPSIS spar command[ option ...] archive[ file ...] spar utility Creates or extracts a poor man's archive.  Especially when containing lots of small files a I can be by a factor smaller than a tar.  And it can be conveniently edited, especially in Emacs. =head2 Commands =over =item -a, --append This can add further files to an existing I.  If that is empty or inexistent, this is the same as C<--createdata>. =item -c, --create Creates the archive of all given files as a self unpacking Perl script.  If no files are given, archives the current directory. =item -d, --createdata Like C<--create>, but the I contains only the data.  It will require either C or the code output by C to unpack it.  This is the default if the archive doesn't exist or is C<->, i.e. stdout. =item -t, --table, --list Show a table of contents. =item -x, --extract, --get Extract all files and directories contained in the archive. =back =head2 Options Currently these options are only applicable to the C<--append>, C<--create> and C<--createdata> commands. =over =item -E, --exclude=I Exclude file I.  I may be a full or relative path, or a simple filename to exclude in every directory it is found.  I may contain Perl's wildcards C, C<*> and C<{,}>.  In that case it stands for zero or more actual files.  You should protect these wildcards from the shell, by quoting them. =item -X, --exclude-from=I Exclude files listed in I.  Each line is as in the C<--exclude> option, except you must not protect wildcards. =back =head2 Utilities =over =item -e, --emacs, --emacsmode Output an Emacs mode you can paste into your F<~/.emacs> for editing Is. =item -p, --perl, --perlcode Output code you can paste into your script to extract a I.  This can also be used for getting any files your script needs, right from the C<__DATA__> section. =back =head1 DESCRIPTION Creates or extracts a poor man's archive.  Especially when containing lots of small files it can be by a factor smaller than a tar.  Newlines are extracted in what Perl considers the local format.  Due to this, Is with binary files are not portable to systems with different newline conventions. Unlike C it does not strip a leading C from filenames.  If you want to do that, you must call C in the root directory and give it relative paths. Since everything becomes one text, this can be used for renaming files along with their content (refactoring).  Such a need may arise in programming, where directory and file names will often reflect the packages or classes they contain.  But from an operating system point of view, you modify these aspects in very different ways (e.g. C and C). Unlike one of the two C utilities available on the internet, the content here is completely separated from the extraction-code in Perl.  (The other C is only a perl frontend to C.) =head1 FORMAT The archive format is plain text.  Special characters within the files or file names are not masked.  All metadata resides on lines starting with C<###\t>.  There are the following kinds of metadata: =over 4 =item C F This is the magic number on the first line of data-only spars.  The F is from where you can L the C program.  This line is only informative and actually gets ignored. =item CIC<\t>IC<\t>IC<\t>F This creates the directory F.  F may contain any characters except for a newline.  The I is octal and I and I are as in the C function.  The I is only set after extracting the directory contents, so you can extract write-protected directories. =item IC<\t>IC<\t>IC<\t>IC<\t>F This marks the next I lines as the content of file F.  Those lines are directly followed by the end of file, or another metadata line.  Due to the I-count, the file may istself contain lines matching spar-metadata (i.e. an embedded I) without confusing C.  If I is negative, the extracted file will not end with a newline.  The I is octal and I and I are as in the C function. =item CF =item CF These create the link (H) or symlink (S) F.  The name of the file linked to is on the following line.  The mode and times of the links themselves are whatever the system makes them. =back =head1 DOWNLOAD You can get the latest version of spar from L. Because makepp was the first to use this, it is hosted on CVS at L and the subdirectory F contains a test-suite runnable by C, also from there. =head1 AUTHOR Daniel Pfeiffer =begin CPAN =head1 README B B< · >much smaller than I for small files B< · >best for text files B< · >helps renaming files along with contents B< · >self unpacking B< · >embeddable unpacker B< · >Emacs mode =pod SCRIPT CATEGORIES UNIX/System_administration VersionControl/CVS Win32/Utilities makepp-2.0.98.3/t/signature.test0000644000175000017500000000115210674045032016533 0ustar pfeifferpfeiffer### SPAR ### 17 644 1164353368 982624814 Makeppfile # # Test of signature checking. # $(phony all): file_made_outside_makepp build_check target_newer # # This rule should not be executed if the file already exists, but if # makepp is using exact_match or any of its other signature checking # methods, it will try to make it anyway because it doesn't know how # it was made. # file_made_outside_makepp: perl { die } signature default ### 0 644 1067451879 982624844 file_made_outside_makepp ### D 755 1067451879 982624972 answers ### 1 644 1067451879 1190053928 answers/n_files 0 1 0 makepp-2.0.98.3/t/run_tests.pl0000755000175000017500000005732012107132064016222 0ustar pfeifferpfeiffer#!/usr/bin/env perl # # See bottom of file for documentation. # package Mpp; use Config; use Cwd; use File::Path; # on some (Windowsish) filesystems rmtree may temporarily fail sub slow_rmtree(@) { for my $tree ( grep -d, @_ ) { for( 0..9 ) { eval { $@ = ''; local $SIG{__WARN__} = sub { die @_ }; rmtree $tree }; -d $tree or last; $_ < 9 and select undef, undef, undef, .1; } warn $@ if $@; } } # # See if this architecture defines the INT signal. # my $sigint; if(defined $Config{sig_name}) { my $i=0; for(split(' ', $Config{sig_name})) { $sigint=$i,last if $_ eq 'INT'; ++$i; } } my $archive = $Config{perlpath}; # Temp assignment is work-around for a nasty perl5.8.0 bug our $source_path; my $old_cwd; my $dot; my $hint; my $verbose; my $test; my $keep; my $name; my $perltype; my $basedir; my $subdir; my $dotted; our $makepp_path; # Global constants for compile time check. BEGIN { open OSTDOUT, '>&STDOUT' or die $!; open OSTDERR, '>&STDERR' or die $!; $old_cwd = cwd; # Remember where we were so we can cd back here. if( $0 =~ m@/@ ) { # Path specified? ($source_path = $0) =~ s@/[^/]+$@@; # Get the path to our script. } elsif( $ENV{PATH} =~ /[;\\]/ ) { # Find it in Win $PATH: foreach (split(/;/, $ENV{PATH}), '.') { my $dir = $_ || '.'; # Blank path element is . if( -e "$dir\\$0" ) { $source_path = $dir; last; } } } else { # Find it in $PATH: foreach (split(/:/, $ENV{PATH}), '.') { my $dir = $_ || '.'; # Blank path element is . if( -x "$dir/$0" ) { $source_path = $dir; last; } } } $source_path or die "$0: something's wrong, can't find path to executable\n"; $source_path =~ m@^/@ or $source_path = "$old_cwd/$source_path"; # Make path absolute. $source_path =~ s@/(?:\./)+@/@; $source_path =~ s@/\.$@@; 1 while ($source_path =~ s@/\.(?=/|$)@@) || # Convert x/./y into x/y. ($source_path =~ s@/[^/]+/\.\.(?=/|$)@@); # Convert x/../y into y. $makepp_path = $source_path; $makepp_path =~ s@/([^/]+)$@/makepp@; # Get the path to the makepp # executable, which should always be in the # directory above us. our $datadir = substr $makepp_path, 0, rindex $makepp_path, '/'; push @INC, $datadir; unless( eval { require Mpp::Text } ) { open my $fh, '<', $makepp_path; while( <$fh> ) { if( /^\$datadir = / ) { eval; $INC[-1] = $datadir; require Mpp::Text; last; } die "Can't locate path to makepp libraries." if $. == 99; } } if( $^O =~ /^MSWin/ && $] < 5.008007 ) { # IDENTICAL AS IN makepp # This is a very bad hack! On earlier Win Active State "lstat 'file'; lstat _ or -l _" is broken. my $file = "$datadir/Mpp/File.pm"; local $_ = "$file.broken"; unless( -f ) { # Already converted rename $file, $_; open my $in, '<', $_; open my $out, '>', $file; chmod 07777 & (stat)[2], $file; while( <$in> ) { s/\blstat\b/stat/g; s/-l _/0/g; print $out $_; } } } Mpp::Text::getopts( [qw(b basedir), \$basedir, 1], [qw(d dots), \$dot], [qw(h hint), \$hint], [qw(k keep), \$keep], [qw(m makepp), \$makepp_path, 1], [qw(n name), \$name, 1], [qw(s subdir), \$subdir], [qw(t test), \$test], [qw(v verbose), \$verbose], [qr/[h?]/, 'help', undef, 0, sub { print <f'; # Use different filename because rmdir may fail on Win close $fh; my $link = eval { link 'f', 'g' } && # might die somewhere ((stat 'f')[1] ? # Do we have inums? (stat _)[1] == (stat 'g')[1] : # vfat emulates link by copy, useless for build_cache. (stat _)[3] == 2 && (stat 'g')[3] == 2); # Link count right? unlink 'f', 'g'; eval 'sub no_link() {' . ($link ? '' : 1) . '}'; chdir $old_cwd; } my $have_cc; sub have_cc() { unless( defined $have_cc ) { $have_cc = $ENV{CC} || system( PERL, '-w', $makepp_path.'builtin', 'expr', # Use mpp's CC function without loading full mpp. No "" because of fucked up Win. 'sub Mpp::log($@) {} sub Mpp::Makefile::implicitly_load {} close STDERR; q!not-found! eq Mpp::Subs::f_CC', '-ohave_cc' ) ? 1 : 0; } $have_cc; } $ENV{PERL} ||= PERL; #delete $ENV{'MAKEPPFLAGS'}; # These environment variables can possibly #delete $ENV{'MAKEFLAGS'}; # mess up makepp tests. # For some reason, with Perl 5.8.4, deleting the environment variables doesn't # actually remove them from the environment. $ENV{"${_}FLAGS"} = '' for qw(MAKEPP MAKE MAKEPPBUILTIN MAKEPPCLEAN MAKEPPLOG MAKEPPGRAPH); for( $ENV{PATH} ) { my $sep = is_windows > 0 ? ';' : ':'; s/^\.?$sep+//; # Make sure we don't rely on current dir in PATH. s/$sep+\.?$//; s/$sep+\.?$sep+/$sep/; $_ = "$source_path$sep$_"; } # # Equivalent of system() except that it handles INT signals correctly. # # If the first argument is a reference to a string, that is the command to report as failing, if it did fail. # sub system_intabort { my $cmd = ref( $_[0] ) && shift; system @_; kill 'INT', $$ if $sigint && $? == $sigint; if( $? && $cmd ) { if( $? == -1 ) { die "failed to execute $$cmd: $!\n" } elsif( $? & 127 ) { die sprintf "$$cmd died with signal %d%s coredump\n", ($? & 127), ($? & 128) ? ' and' : ', no'; } else { die sprintf "$$cmd exited with value %d\n", $? >> 8; } } return $?; } my %file; my $page_break = ''; my $log_count = 1; sub makepp(@) { my $suffix = ''; $suffix = ${shift()} if ref $_[0]; print "${page_break}makepp$suffix" . (@_ ? " @_\n" : "\n"); $page_break = "\cL\n"; if( !$suffix && -f '.makepp/log' ) { chdir '.makepp'; # For Win. rename log => 'log' . $log_count++; chdir '..'; } system_intabort \"makepp$suffix", # " PERL, '-w', exists $file{'makeppextra.pm'} ? '-Mmakeppextra' : (), $makepp_path.$suffix, @_; 1; # Command succeeded. } @ARGV or @ARGV = <*.test *.tar *.tar.gz>; # Get a list of arguments. my $n_failures = 0; my $n_successes = 0; (my $wts = $0) =~ s/run_tests/wait_timestamp/; do $wts; # Preload the function. eval { require Time::HiRes }; # Preload the library. # spar extraction function # assumes DATA to be opened to the spar sub un_spar() { my( $lines, $kind, $mode, %mode, $atime, $mtime, $name, $nl ) = (-1, 0); while( ) { s/\r?\n$//; # cross-plattform chomp if( $lines >= 0 ) { print F $_, $lines ? "\n" : $nl; } elsif( $kind eq 'L' ) { if( $mode eq 'S' ) { symlink $_, $name; } else { link $_, $name; } $kind = 0; } elsif( /^###\t(?!SPAR)/ ) { (undef, $kind, $mode, $atime, $mtime, $name) = split /\t/, $_, 6; if( !$name ) { } elsif( $kind eq 'D' ) { $name =~ s!/+$!!; -d $name or mkdir $name, 0700 or warn "spar: can't mkdir `$name': $!\n"; $mode{$name} = [$atime, $mtime, oct $mode]; } elsif( $kind ne 'L' ) { open F, ">$name" or warn "spar: can't open >`$name': $!\n"; $lines = abs $kind; $nl = ($kind < 0) ? '' : "\n"; } } elsif( defined $mode ) { warn "spar: $archive:$.: trailing garbage ignored\n"; } # else before beginning of spar } continue { if( !$lines-- ) { close F; chmod oct( $mode ), $name and utime $atime, $mtime, $name or warn "spar: $archive:$name: Failed to set file attributes: $!\n"; } } for( keys %mode ) { chmod pop @{$mode{$_}}, $_ and utime @{$mode{$_}}, $_ or warn "spar: $archive:$_: Failed to set directory attributes: $!\n"; } } # With -d report '.' for success, 's' for skipped because of symlink failure, # 'w' for not applicable on Windows, '-' for otherwise skipped. sub dot($$;$) { if( defined $_[0] ) { if( $test ) { for( "$_[1]" ) { s/^passed // || s/^skipped/# skip/; print "ok $test $_"; } $test++; } else { print $_[$dot ? 0 : 1]; $dotted = 1 if $dot; } return; } elsif( $test ) { print "not ok $test $_[1]"; $test++; } else { print "\n" if defined $dotted; print "FAILED $_[1]"; undef $dotted; } if( $_[2] ) { # See the error in logs that people send in. open my $fh, '>>', $_[2]; print $fh "\nmakepp: run_tests.pl `FAILED' $_[1]"; # Format that Emacs makes red. close $fh; } } $Mpp::Subs::rule->{MAKEFILE}{PACKAGE} = 'Mpp'; sub do_pl($) { my $pl = "$_[0].pl"; return -1 unless exists $file{$pl}; $Mpp::Subs::rule->{MAKEFILE}{MAKEFILE} = Mpp::File::file_info $pl; $Mpp::Subs::rule->{RULE_SOURCE} = $pl . ':0'; do $pl; } sub n_files(;$$) { my( $outf, $code ) = @_; open my $logfh, '.makepp/log' or die ".makepp/log--$!\n"; seek $logfh, -20, 2 if !$code; # More than enough to find last message. open my $outfh, '>', $outf if $outf; while( <$logfh> ) { &$code if $code; if( /^[\02\03]?N_FILES\01(\d+)\01(\d+)\01(\d+)\01$/ ) { close $logfh; # Might happen too late for Windows. my $ret ="$1 $2 $3\n"; print $outfh $ret if $outfh; return $ret; } } return; } my $have_shell = -x '/bin/sh'; print OSTDOUT '1..'.@ARGV."\n" if $test; test_loop: foreach $archive (@ARGV) { %file = (); my $testname = $archive; my( $tarcmd, $dirtest, $warned, $tdir, $tdir_failed, $log ); $SIG{__WARN__} = sub { warn defined $dotted ? "\n" : '', $warned ? '' : "$testname: warning: ", $_[0]; undef $dotted if -t STDERR; # -t workaround for MSWin $warned = 1; }; if( -d $archive ) { $tdir = $archive; substr $tdir, 0, 0, "$old_cwd/" if is_windows ? $tdir !~ /^(?:[a-z]:)?\// : $tdir !~ /^\//; ($log = $tdir) =~ s!/*$!.log!; chdir $tdir; $dirtest = 1; } else { $testname =~ s/\..*$//; # Test name is tar file name w/o extension. if( is_windows && $testname =~ /_unix/ ) { # Skip things that will cause errors on Cygwin. # E.g., the test for file names with special # characters doesn't work under NT! dot w => "skipped $testname on Windows\n"; next; } if( no_symlink && $testname =~ /repository|symlink/ ) { dot s => "skipped $testname because symbolic links do not work\n"; next; } if( no_link && $testname =~ /build_cache/ ) { dot l => "skipped $testname because links do not work\n"; next; } if ($archive !~ /^\//) { # Not an absolute path to tar file? $archive = "$old_cwd/$archive"; # Make it absolute, because we're going } # to cd below. if ($testname =~ /\.gz$/) { # Compressed tar file? $tarcmd = "gzip -dc $archive | tar xf -"; } elsif ($testname =~ /\.bz2$/) { # Tar file compressed harder? $tarcmd = "bzip2 -dc $archive | tar xf -"; } ($tdir = "$testname.tdir") =~ s!.*/!!; substr $tdir, 0, 0, $basedir; $log = substr( $tdir, 0, -4 ) . 'log'; $tdir_failed = substr( $tdir, 0, -4 ) . 'failed'; slow_rmtree $tdir, $tdir_failed; mkdir $tdir, 0755 or die "$0: can't make directory $tdir--$!\n"; # Make a directory. chdir $tdir or die "$0: can't cd into tdir--$!\n"; } eval { local $SIG{ALRM} = sub { die "timed out\n" }; eval { alarm( $ENV{MAKEPP_TEST_TIMEOUT} || 600 ) }; # Dies in Win Active State 5.6 if( $tarcmd ) { system_intabort $tarcmd and # Extract the tar file. die "$0: can't extract testfile $archive\n"; } elsif( !$dirtest ) { open DATA, $archive or die "$0: can't open $archive--$!\n"; eval { local $SIG{__WARN__} = sub { die @_ if $_[0] !~ /Failed to set/ }; un_spar }; # Alas happens a lot on native Windows. die +(is_windows && $@ =~ /symlink .* unimplemented/) ? "skipped s\n" : $@ =~ /: can't open >`/ ? "skipped\n" : $@ if $@; } open STDOUT, '>', $log or die "write $log: $!"; open STDERR, '>&STDOUT' or die $!; open my $fh, '>>.makepprc'; # Don't let tests be confused by a user's file further up. close $fh; # check for all special files in one go: @file{<{is_relevant.pl,makepp_test_script.pl,makepp_test_script,cleanup_script.pl,makeppextra.pm,hint}*>} = (); eval { die "skipped x\n" if exists $file{makepp_test_script} && !$have_shell; do_pl 'is_relevant' or die "skipped r\n"; $page_break = ''; $log_count = 1; if( exists $file{'makepp_test_script.pl'} ) { local %ENV = %ENV; # some test wrappers change it. do_pl 'makepp_test_script' or die 'makepp_test_script.pl ' . ($@ ? "died: $@" : "returned false\n"); } elsif( exists $file{'makepp_test_script'} ) { system_intabort \'makepp_test_script', './makepp_test_script', $makepp_path; } else { makepp; } }; open STDOUT, '>&OSTDOUT' or die $!; open STDERR, '>&OSTDERR' or die $!; die $@ if $@; # # Now look at all the final targets: # my @errors; { local $/; # Slurp in the whole file at once. for my $name ( Mpp::Glob::zglob 'answers/**/*' ) { next if $name =~ /\/n_files$/ # Skip the special file. or -d $name; # Skip subdirectories, find recurses. open TFILE, '<:crlf', $name or die "$0: can't open $tdir/$name--$!\n"; $tfile_contents = ; # Read in the whole thing. # Get the name of the actual file. $name =~ s!answers/!!; open TFILE, '<:crlf', $name or die "$0: can't open $tdir/$name--$!\n"; my $mtfile_contents = ; # Read in the whole file. $mtfile_contents eq $tfile_contents or push @errors, $name; } } close TFILE; # # See if the correct number of files were built: # if( !defined( my $n_files_updated = n_files )) { push @errors, '.makepp/log'; } elsif( open my $n_files, 'answers/n_files' ) { # Count of # of files updated? $_ = <$n_files>; $_ eq $n_files_updated or push @errors, 'n_files'; } # Get rid of the log file so we don't get confused if the next test doesn't # make a log file for some reason. For a failed test it remains, hence the name. rename '.makepp/log' => '.makepp/log.failed'; # # Also search through the log file to make sure there are no Perl messages # like "uninitialized value" or something like that. # if( open my $logfile, $log ) { while( <$logfile> ) { # Have to control a few warnings before we can unleash this: #/makepp: warning/ if( /at (\S+) line \d+/ && $1 !~ /[Mm]akep*file$|\.mk$/ || /(?:internal|generated) error/ ) { push @errors, $log; last; } } } eval { alarm 0 }; die 'wrong file' . (@errors > 1 ? 's' : '') . ': ' . join( ', ', @errors) . "\n" if @errors; }; if ($@) { if ($@ =~ /skipped(?: (.))?/) { # Skip this test? chop( my $loc = $@ ); dot $1 || '-', "$loc $testname\n"; if( !$dirtest ) { do_pl 'cleanup_script'; chdir $old_cwd; # Get back to the old directory. slow_rmtree $tdir; # Get rid of the test directory. } else { chdir $old_cwd; # Get back to the old directory. } next; } elsif ($@ =~ /^\S+$/) { # Just one word? my $loc = $@; $loc =~ s/\n//; # Strip off the trailing newline. dot undef, "$testname (at $loc)\n", $log; } else { dot undef, "$testname: $@", $log; } ++$n_failures; close TFILE; # or Cygwin will hang c_cat 'hint' if $hint && exists $file{hint}; chdir $old_cwd; # Get back to the old directory. rename $tdir => $tdir_failed unless $dirtest; last if $testname eq 'aaasimple'; # If this one fails something is very wrong } else { dot '.', "passed $testname\n"; $n_successes++; if( !$dirtest ) { do_pl 'cleanup_script'; chdir $old_cwd; # Get back to the old directory. slow_rmtree $tdir unless $keep; # Get rid of the test directory. } else { chdir $old_cwd; # Get back to the old directory. } } } print "\n" if defined $dotted; if( $n_failures && $hint ) { print "\n"; my $common = "\nIn the $basedir directory you will find details\nin the .log files and .failed directories.\n"; if( $n_failures > $n_successes ) { print $n_successes ? 'Fairly bad failure!' : 'Total failure!', $common; } else { print $n_failures > $n_successes / 2 ? 'Partial failure, but many things work, so makepp might be ok for you...' : 'Some failures, which possibly all have the same cause -- you are probably ok.', $common, < or B for build cache tests that were skipped because links don't work or MD5 is not available, B for a repository test skipped because symbolic links don't work or B for a Unix test skipped because you are on Windows. An B means the test can't be executed because that would require a Shell. If the test declares itself to not be relevant, that gives an B. Other reasons may be output as B<->. With the -v option it also gives info about the used Perl version and system, handy when parallely running this on many setups, and the used time for the runner (and Perl scripts it runs directly) on the one hand and for the makepp (and shell) child processes on the other hand. With the -? option help more available options are shown. A test is stored as a file with an extension of F<.test> (very economic and -- with some care -- editable spar format), or F<.tar>, F<.tar.bz2> or F<.tar.gz>. First a directory is created called F.tdir> (called the test directory below). Then we cd to the directory, then extract the contents of the tar file. This means that the tar file ought to contain top-level files, i.e., it should contain F<./Makeppfile>, not F.tdir/Makeppfile>. A test may also be the name of an existing directory. In that case, no archive is unpacked and no cleanup is performed after the test. The following files within this directory are important: =over 4 =item is_relevant.pl If this file exists, it should be a Perl script which return trueq if this test is relevant on this platform, and dies or false if the test is not relevant. The first argument to this script is the full path of the makepp executable we are testing. The second argument is the current platform as seen by Perl. The environment variable C is the path to the perl executable we are supposed to use (which is not necessarily the one in the path). =item makepp_test_script.pl / makepp_test_script If this file exists, it should be a Perl script or shell script which runs makepp after setting up whatever is necessary. If this script dies or returns false (!= 0 for shell), then the test fails. In a Perl script you can use the predefined function makepp() to run it with the correct path and wanted interpreter. It will die if makepp fails. You can also use the function wait_timestamp( file ... ), which will wait for both the local clock and the timestamp of newly created files to be at least a second later than the newest given file. You also have the function n_files, the first optional argument being a file name, where to write the count of built files, the second a sub that gets called for each log line so you can scan for messages. File::Copy's cp is also provided. The first argument to this shell script is the full path of the makepp executable we are testing. The environment variable C is the path to the perl executable we are supposed to use (which is not necessarily the one in the path). This script must be sufficiently generic to work in all test environments. For example: =over 4 =item * It must not assume that perl is in the path. Always use PERL or $PERL instead. =item * It must work with the Bourne shell, i.e., it may contain no bash extensions. =item * It must not use "echo -n" because that doesn't work on HP machines. But you should use &echo and other builtins for efficiency anyway. =back If this file does not exist, then we simply execute the command S>, so makepp builds all the default targets in the makefile. =item makeppextra.pm If present this module is loaded into perl before the script by the makepp function. See F for an example of output redirection. =item F or F Obviously this is kind of important. =item F Suggestions about what might be wrong if this test fails. =item answers This directory says what the result should be after running the test. Each file in the answers directory, or any of its subdirectories, is compared to a file of the same name in the test directory (or its corresponding subdirectory). The files must be exactly identical or the test fails. Files in the main test directory do not have to exist in the F subdirectory; if not, their contents are not compared. There is one special file in the F subdirectory: the file F should contain three integers in ASCII format which are the number of files that makepp ought to build, phony targets and that are expected to have failed. This is compared to the corresponding number of files that it actually built, extracted from the logfile F<.makepp/log>. =item cleanup_script.pl If this file exists, it should be a Perl script that is executed when the test is done. This script is executed just before the test directory is deleted. No cleanup script is necessary if the test directory and all the byproducts of the test can be deleted with just C and C. (This is usually the case, so most tests don't include a cleanup script.) =back =cut makepp-2.0.98.3/t/run_all.t0000755000175000017500000000765712107012037015465 0ustar pfeifferpfeiffer#!/usr/bin/env perl package Mpp; chdir 't'; # failure ignored, when called from here my %c; # CC=gehtnich CXX=gehtnich ./run_all.t @c{qw( c_compilation.test log_graph.test makeppreplay.test md5.test rule_include.test additional_tests/2003_10_11_idash.test additional_tests/2003_11_25_wild.test additional_tests/2004_02_19_repository_change.test additional_tests/2004_03_12_condscan.test additional_tests/2004_03_24_scanner_c_lib.test additional_tests/2004_11_02_repository_rmstale.test additional_tests/2004_12_06_scancache.test additional_tests/2004_12_17_idl.test additional_tests/2005_03_31_scanfail.test additional_tests/2005_07_12_build_cache_cp.test additional_tests/2006_12_07_scan_order.test additional_tests/2009_12_27_skip_word_unix.test )} = (); BEGIN { if( $^O =~ /^MSWin/ ) { require Win32API::File; Win32API::File::SetErrorMode( &Win32API::File::SEM_FAILCRITICALERRORS | &Win32API::File::SEM_NOOPENFILEERRORBOX ); } } use Config; (my $cmd = $0) =~ s!.*/!!; my $makepp = @ARGV && $ARGV[0] =~/\bm(?:ake)?pp$/ && shift; if( @ARGV && $ARGV[0] eq '-?' ) { print < if $b; push @ARGV, <*repository*.test */*repository*.test> if $R; @ARGV = @ARGV ? map { /\.test$/ ? $_ : "$_.test" } @ARGV : <*.test */*.test>; @ARGV = grep exists $c{$_}, @ARGV if $c; @ARGV = grep !exists $c{$_}, @ARGV if $C; @ARGV = grep !/stress_tests/, @ARGV if $S; unshift @ARGV, @opts, $T ? '-dvs' : '-ts'; print "$cmd @ARGV\n" if $ENV{DEBUG}; my $reason; if( $ENV{AUTOMATED_TESTING} || $^O =~ /^MSWin/ ) { # exec detaches a child process and exit immediately system $^X, $cmd, @ARGV; exit( $? >> 8 || $? ) unless $ENV{AUTOMATED_TESTING}; $reason = $? == -1 ? "failed: $!: system $^X, $cmd, @ARGV\n" : $? & 127 ? "died with signal $?: system $^X, $cmd, @ARGV\n" : $? ? "exited with value " . ($? >> 8) . ": system $^X, $cmd, @ARGV\n" : ''; } else { exec $^X, $cmd, @ARGV; die $!; } sub mail { my $a = 'occitan@esperanto.org'; open VERSION, "$^X ../makeppinfo --version|"; my $v = ; $v =~ /makeppinfo (?:(?:cvs-)?version|snapshot|release-candidate) ([^:\n]+)(.*)/s; my $s = "-s'$_[0] V$1' "; if( open MAIL, "| exec 2>/dev/null; mailx $s$a || nail $s$a || mail $s$a || /usr/lib/sendmail $a || mail $a" ) { print MAIL "$_[0] V$1$2\n$reason\n$v\n\n\@INC: @INC\n\n"; my %acc; for( sort keys %Config ) { next unless defined $Config{$_}; my $value = $Config{$_} eq $_ ? '~' : $Config{$_}; push @{$acc{$value}}, @{$acc{$value}} ? (/^${$acc{$value}}[-1](.+)/ ? "~$1" : $_) : $_ } print MAIL "@{$acc{$_}} => $_\n" for sort keys %acc; 1; } } # CPAN testers don't send success or error details my $v = sprintf $Config{ptrsize} == 4 ? 'V%vd' : 'V%vd-%dbits', $^V, $Config{ptrsize} * 8; my $perltype = $Config{cf_email} =~ /(Active)(?:Perl|State)/ ? $1 : $Config{ldflags} =~ /(vanilla|strawberry|chocolate)/i ? ucfirst lc $1 : ''; $v .= "-$perltype" if $perltype; (my $arch = $Config{myarchname}) =~ tr/ ;&|\\'"()[]*\//-/d; # clear out shell meta chars unless( $reason || <$v/*.{failed,tdir}> ) { mail "SUCCESS-$arch $v"; exit 0; } if( mail "FAIL-$arch $v" ) { open SPAR, "$^X spar -d - $v|"; undef $/; print MAIL "\nbegin 755 $arch-$v.spar\n" . pack( 'u*', ) . "\nend\n"; } exit 1; makepp-2.0.98.3/t/rule_include.test0000644000175000017500000000421711753741324017217 0ustar pfeifferpfeiffer### SPAR ### 4 755 1265715914 1265748017 is_relevant.pl # # Figure out if using a compiler where we know how to activate on-the-fly dep generation. # makepp 'CHECK_COMPILER=1'; ### 9 755 1265379162 1266604527 makepp_test_script.pl makepp 'B1H=1'; n_files 'n_files1'; rename 'a2.z', 'a.z'; makepp; n_files 'n_files2'; unlink 'b1.h'; makepp; ### 49 644 1265379162 1304620873 RootMakeppfile ifdef CHECK_COMPILER makeperl {{ POSIX::_exit '$(notdir $(CC))' !~ /\b(?:g|icc|xlc|cl(?!ang))/; }} endif DEP_SUFFIX = d OBJ_SUFFIX = o ifmakeperl '$(CC)' =~ /\bcl/ sub dependify {{ s/\$/\$\$/g; s/(Note: including file: *)?(.+?)\r?\n/$1 ? "'$2' " : "'".f_output()."': "/e; }} OBJ_SUFFIX = obj else ifmakeperl '$(CC)' =~ /\bxlc/ DEP_SUFFIX = u DEP_OPT = -M else DEP_OPT = -MD endif makepp_no_builtin = 1 $(phony all): a.x b.$(OBJ_SUFFIX) c.$(OBJ_SUFFIX) a.x: a.y :include a.$(DEP_SUFFIX) &echo 'a.x: a.y a.z' -o a.$(DEP_SUFFIX) &cat a.y a.z -o a.x b.h: &echo $(if $(B1H), '#include "b1.h"') -o $(output) # Dep must be eliminated when rereading b.c: &echo '#include "b.h"\nvoid f() {}' -o $(output) b.$(OBJ_SUFFIX): pre # Dep must not be forgotten when rereading, or would rebuild next time %.$(OBJ_SUFFIX): %.c :signature C :include %.$(DEP_SUFFIX) ifmakeperl '$(CC)' =~ /\bcl/ cl -showIncludes -c $(input) >$(stem).d &sed &dependify -o +<$(stem).d else ifperl Mpp::is_windows == 2 $(CC) $(DEP_OPT) -c $(input) -o $(output) else $(CC) $(DEP_OPT) -c $(input) -o $(output) # Must not pass comment to cc endif b.$(OBJ_SUFFIX): post # Dep must not be forgotten when rereading ### 0 644 1265379162 1265379162 b1.h ### 1 644 1265379162 1265668242 a.y y ### 1 644 1265379162 1265668277 a.z z ### 1 644 1265379162 1265668277 a2.z zz ### 2 644 1265379162 1265669395 c.c #include "b.h" void f() {} ### 0 644 1265379162 1265576341 pre ### 0 644 1265379162 1265576339 post ### D 755 1265379162 1265379162 answers ### 2 644 1265379162 1265668930 answers/a.x y zz ### 1 644 1265379162 1055628127 answers/n_files1 8 1 0 ### 1 644 1265379162 1055628127 answers/n_files2 7 1 0 ### 1 644 1265379162 1055628127 answers/n_files 0 1 0 makepp-2.0.98.3/t/repository.test0000644000175000017500000000253711144124453016757 0ustar pfeifferpfeiffer### SPAR ### 30 644 1163099194 1067750108 Makeppfile # # Test getting some files from the repository. # # Former 2005_07_28_mkdir_wildcard.test perl_begin Mpp::File::lstat_array Mpp::File::file_info 'repository'; mkdir 'repository/x2'; open(OUT, '>', 'repository/x2/f2') or die; close(OUT); perl_end repository repository r2=repository2 .PHONY: all all: c x c: a b r2/subdir/d &cat $^ e -o $@ # # This is a test of the idiom where a co-dependency is actually expressed # as a dependency. In this case, b does not depend on e, but things which # depend on b are supposed to depend on e. This is an ugly idiom. # b: e x: $(wildcard x*/*) &echo $(inputs) -o $(output) ### D 755 1067451878 970329180 repository ### 1 644 1067451878 966130046 repository/a a ### 1 644 1067451878 966130048 repository/b b ### 1 644 1067451878 966130051 repository/c c ### 1 644 1067451878 970329180 repository/e e ### D 755 1122589423 1122589408 repository/x1 ### D 755 1122589423 1122589408 repository/x1/f1 ### D 755 1067451878 966315000 repository2 ### D 755 1067451878 966314901 repository2/subdir ### 1 644 1067451878 966314901 repository2/subdir/d d ### D 755 1067451878 966133204 answers ### 4 644 1067451878 970329283 answers/c a b d e ### 1 644 1067451878 1190053924 answers/n_files 2 1 0 ### 1 644 1122590442 1122590513 answers/x x1/f1 x2/f2 makepp-2.0.98.3/t/recursive_variants.test0000644000175000017500000000330211514621761020452 0ustar pfeifferpfeiffer### SPAR ### 1 755 1067749983 1210350510 is_relevant.pl !is_windows || is_windows == -1 ### 9 755 1293761335 1293819567 makepp_test_script.pl # # Test how many Makefiles recursive makes handle in the original process. # makepp qw(--traditional); n_files 'n_files_0'; makepp qw(--hybrid hybrid); n_files 'n_files_1'; makepp 'smart'; 1; ### 6 644 1293762729 1293819297 Makefile perl { $Mpp::main_process = 1; # recognize this instance } $(foreach): :foreach traditional hybrid smart $(MAKE) -Cdir $(output) ### 2 644 1236523730 1237488485 hint This tests the old fashioned way of doing multi-directory builds. The failure does not imply that the makepp-way of doing things is broken. ### D 755 1236523730 1237488485 dir ### 6 644 1293762729 1293819378 dir/Makefile $(phony smart): &expr $$Mpp::main_process || 2 -o ../$(output) $(foreach): :foreach $(phony traditional hybrid) &expr $$Mpp::main_process || 2 -o ../$(output) $(MAKE) -f Makefile2 $(output) ### 3 644 1293762729 1293821694 dir/Makefile2 $(foreach): :foreach $(phony traditional hybrid) &expr $$Mpp::main_process || 2 -o >>../$(output) $(MAKE) -Csubdir $(output) ### D 755 1293762729 1293821071 dir/subdir ### 2 644 1293762729 1293829275 dir/subdir/Makefile $(foreach): :foreach $(phony traditional hybrid) &expr $$Mpp::main_process || 2 -o >>../../$(output) ### D 755 1067451878 1078122199 answers ### 3 644 1293791624 1293791624 answers/hybrid 1 2 1 ### 1 644 1293791624 1293818003 answers/smart 1 ### 3 644 1293791635 1293791635 answers/traditional 2 2 2 ### 1 644 1067451878 1291317183 answers/n_files 1 1 0 ### 1 644 1078122192 1190052203 answers/n_files_0 1 0 0 ### 1 644 1078122192 1190052203 answers/n_files_1 1 2 0 makepp-2.0.98.3/t/recursive_rules.test0000644000175000017500000000076410674045031017762 0ustar pfeifferpfeiffer### SPAR ### 9 644 1067451878 987381821 Makefile $(phony all): x.gasp.gasped.s %.gasp.s: %.s &echo 'Gasp!' -o $@ &cat $^ -o>>$@ %.gasped.s: %.s &echo "Already gasped." -o $@ &cat $^ -o>>$@ ### 1 644 1067451878 987381788 x.s test ### D 755 1067451878 987382350 answers ### 3 644 1067451878 987382331 answers/x.gasp.gasped.s Already gasped. Gasp! test ### 1 644 1067451878 1190053918 answers/n_files 2 1 0 ### 2 644 1067451878 987382331 answers/x.gasp.s Gasp! test makepp-2.0.98.3/t/recursive_make.test0000644000175000017500000000430511505120162017531 0ustar pfeifferpfeiffer### SPAR ### 1 755 1067749983 1210350510 is_relevant.pl !is_windows || is_windows == -1 ### 10 755 1164320211 1190054144 makepp_test_script.pl # # A simple test of recursive make. # # Run the test twice. We had some obscure bugs where recursive make # didn't work the second time around, which this should catch correctly. # makepp; n_files 'n_files_0'; makepp; 1; ### 33 644 1164353230 1291316814 RootMakeppfile XVAR = 1 # Gets overridden on the command line. .PHONY: all all: a b f %: subdir1/% : foreach subdir1/? # foreach necessary to exclude Makefile. &cp $< $@ # Test passing a variable through the environment to recursive make. subdir1/a subdir1/b: cd subdir1 && EVAR=evar $(MAKE) YVAR=2 XVAR=3 $(notdir $@) subdir1/c: d &cat e -o $@ &echo c -o>>$@ # # Test waiting for recursive make to finish. # This is a hack that will reexecute recursive make but won't change the file. # d: $(MAKE) e test -f d || touch d e: &echo $@ $(XVAR) -o $@ load_makefile subdir2 # Test migration phase with explicit load and $(MAKE) f: g X=x $(MAKE) -Csubdir2 &cp subdir2/f ### 2 644 1236523730 1237488485 hint This tests the old fashioned way of doing multi-directory builds. The failure does not imply that the makepp-way of doing things is broken. ### D 755 1067451878 1078122244 subdir1 ### 13 644 1067451878 1291316867 subdir1/Makefile a: &echo a $(EVAR) $(XVAR) -o $@ b: c &cat c -o $@ &echo b $(YVAR) -o >>$@ # # This should not override a rule in the upper level makefile, because it # invokes recursive make. # c: cd .. && $(MAKE) subdir1/$@ ### D 755 1291315990 1291315990 subdir2 ### 8 644 1291315990 1291316858 subdir2/Makefile perl { $VAR = '' unless defined $VAR } # Ensure initial emptyness VAR += foo # Reloading used to double this f: &echo f -o $@ ../g: &echo g $(VAR) -o $@ ### D 755 1067451878 1078122199 answers ### 1 644 1067451878 1291315433 answers/a a evar 3 ### 3 644 1067451878 978378259 answers/b e 1 c b 2 ### 1 644 1067451878 978378259 answers/e e 1 ### 1 644 1291315990 1291316308 answers/f f ### 1 644 1291315990 1291316308 answers/g g foo ### 1 644 1067451878 1291317183 answers/n_files 3 1 0 ### 1 644 1078122192 1190052203 answers/n_files_0 11 1 0 makepp-2.0.98.3/t/perl.test0000644000175000017500000000411012002471673015472 0ustar pfeifferpfeiffer### SPAR ### 67 644 1067451878 1217599890 Makeppfile # # This file tests the perl(_begin) statement, the sub statement, # the perl function and perl actions. # $(phony all): statements function oneline multiline rule-script.out perl_begin *{'f_xyz._'} = sub { "xyz" } perl_end perl { sub f_foo { return "foo"; } } # A one-line Perl statement. sub f_abc { return "abc"; } # A one-line sub statement. statements: &echo $(xyz.-) $(abc) $(def-.) $(foo) $(bar) -o $@ sub f_jkl # A multi-line sub statement. { return "jkl"; } perl { # A multi-line Perl statement. sub f_bar { return "bar"; } } sub f_ghi {{ # A double-paren sub statement. return 'ghi'; }} perl # A double-paren Perl statement. {{ *{"f_def-."} = sub { 'def' }; }} perl { $Mpp::pid = $$; run qw(script.pl statement-script.out b); } function: &echo $((makeperl scalar reverse( '$(abc):$(xyz.-)' ) )) ${perl f_foo . f_bar} -o $@ &echo ${perl f_ghi . f_jkl} -o>>$@ oneline: makeperl { open my $$f, '>$(output)'; print $$f "single1\n" } perl { open my $f, '>>' . f_output; print $f "single2\n" } multiline: makeperl {{ open my $$f, '>$(output)'; print $$f "multi1\n"; }} perl {{ open my $f, '>>' . f_output; print $f "multi2\n"; }} rule-script.out: makeperl {{ $$Mpp::pid = $$$$; # How much is that in Euros? :-) }} &script.pl $(output) d ### 2 755 1067451878 1066077772 script.pl open my $f, ">>$ARGV[0]" or die "open $ARGV[0]: $!"; print $f "$0: running $ARGV[1] (", $Mpp::pid == $$ ? 'same' : 'different', " pid)\n"; ### D 755 1067451878 1066078592 answers ### 2 644 1067451878 1066078500 answers/function zyx:cba foobar ghijkl ### 1 644 1067451878 1190053907 answers/n_files 5 1 0 ### 2 644 1067451878 1066078086 answers/multiline multi1 multi2 ### 1 644 1104006511 1209131381 answers/statement-script.out script.pl: running b (same pid) ### 1 644 1067451878 1209131415 answers/rule-script.out script.pl: running d (same pid) ### 1 644 1067451878 1066078086 answers/statements xyz abc def foo bar ### 2 644 1067451878 1066078086 answers/oneline single1 single2 makepp-2.0.98.3/t/pattern_rule.test0000644000175000017500000000701310674045031017237 0ustar pfeifferpfeiffer### SPAR ### 3 644 1181596243 1181903567 makepp_test_script.pl eval { makepp 'abc.inaa' } and die; eval { makepp 'a.xaa' } and die; makepp; ### 92 644 1175559408 1181906278 Makeppfile # # This makeppfile tests pattern rules. # .PHONY: all INFILES = abc def xyz all: $(INFILES).out2 a.x b.x xyz.lc live.yoghurt abc.ina a.xa a.n # Potential endless loop shall abort both based on files already existing and # on ones to be discovered in the future. %a: % &cp -l $(input) $(output) # static pattern rule a.x b.x : %.x : %.y &cat $^ -o $@ a.y b.y : &echo $@ -o $@ # # A pattern rule that builds off another pattern rule, and also has # two pattern dependencies: # %.out2: %.out %.in &echo $@ -o $@ &cat $^ -o>>$@ # # A pattern rule that overrides another pattern rule: # x%.out2: x%.out &echo $@ -o $@ &echo "(File $@ is another exception.)" -o>>$@ &cat $^ -o>>$@ # # GNU make style pattern rule. Note that this tests using an alternate name # for the directory. # %.out: ./%.in &echo $@ -o $@ &cat $^ -o>>$@ # # Another GNU make style pattern rule. Here the pattern is in the second dependency. # %.yoghurt: bacteria ./%.cream &echo $@ -o $@ &cat $^ -o>>$@ # # Pattern rule overridden by a explicit rule: # xyz.out: xyz.in subdir/percent_subdirs_test &echo $@ -o $@ &echo "(File $@ is an exception.)" -o>>$@ &cat $^ -o>>$@ # # Do mixed case rules work, especially when not case sensitive? # %.Uc: %.in &cp -l $(input) $(output) %.lc: %.Uc &cp -l $(input) $(output) # Long chain, partially ordered forward, partially backward: %.q: %.r &cp -l $(input) $(output) %.p: %.q &cp -l $(input) $(output) %.o: %.p &cp -l $(input) $(output) %.n: %.o &cp -l $(input) $(output) %.r: %.s &cp -l $(input) $(output) %.s: %.t &cp -l $(input) $(output) %.t: %.u &cp -l $(input) $(output) %.u: %.v &cp -l $(input) $(output) %.v: %.w &cp -l $(input) $(output) %.w: %.x &cp -l $(input) $(output) ### 1 644 1175559408 965501121 abc.in abc ### 1 644 1175559408 1175558557 bacteria must be present for good live yoghurt ### 1 644 1175559408 965501124 def.in def ### 1 644 1175559408 1175558557 live.cream rich, creamy goodness ### 1 644 1175559408 965501136 xyz.in xyz ### D 755 1175559408 990032657 subdir/ ### 12 644 1175559408 990032469 subdir/Makeppfile # # This file tests pattern rules with the percent_subdirs turned on, so # the same rule applies to several subdirectories. # makepp_percent_subdirs = 1 # Allow % to refer to subdirectories, too. %.out: %.in &echo $@ -o $@ &cat $^ -o>>$@ percent_subdirs_test : **/*.out &cat $^ -o>>$@ ### 24 644 1175559408 990032639 subdir/percent_subdirs_test suba/a.out a suba/subb/b.out b subc/c.out c suba/a.out a suba/subb/b.out b subc/c.out c suba/a.out a suba/subb/b.out b subc/c.out c suba/a.out a suba/subb/b.out b subc/c.out c ### D 755 1175559408 990032657 subdir/suba/ ### 1 644 1175559408 990031804 subdir/suba/a.in a ### D 755 1175559408 990032657 subdir/suba/subb/ ### 1 644 1175559408 990031797 subdir/suba/subb/b.in b ### D 755 1175559408 990032657 subdir/subc/ ### 1 644 1175559408 990031835 subdir/subc/c.in c ### D 755 1175559459 1175559461 answers/ ### 1 444 1175559408 1104356247 answers/a.x a.y ### 1 444 1175559408 1104356247 answers/a.y a.y ### 1 444 1175559408 1104356247 answers/b.x b.y ### 1 444 1175559408 1104356247 answers/b.y b.y ### 3 644 1175559408 1175558694 answers/live.yoghurt live.yoghurt must be present for good live yoghurt rich, creamy goodness ### 1 644 1175559408 1190053902 answers/n_files 29 1 0 ### 1 444 1175559408 1104356247 answers/xyz.lc xyz makepp-2.0.98.3/t/parallel.test0000644000175000017500000000421511011262642016323 0ustar pfeifferpfeiffer### SPAR ### 1 755 1067749983 1210350510 is_relevant.pl is_windows < 1 # ActiveState doesn't separate STDOUTs and stumbles over mpp -j ### 10 755 1067451877 1184533865 makepp_test_script.pl # This is a test of parallel make. In order to test that make is actually # executing jobs in parallel, we rely on timing to synchronize jobs, which # isn't 100% reliable. # # This script is designed to be run with -j 2, so we know that at most 2 # jobs are running. eval { makepp '-kj2' } and die; 1; ### 55 644 1164352976 1184534747 Makeppfile perl { unlink 'b', 'c'; sub c_waitfor { my $hires = eval { require Time::HiRes }; while( ! (stat $_[0])[7] ) { if( $hires ) { Time::HiRes::sleep( .1 ); } else { select undef, undef, undef, .1; } } } } $(phony all): a z a: b c &cat $^ -o $@ # # Commands to execute b and c should run in parallel, but commands to execute # a should wait for them. The final contents of b and c will differ depending # on whether the build commands were executed in parallel or in serial. # This is because we've lied to makepp about which files are modified. # b: @&echo building b &echo b -o>>b &waitfor c @&echo b is modifying c &echo b -o>>c c: @&echo building c &echo c -o>>c &waitfor b @&echo c is modifying b &echo c -o>>b # Before 07-07-15 two files were enough to make this fail, as long as the 2nd # dependency succeeded. The order of execution being somewhat random, lets # have 6 deps, just to be sure. Failure meant trying to build z, despite # failed deps. y z: $( u v w x y z).out &echo Must not get here -o y &cat $(inputs) -o z %.out: %.in &cp -l $(input) $(output) v.out x.out: %.out: %.in &expr 0 ### 0 644 1184533342 1184533342 u.in ### 0 644 1184533342 1184533342 v.in ### 0 644 1184533342 1184533342 w.in ### 0 644 1184533342 1184533342 x.in ### 0 644 1184533342 1184533342 y.in ### 0 644 1184533342 1184533342 z.in ### D 755 1067451877 971218421 answers ### 4 644 1067451877 971218395 answers/a b c c b ### 2 644 1067451877 971218393 answers/b b c ### 2 644 1067451877 971218393 answers/c c b ### 1 644 1067451877 1190051786 answers/n_files 7 0 2 makepp-2.0.98.3/t/only_targets.test0000644000175000017500000000323110674045031017243 0ustar pfeifferpfeiffer### SPAR ### 22 644 1164351845 1082033129 Makeppfile # # A test of the only_targets, only_phony_targets and only_nontargets subroutines. # $(phony all): a x a: &echo $(only_targets ? subdir/*) -o $@ &echo $(only_nontargets ? subdir/*) -o>>$@ &echo $(only_targets **/a) -o>>$@ &echo $(only_phony_targets **/a) -o>>$@ &echo $(only_phony_targets **/a*) -o>>$@ $(foreach) : subdir/* : foreach b c d e f g &cat $^ -o $@ # This is the former 2004_04_19_onlyphony.test x: &echo $(only_phony_targets dir/bar) -o $@ &echo $(only_phony_targets */bar) -o>>$@ &echo $(only_phony_targets dir/*) -o >>$@ &echo $(only_phony_targets */*) -o >>$@ ### D 755 1082033157 1082032506 subdir/ ### 0 644 1067451877 966117638 subdir/h ### 0 644 1067451877 966117638 subdir/i ### 0 644 1067451877 966117638 subdir/j ### 0 644 1067451877 966117638 subdir/k ### D 775 1082033157 1082033012 subdir/x/ ### 2 664 1082032967 1082032967 subdir/x/Makeppfile a: never do this ### D 775 1082033157 1082033012 subdir/y/ ### 2 664 1082033012 1082033012 subdir/y/Makeppfile $(phony a): never do this ### D 775 1082033157 1082033018 subdir/z/ ### 2 664 1082033018 1082033018 subdir/z/Makeppfile $(phony a): never do this ### D 755 1082399429 1082399562 dir ### 2 644 1082397913 1082397912 dir/Makeppfile $(phony bar): @&echo bar ### D 755 1082033157 1082033070 answers/ ### 5 644 1082033063 1082033063 answers/a a b c d e f g x subdir/h subdir/i subdir/j subdir/k subdir/x subdir/y subdir/z a subdir/x/a subdir/y/a subdir/z/a subdir/y/a subdir/z/a all ### 4 644 1082399441 1082399441 answers/x dir/bar dir/bar dir/bar dir/bar ### 1 644 1067451877 1190053898 answers/n_files 2 1 0 makepp-2.0.98.3/t/md5.test0000644000175000017500000001010412067357153015224 0ustar pfeifferpfeiffer### SPAR ### 1 644 1329052295 1329052295 is_relevant.pl have_cc ### 36 644 1356724506 1356724506 makepp_test_script.pl # Tests several things about C compilation: # 1) Correctly parsing command lines to scan for include files. # 2) Correctly calculating checksums so if files change we do not # rebuild, but we always rebuild when necessary. # 3) Iteration 13 does not recompile even though signature would be # different, because file did not change, so it was not recalculated. # 4) The builtin rules work. # # Replace the .c file multiple times and see which replacements trigger a rebuild. my $obj; my @args = ('makepp_signature_C_flat=0', is_windows ? '--no-path-exe-dep' : ()); my $compiled; for $iter ( 0..3, 13, 10 ) { # 13 & 10 repeat 3 & 0, but with flat option c_sed 's/ 0 / 1 /', "-o+ iteration_$iter"; $obj ||= is_windows && -f 'compilation_test.obj' ? 'obj' : 'o'; c_grep 'm@subdir1/x2\.h@', ".makepp/compilation_test.$obj.mk" unless $iter; # Make sure makepp found x2 in subdir1, not in the # main directory. Always same, so just on 1st round. $compiled = "0 0 0\n" ne n_files "n_files_$iter", !$iter && sub { die if /warning: can't locate file/ }; # Make sure makepp found all include files. } 1; ### 10 644 1067451873 1055627995 compilation_test_0.c #include #include "x.h" #include "y.h" int main() { printf("%d %d %d %d\n", __LINE__, X, X2, Y); return 0; } ### 10 644 1067451873 1055628000 compilation_test_1.c #include #include "x.h" #include "y.h" /* Same except that a comment was added. */ int main() { printf("%d %d %d %d\n", __LINE__, X, X2, Y); return 0; } ### 11 644 1067451873 1055628006 compilation_test_2.c #include #include "x.h" #include "y.h" /* Line count has changed! Should recompile if not flat option. */ int main() { printf("%d %d %d %d\n", __LINE__, X, X2, Y); return 0; } ### 11 644 1067451873 1055628020 compilation_test_3.c #include #include "x.h" #include "y.h" /* Only whitespace has changed. No recompilation. */ // This is a C++ comment int main() { printf("%d %d %d %d\n", __LINE__, X, X2, Y); /* another comment that is ignored */ return 0; } ### D 755 1067451873 1056139580 subdir1 ### 6 644 1067451873 1055626466 subdir1/Makeppfile x.h: &echo '#define X 1' -o $(output) &echo '#include "x2.h"' -o >>$(output) x2.h: &echo '#define X2 2' -o $(output) ### D 755 1067451873 1056139580 subdir2 ### 8 644 1067451873 1055626463 subdir2/Makeppfile x.h: &echo '#define X 99' -o $(output) x2.h: &echo '#define X2 100' -o $(output) y.h: &echo '#define Y 4' -o $(output) ### 2 644 1067451873 1055551960 x2.h /* This file should be ignored. */ #define X2 3 ### D 755 1067451873 1055628127 answers ### 1 644 1067451873 1055628033 answers/iteration_0 8 1 2 4 ### 1 644 1067451873 1055628036 answers/iteration_1 8 1 2 4 ### 1 644 1067451873 1055628038 answers/iteration_2 9 1 2 4 ### 1 644 1067451873 1055628041 answers/iteration_3 9 1 2 4 ### 1 644 1356724506 1356724506 answers/iteration_13 9 1 2 4 ### 1 644 1356724506 1356724506 answers/iteration_10 8 1 2 4 ### 1 644 1067451873 1190053877 answers/n_files_0 5 0 0 ### 1 644 1067451873 1190053880 answers/n_files_1 0 0 0 ### 1 644 1067451873 1190053884 answers/n_files_2 2 0 0 ### 1 644 1067451873 1190053887 answers/n_files_3 0 0 0 ### 1 644 1356724506 1356724506 answers/n_files_13 0 0 0 ### 1 644 1356724506 1356724506 answers/n_files_10 2 0 0 makepp-2.0.98.3/t/makeppreplay.test0000644000175000017500000001001112016413572017216 0ustar pfeifferpfeiffer### SPAR ### 1 644 1329052295 1329052295 is_relevant.pl have_cc ### 36 644 1227216359 1342861520 makepp_test_script.pl # This test creates some files, also in other dirs, messes them up and wants mppr to recreate them. local $ENV{X} = 0; # Set up a dependency mpp won't know about. local $ENV{C} = 1; eval { makepp '-k' }; c_cp qw(out out1); c_cp qw(a b); # Mess up results a bit. unlink qw(c dir/e x.c); $ENV{X} = 1; # Do a change mpp wouldn't have done. $ENV{C} = 0; # Signatures get adjusted, but because mppr doesn't scan x.c, mpp must, to notice x1.h. for my $file ( qw(dd y.c) ) { # Perform some editing, a standard use case for mppr. c_sed 's/y0/y/', "-o+<$file"; # Use y.h instead of y0.h, which mppr ignores so mpp must rescan. } wait_timestamp 'a'; # Can have same signature after rebuilding in same second. eval { makepp \'replay', qw(-kI. -Mmod=c_cmd MYVAR=5 a -Cdir . -c b c bb cc d xreal.c x.c), <[xy].o{,bj}>, <[xy]{,.exe}>, 'out' } and die; # Use glob to match Unix or Windows files. c_cp qw(out out2); c_cp qw(cc cc0); $ENV{C} = 1; wait_timestamp qw(x.o y.o); # Can have same signature after rebuilding in same second. eval { makepp '-k' }; -f '.makepp/x1.h.mk' or die "missing .makepp/x1.h.mk\n"; # Make sure all rescan flags have been cleared. my $rescan = 0; local @ARGV = <.makepp/*.mk dir/.makepp/*.mk>; local $/; /^RESCAN=/m and $rescan++ while <>; die 'rescan' if $rescan != 5; # a, d, dir/e, dir/f & xreal.c don't need scanning, so they don't lose this flag. 1; ### 2 644 1327960486 1327960486 hint Ccache at least up to version 3.1.7 is known to fail this test on "out", bug report https://bugzilla.samba.org/show_bug.cgi?id=8728 refers. ### 35 644 1227216620 1229020504 RootMakeppfile.mk $(phony all): a c cc d dir/$( e f) out load_makefile dir # needed for a b c: &echo b -o b &expr 0 -o c # creates c but fails bb cc: &echo bb -o bb &expr $$ENV{C} -o cc # creates cc but fails depending on C perl { use mod qw(c_cmd) } d: MYVAR=5 d: dd &cmd d export E=5 dir/e: :env E # check that mppr remembers E &expr &f_ROOT.$$ENV{E} -o $(output) xreal.c: &expr 'qq!#include \n#include "x$$ENV{X}.h"!' -o $(output) x.c: xreal.c &cp -fs --verbose $(input) $(output) # Test symlink if available CFLAGS = -Idir # Make dir/y.h a candidate, but not the one mpp would have chosen. y.h: # Same dir has precedence, so the scanner will have this one created. &echo '#define STR "C"' -o y.h out: .$/x > out .$/y >>out ### 16 644 1227207921 1228997339 mod.pm package mod; require Exporter; @ISA = qw(Exporter); @EXPORT_OK = qw(c_cmd); sub c_cmd { open my $fh, '>', $_[0] or die $!; print $fh "$_[0]: " . join( ' ', map $Mpp::Subs::rule->{MAKEFILE}->expand_variable( $_ ), qw(LD MYVAR) ); # Pick up a standard and a target specific var. close $fh; } 1; ### 1 644 1228321990 1228590123 dd a dep with no special scanner, to edit: y0 ### 1 644 1228321911 1228159851 x0.h int main() { puts("a"); return 0; } ### 1 644 1228321990 1228160207 x1.h int main() { puts("b"); return 0; } ### 3 644 1228321990 1228778886 y.c #include #include "y0.h" int main() { puts(STR); return 0; } ### 1 644 1228321911 1228336626 y0.h #define STR "A" ### D 755 1227216633 1227216621 dir/ ### 5 644 1227216339 1227216284 dir/makefile ../a: echo a>$(output) f: &expr &f_ROOT -o $(output) ### 1 644 1228321911 1228336626 dir/y.h #define STR "B" ### D 755 1227216644 1227216633 answers/ ### 1 644 1227216633 1227216621 answers/a a ### 1 644 1227216633 1227216621 answers/b b ### 1 644 1227216633 1227216621 answers/c 0 ### 1 644 1227216633 1227216621 answers/cc 1 ### 1 644 1227216633 1227216621 answers/cc0 0 ### -1 644 1227216633 1227216621 answers/d d: ld 5 ### 2 644 1227216633 1228779604 answers/out b C ### 2 644 1227216633 1228779602 answers/out1 a A ### 2 644 1227216633 1228779600 answers/out2 b B ### 1 644 1067451873 1228322580 answers/n_files 8 0 2 ### D 755 1227216644 1227216633 answers/dir/ ### 1 644 1227216633 1227216621 answers/dir/e .5 ### 1 644 1227216633 1227216621 answers/dir/f .. makepp-2.0.98.3/t/make_makefile.test0000644000175000017500000000162511500522551017304 0ustar pfeifferpfeiffer### SPAR ### 3 644 1290955743 1290955952 makepp_test_script.pl # Check that the makefile gets rebuilt, but that its dep does not issue a dup rule warning. makepp; n_files "n_files", sub { die if /warning: I became aware of the rule/ }; ### 9 644 1164352851 1290955502 Makefile # # This is an out-of-date makefile which gets replaced. # $(phony all): a a: &touch $(output) include Make_Makefile ### 7 644 1164352913 1290955503 Makefile_source # # This is the real makefile, which replaces the out-of-date version # $(phony all): a b a b: &touch $(outputs) ### 5 644 1164352913 1290955505 Make_Makefile Makefile: Makefile.in &cp $< $@ Makefile.in: Makefile_source Make_Makefile &cat $(inputs) -o $@ ### D 755 1067451876 965613096 answers ### 0 644 1067451876 1169482133 answers/a ### 0 644 1067451876 1169482265 answers/b ### 1 644 1067451876 1190053860 answers/n_files 4 1 0 makepp-2.0.98.3/t/loop.test0000644000175000017500000000267112111364465015514 0ustar pfeifferpfeiffer### SPAR ### 1 755 1358594656 1358594656 is_relevant.pl is_windows < 1 # ActiveState doesn't have WUNTRACED ### 30 755 1358594656 1361413899 makepp_test_script.pl # This tests multiply waiting for a looping mpp that stops itself. # It must correctly recognize changes, like a newly started mpp would. use POSIX 'WUNTRACED'; my $pid = fork; if( $pid ) { waitpid $pid, WUNTRACED; kill 'CONT', $pid; waitpid $pid, WUNTRACED; n_files 'n_files1'; c_cp 'a', 'a1'; unlink 'b'; kill 'CONT', $pid; waitpid $pid, WUNTRACED; n_files 'n_files2'; c_cp 'd', 'e'; kill 'CONT', $pid; waitpid $pid, WUNTRACED; n_files 'n_files3'; # Explicitly in case CONT wakes it up kill $_, $pid or last for qw(TERM CONT KILL); # Be sure it's gone waitpid $pid, 0; } else { exec PERL, '-w', $makepp_path, '--loop'; } 1; ### 10 644 1358594656 1361052227 Makeppfile signature md5 # In case rebuild occurs in new second. a: b &sed s/(b)/$$1a/ b -o a # Don't reexpand on next iteration b: c &cut -c0..2 c -o b c: d e &cat d e -o c ### 1 644 1358594656 1358594656 d abcde ### 1 644 1358594656 1358594656 e bb ### D 755 1358594656 1358594656 answers ### 2 644 1358594656 1358594656 answers/a abac abac ### 2 644 1358594656 1358594656 answers/a1 abac bab ### 1 644 1358594656 1358594656 answers/n_files1 3 0 0 ### 1 644 1358594656 1358594656 answers/n_files2 1 0 0 ### 1 644 1358594656 1361413915 answers/n_files3 3 0 0 makepp-2.0.98.3/t/log_graph.test0000644000175000017500000014203612016712620016477 0ustar pfeifferpfeiffer### SPAR ### 2 644 1216325548 1337890922 is_relevant.pl (Cwd::cwd =~ tr!/!!) > 3 && # Deep enough with tdir for rewriting cwd 4 levels? have_cc ### 50 644 1170452082 1345985645 makepp_test_script.pl { open my $fh, '>', 'c/c.h' } utime 0, 0, 'c/c.h'; # Make sure this exists (because makeppclean removes it) and is old. if( (stat 'c/c.h')[9] ) { # mtime unchanged on this fs (but utime may have lied in its return code) wait_timestamp 'c/c.h'; # Wait for a newer second than mtime to start. open my $fh, '+<', 'c/c.h.in'; print $fh '#'; # Rewrite first char to force mtime change. } makepp '--dont-build=/', '--do-build=.'; # Can't have a RootMakeppfile because that sorts output # differently on a case insensitive fs or Ebcdic, so explicitly # protect against logging stuff outside of our build system. c_grep '-v', '/changed without my knowledge/ .. /but you got lucky/', '-o+<.makepp/log'; makepp \'log', '-ciKnuokey.txt', '-k!PARSE !NOT_FOUND !VERSION'; # $(CC) varies and thus the parsed cmd # and $(FC) may not be found on Windows. makepp \'log', '-cipuolog.txt', '-k!LEX_RULE !PARSE !SCAN* !NOT_FOUND !VERSION'; makepp \'graph'; # The loaded modules trigger some magic, efficiently creating more variants than the options ask for. sub makeppgraph($) { my( $file, @args ) = @{$_[0]}; makepp \'graph', '-Mall_types', "-o$file.udg", @args; } makeppgraph $_ for [full => '-l.makepp/log', '-bDir', '&cwd || &makepp'], [suf => '-l.makepp/', '-Dir', '(&cwd || undef $_) && &suf'], [dir => '-l.makepp', '-bDir', '&dir && (&cwd || &makepp)'], [dirplain => '-l.makepp', '-bDipr', '&dir && (&cwd || &makepp)'], [dirsep => '-l.makepp', '-bDisr', '&dir && (&cwd || &makepp)'], [dirsepplain => '-l.makepp', '-bDispr', '&dir && (&cwd || &makepp)'], (is_windows < 1 ? [both => '-Mboth_up_down', '-l.', '-bDi', 'c/c.h', 'makepp.mk'] : ()); # b/b.o gets added to up by both_up_down if( is_windows ) { if( is_windows > 0 ) { makeppgraph $_ for # both_up_down fork hack doesn't work, so do one by one. [both => '-l.', '-bDi', 'c/c.h', 'makepp.mk'], [down => '-l.', '-bDid', 'c/c.h', 'makepp.mk'], [up => '-l.', '-bDiu', 'c/c.h', 'makepp.mk', 'b/b.o', 'b/b.obj']; unlink 'answers/rewrite.txt', # Tests Unix dirs that don't exist. ; # For lack of reliable redirection in fork, we don't produce these files. } for my $file ( <{both,full,key,log,suf,up}?{dot,html,txt,udg}> ) { # ? -> pattern, only existing files c_sed 's/.*makepp_builtin_rules\.mk:(?:3[67]|42)\b.*//s || s/\.obj\b/.o/g', "-o+<$file"; } } 1; ### 29 644 1170452082 1185994720 makefile perl { $Mpp::CommandParser::ignore_exe = 1; # Don't have some path to compiler in log } include makepp.mk include makepp1.mk ifeq a 1 or ifeq a,2 or ifeq(a,a) $(phony all): a endif # force a BECAUSE edge c/c.h: c/c.h.in: build_check target_newer &cp -fl $(input) $(output) _OBJ_SUFFIX := $(filter %cl %cl.exe %bcc32 %bcc32.exe, $(CC)) ifdef _OBJ_SUFFIX _OBJ_SUFFIX := .obj else _OBJ_SUFFIX := .o endif a: $( a b/b c/c)$(_OBJ_SUFFIX) $(infer_linker $(inputs)) $(inputs) $(LDLIBS) $(LDFLAGS) $(LIBS) -o $(output) ifperl Mpp::is_windows &mv a.exe a endif ### 2 644 1236523730 1237488299 hint This tests neat utilities for analyzing your build. The failure likely does not imply a problem with makepp itself. ### 1 644 1170452082 1166207798 makepp.mk include makepp1.mk ### 0 644 1170452082 1166207809 makepp1.mk ### 78 644 1170452082 1234386321 both_up_down.pm use Mpp::File; sub rewrite_test { my $pref = absolute_filename $CWD_INFO; package Mpp::Rewrite; my $result = "cwd:\n"; for my $arg ( 0, 1, 2, 4 ) { for my $file ( '', qw(/ /a /a/b) ) { local $_ = $pref.$file; cwd $arg or die "failed cwd $arg: $_\n"; $result .= " $_"; $_ = $pref.$file; cwd $arg, ':' or die "failed cwd $arg, ':': $_\n"; $result .= " $_"; $_ = $pref.$file; cwd $arg, ':', '' or die "failed cwd $arg, ':', '': $_\n"; $result .= " $_"; } $result .= "\n"; $pref =~ s!/[^/]+$!!; } $result .= "dir:\n"; for( qw(/ /bin /usr/bin /usr/bin/id /a/b/c |a| |a|b |a|b/c |a|b/c/d) ) { local $_ = $_; &dir; $result .= "$_\n"; } $result .= "usr:\n"; for( qw(/lib /bin /usr/lib /usr/share /usr/local/include /usr/local/lib /usr/X11/bin /usr/X11R6/lib /nogo /tmp/nogo) ) { for my $file ( '', qw(a a/b a/b/c) ) { local $_ = $file ? "$_/$file" : $_; &usr; $result .= " $_"; } $result .= "\n"; } $result .= "suf:\n"; for( qw(f.x a/f.x a/b/f.x a/b/c/f.x /f.x /a/f.x /a/b/f.x /a/b/c/f.x ~/f.x ~/a/f.x ~/a/b/f.x ~/a/b/c/f.x ~a/f.x ~a/b/f.x ~a/b/c/f.x |a|f.x |a|b/f.x |a|b/c/f.x) ) { $result .= $_; for my $arg (-3, -2, -1, undef, 0, 1, 2, 3) { local $_ = $_; suf $arg; $result .= (defined $arg ? " $arg:" : ' undef:') . $_; } $result .= "\n"; } open my $fh, '>rewrite.txt'; print $fh $result; } $Mpp::both_up_down = sub { &rewrite_test; my( $outfile, $up, $down ) = @_; if( Mpp::is_windows > 1 ) { } elsif( !fork ) { if( !fork ) { $$up = 1; push @ARGV, 'b/b.o', Mpp::is_windows ? 'b/b.obj' : (); $$outfile =~ s/\bboth\b/up/; } else { wait; $$down = 1; $$outfile =~ s/\bboth\b/down/; } open STDOUT, '>', $$outfile or die "can't write `$$outfile'--$!"; } else { wait; } } ### 23 644 1170452082 1208530258 all_types.pm # Fan out into one process per output format. $Mpp::all_types = sub { my( $outfile, $type ) = @_; if( Mpp::is_windows > 1 || !fork ) { $$type = 'txt'; $outfile =~ s/udg$/txt/; open STDOUT, '>', $outfile or die "can't write `$outfile'--$!"; } elsif( !fork ) { $$type = 'html'; $outfile =~ s/udg$/html/; open STDOUT, '>', $outfile or die "can't write `$outfile'--$!"; } elsif( !fork ) { $$type = 'dot'; $outfile =~ s/udg$/dot/; open STDOUT, '>', $outfile or die "can't write `$outfile'--$!"; } else { 1 while -1 < wait; } }; # Replace makepp dir with abbreviation (instead of std |m|, due to Ebcdic sorting). no warnings 'redefine'; sub Mpp::Rewrite::makepp() { defined and s!^$Mpp::datadir(?:/|$|(?=:))!! } ### 6 644 1170452082 1166207697 a.c #include "a.h" #include "b/b.h" #include "c/c.h" #include "a1.h" int main() { return 0; } ### 4 644 1170452082 1166207305 a.h #ifndef A_H #define A_H #include "a1.h" #endif ### 4 644 1170452082 1166207328 a1.h #ifndef A1_H #define A1_H #include "a.h" #endif ### D 755 1170452082 1170451981 b/ ### 5 644 1170452082 1166207697 b/b.c #include "b.h" #include "b1.h" #include "../a.h" int b() { return 0; } ### 4 644 1170452082 1166207305 b/b.h #ifndef B_H #define B_H #include "b1.h" #endif ### 4 644 1170452082 1166207328 b/b1.h #ifndef B1_H #define B1_H #include "b.h" #endif ### D 755 1170452082 1170451981 c/ ### 6 644 1170452082 1166207697 c/c.c #include "c.h" #include "c1.h" #include "../a.h" #include "../b/b.h" int c() { return 0; } ### 3 644 1170452082 1166207305 c/c.h.in #ifndef C_H #define C_H #endif ### 4 644 1170452082 1166207328 c/c1.h #ifndef C1_H #define C1_H #include "c.h" #endif ### D 755 1170452156 1170451970 answers/ ### -34 644 1187271600 1197503241 answers/both.dot // Generated by makeppgraph digraph a { rankdir=LR outputorder=edgesfirst node [shape=box style=filled fillcolor="#ffffffe0"] edge [dir=back] a [label="a" style="filled,bold" color=red] b [label="a.o" fillcolor="#e8e8e8e0" style="filled,bold" color=red] a -> b c [label="c/c.o" fillcolor="#e8e8e8e0" style="filled,bold" color=red] a -> c d [label="a.c" fillcolor="#f8a808e0"] e [label="c/c.h" fillcolor="#f8e800e0"] d -> e [style=dotted] b -> d b -> e f [label="all" shape=ellipse] f -> a g [label="c/c.c" fillcolor="#f8a808e0"] g -> e [style=dotted] h [label="c/c1.h" fillcolor="#f8e800e0"] g -> h [style=dotted] i [label="c/c.h.in"] e -> i [style=bold color=red] c -> g c -> e c -> h h -> e [style=dotted] j [label="makefile" fillcolor="#0090e0e0"] k [label="makepp.mk" fillcolor="#0090e0e0"] j -> k [style=dotted] l [label="makepp1.mk" fillcolor="#0090e0e0"] k -> l [style=dotted] } ### 17 644 1187271577 1187268248 answers/both.txt all {phony} a {because} a.o {because} a.c {include} c/c.h {because} c/c.h.in c/c.h {repeated} c/c.o {because} c/c.c {include} c/c.h {repeated} {include} c/c1.h {include} c/c.h {repeated} c/c.h {repeated} c/c1.h {repeated} makefile {include} makepp.mk {include} makepp1.mk ### -41 644 1187271600 1187268248 answers/both.udg [ l("a",n("",[a("OBJECT","makepp.mk"),a("COLOR","#0090e0")],[ e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],l("b",n("",[a("OBJECT","makepp1.mk"),a("COLOR","#0090e0")],[ ])) ), ])) ,l("c",n("",[a("OBJECT","makefile"),a("COLOR","#0090e0")],[ e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("a")), ])) ,l("d",n("",[a("OBJECT","c/c1.h"),a("COLOR","#f8e800")],[ e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],l("e",n("",[a("OBJECT","c/c.h"),a("COLOR","#f8e800")],[ e("",[a("EDGEPATTERN","thick"),a("EDGECOLOR","#ff0000"),a("_DIR","first")],l("f",n("",[a("OBJECT","c/c.h.in")],[ ])) ), ])) ), ])) ,l("g",n("",[a("OBJECT","c/c.o"),a("COLOR","#e8e8e8"),a("BORDER","double")],[ e("",[a("_DIR","first")],r("d")), e("",[a("_DIR","first")],r("e")), e("",[a("_DIR","first")],l("h",n("",[a("OBJECT","c/c.c"),a("COLOR","#f8a808")],[ e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("d")), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("e")), ])) ), ])) ,l("i",n("",[a("OBJECT","all"),a("_GO","ellipse")],[ e("",[a("_DIR","first")],l("j",n("",[a("OBJECT","a"),a("BORDER","double")],[ e("",[a("_DIR","first")],r("g")), e("",[a("_DIR","first")],l("k",n("",[a("OBJECT","a.o"),a("COLOR","#e8e8e8"),a("BORDER","double")],[ e("",[a("_DIR","first")],r("e")), e("",[a("_DIR","first")],l("l",n("",[a("OBJECT","a.c"),a("COLOR","#f8a808")],[ e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("e")), ])) ), ])) ), ])) ), ])) ,] ### -25 644 1187268256 1197503252 answers/dir.dot // Generated by makeppgraph digraph a { rankdir=LR outputorder=edgesfirst node [shape=box style=filled fillcolor="#ffffffe0"] edge [dir=back] a [label="." style="filled,bold" color=red shape=ellipse] a -> a a -> a [style=dotted] b [label=""] a -> b [style=dotted] c [label="b" style="filled,bold" color=red] a -> c [dir=both] a -> c [style=dotted dir=both] d [label="c" style="filled,bold" color=red] a -> d [dir=both] a -> d [style=dotted dir=both] b -> b [style=dotted] c -> c c -> c [style=dotted] d -> c d -> c [style=dotted] d -> d [style=bold color=red] d -> d [style=dotted] } ### 15 644 1187269252 1187268248 answers/dir.txt . {because,phony} . {repeated} {include} . {repeated} {include} {include} {repeated} {bidirectional} b {because} {include,bidirectional} . {repeated} b {repeated} {include} b {repeated} {bidirectional} c {because} {include,bidirectional} . {repeated} b {repeated} {include} b {repeated} {because} c {repeated} {include} c {repeated} ### -24 644 1187268977 1187268248 answers/dir.udg [ l("a",n("",[a("OBJECT","c"),a("BORDER","double")],[ e("",[a("EDGEPATTERN","thick"),a("EDGECOLOR","#ff0000"),a("_DIR","first")],r("a")), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("a")), e("",[a("_DIR","first")],l("b",n("",[a("OBJECT","b"),a("BORDER","double")],[ e("",[a("_DIR","first")],r("b")), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("b")), e("",[a("_DIR","both")],l("c",n("",[a("OBJECT","."),a("BORDER","double"),a("_GO","ellipse")],[ e("",[a("_DIR","both")],r("a")), e("",[a("EDGEPATTERN","dotted"),a("_DIR","both")],r("a")), e("",[a("EDGEPATTERN","dotted"),a("_DIR","both")],r("b")), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],l("d",n("",[a("OBJECT","")],[ e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("d")), ])) ), e("",[a("_DIR","first")],r("c")), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("c")), ])) ), ])) ), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("b")), ])) ,] ### -19 644 1187268257 1197503254 answers/dirplain.dot // Generated by makeppgraph digraph a { rankdir=LR outputorder=edgesfirst node [shape=box style=filled fillcolor="#ffffffe0"] edge [dir=back] a [label="."] a -> a b [label=""] a -> b c [label="b"] a -> c [dir=both] d [label="c"] a -> d [dir=both] b -> b c -> c d -> c d -> d } ### 9 644 1187269258 1187268248 answers/dirplain.txt . . b b c b c ### -18 644 1187268977 1187268248 answers/dirplain.udg [ l("a",n("",[a("OBJECT","c")],[ e("",[a("_DIR","first")],r("a")), e("",[a("_DIR","first")],l("b",n("",[a("OBJECT","b")],[ e("",[a("_DIR","first")],r("b")), e("",[a("_DIR","both")],l("c",n("",[a("OBJECT",".")],[ e("",[a("_DIR","both")],r("a")), e("",[a("_DIR","first")],l("d",n("",[a("OBJECT","")],[ e("",[a("_DIR","first")],r("d")), ])) ), e("",[a("_DIR","first")],r("c")), ])) ), ])) ), ])) ,] ### -29 644 1187268256 1197503256 answers/dirsep.dot // Generated by makeppgraph digraph a { rankdir=LR outputorder=edgesfirst node [shape=box style=filled fillcolor="#ffffffe0"] edge [dir=back] a [label="." style="filled,bold" color=red shape=ellipse] a -> a a -> a [style=dotted] b [label=""] a -> b [style=dotted] c [label="b" style="filled,bold" color=red] a -> c a -> c [style=dotted] d [label="c" style="filled,bold" color=red] a -> d a -> d [style=dotted] b -> b [style=dotted] c -> a c -> a [style=dotted] c -> c c -> c [style=dotted] d -> a d -> a [style=dotted] d -> c d -> c [style=dotted] d -> d [style=bold color=red] d -> d [style=dotted] } ### 19 644 1187269343 1187268248 answers/dirsep.txt . {because,phony} . {repeated} {include} . {repeated} {include} {include} {repeated} b {because} . {repeated} {include} . {repeated} b {repeated} {include} b {repeated} {include} b {because} c {because} . {repeated} {include} . {repeated} b {repeated} {include} b {repeated} {because} c {repeated} {include} c {repeated} {include} c {because} ### -28 644 1187268977 1187268248 answers/dirsep.udg [ l("a",n("",[a("OBJECT","c"),a("BORDER","double")],[ e("",[a("EDGEPATTERN","thick"),a("EDGECOLOR","#ff0000"),a("_DIR","first")],r("a")), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("a")), e("",[a("_DIR","first")],l("b",n("",[a("OBJECT","b"),a("BORDER","double")],[ e("",[a("_DIR","first")],r("b")), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("b")), e("",[a("_DIR","first")],l("c",n("",[a("OBJECT","."),a("BORDER","double"),a("_GO","ellipse")],[ e("",[a("_DIR","first")],r("a")), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("a")), e("",[a("_DIR","first")],r("b")), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("b")), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],l("d",n("",[a("OBJECT","")],[ e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("d")), ])) ), e("",[a("_DIR","first")],r("c")), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("c")), ])) ), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("c")), ])) ), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("b")), e("",[a("_DIR","first")],r("c")), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("c")), ])) ,] ### -21 644 1187268284 1197503257 answers/dirsepplain.dot // Generated by makeppgraph digraph a { rankdir=LR outputorder=edgesfirst node [shape=box style=filled fillcolor="#ffffffe0"] edge [dir=back] a [label="."] a -> a b [label=""] a -> b c [label="b"] a -> c d [label="c"] a -> d b -> b c -> a c -> c d -> a d -> c d -> d } ### 11 644 1187269295 1187268248 answers/dirsepplain.txt . . b . b c . b c ### -20 644 1187268977 1187268248 answers/dirsepplain.udg [ l("a",n("",[a("OBJECT","c")],[ e("",[a("_DIR","first")],r("a")), e("",[a("_DIR","first")],l("b",n("",[a("OBJECT","b")],[ e("",[a("_DIR","first")],r("b")), e("",[a("_DIR","first")],l("c",n("",[a("OBJECT",".")],[ e("",[a("_DIR","first")],r("a")), e("",[a("_DIR","first")],r("b")), e("",[a("_DIR","first")],l("d",n("",[a("OBJECT","")],[ e("",[a("_DIR","first")],r("d")), ])) ), e("",[a("_DIR","first")],r("c")), ])) ), ])) ), e("",[a("_DIR","first")],r("c")), ])) ,] ### -13 644 1187271908 1197503258 answers/down.dot // Generated by makeppgraph digraph a { rankdir=LR outputorder=edgesfirst node [shape=box style=filled fillcolor="#ffffffe0"] edge [dir=back] a [label="c/c.h" fillcolor="#f8e800e0"] b [label="c/c.h.in"] a -> b [style=bold color=red] c [label="makepp.mk" fillcolor="#0090e0e0"] d [label="makepp1.mk" fillcolor="#0090e0e0"] c -> d [style=dotted] } ### 4 644 1187271856 1187268248 answers/down.txt c/c.h {because} c/c.h.in makepp.mk {include} makepp1.mk ### -12 644 1187271908 1187268248 answers/down.udg [ l("a",n("",[a("OBJECT","makepp.mk"),a("COLOR","#0090e0")],[ e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],l("b",n("",[a("OBJECT","makepp1.mk"),a("COLOR","#0090e0")],[ ])) ), ])) ,l("c",n("",[a("OBJECT","c/c.h"),a("COLOR","#f8e800")],[ e("",[a("EDGEPATTERN","thick"),a("EDGECOLOR","#ff0000"),a("_DIR","first")],l("d",n("",[a("OBJECT","c/c.h.in")],[ ])) ), ])) ,] ### -69 644 1187273298 1197503259 answers/full.dot // Generated by makeppgraph digraph a { rankdir=LR outputorder=edgesfirst node [shape=box style=filled fillcolor="#ffffffe0"] edge [dir=back] a [label="makepp_default_makefile.mk" fillcolor="#0090e0e0"] b [label="makepp_builtin_rules.mk" fillcolor="#0090e0e0"] a -> b [style=dotted] c [label="a" style="filled,bold" color=red] d [label="a.o" fillcolor="#e8e8e8e0" style="filled,bold" color=red] c -> d e [label="b/b.o" fillcolor="#e8e8e8e0" style="filled,bold" color=red] c -> e f [label="c/c.o" fillcolor="#e8e8e8e0" style="filled,bold" color=red] c -> f g [label="a.c" fillcolor="#f8a808e0"] h [label="a.h" fillcolor="#f8e800e0"] g -> h [style=dotted] i [label="a1.h" fillcolor="#f8e800e0"] g -> i [style=dotted] j [label="b/b.h" fillcolor="#f8e800e0"] g -> j [style=dotted] k [label="c/c.h" fillcolor="#f8e800e0"] g -> k [style=dotted] h -> i [style=dotted dir=both] d -> g d -> h d -> i d -> j l [label="b/b1.h" fillcolor="#f8e800e0"] d -> l d -> k m [label="all" shape=ellipse] m -> c n [label="b/b.c" fillcolor="#f8a808e0"] n -> h [style=dotted] n -> j [style=dotted] n -> l [style=dotted] j -> l [style=dotted dir=both] e -> h e -> i e -> n e -> j e -> l o [label="c/c.c" fillcolor="#f8a808e0"] o -> h [style=dotted] o -> j [style=dotted] o -> k [style=dotted] p [label="c/c1.h" fillcolor="#f8e800e0"] o -> p [style=dotted] q [label="c/c.h.in"] k -> q [style=bold color=red] f -> h f -> i f -> j f -> l f -> o f -> k f -> p p -> k [style=dotted] r [label="makefile" fillcolor="#0090e0e0"] r -> b [style=dotted] s [label="makepp.mk" fillcolor="#0090e0e0"] r -> s [style=dotted] t [label="makepp1.mk" fillcolor="#0090e0e0"] r -> t [style=dotted] s -> t [style=dotted] } ### 162 644 1197628172 1324772167 answers/full.html
  • subtree
  • folded subtree
  • leaf
  • file
  • phony
  • repeated
← dependency
↑ include
### 45 644 1187273271 1187268248 answers/full.txt makepp_default_makefile.mk {include} makepp_builtin_rules.mk all {phony} a {because} a.o {because} a.c {include} a.h {include,bidirectional} a1.h {include} a1.h {repeated} {include} b/b.h {include,bidirectional} b/b1.h {include} c/c.h {because} c/c.h.in a.h {repeated} a1.h {repeated} b/b.h {repeated} b/b1.h {repeated} c/c.h {repeated} b/b.o {because} a.h {repeated} a1.h {repeated} b/b.c {include} a.h {repeated} {include} b/b.h {repeated} {include} b/b1.h {repeated} b/b.h {repeated} b/b1.h {repeated} c/c.o {because} a.h {repeated} a1.h {repeated} b/b.h {repeated} b/b1.h {repeated} c/c.c {include} a.h {repeated} {include} b/b.h {repeated} {include} c/c.h {repeated} {include} c/c1.h {include} c/c.h {repeated} c/c.h {repeated} c/c1.h {repeated} makefile {include} makepp_builtin_rules.mk {repeated} {include} makepp.mk {include} makepp1.mk {include} makepp1.mk {repeated} ### -84 644 1187273298 1187268248 answers/full.udg [ l("a",n("",[a("OBJECT","makepp.mk"),a("COLOR","#0090e0")],[ e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],l("b",n("",[a("OBJECT","makepp1.mk"),a("COLOR","#0090e0")],[ ])) ), ])) ,l("c",n("",[a("OBJECT","makefile"),a("COLOR","#0090e0")],[ e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("b")), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("a")), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],l("d",n("",[a("OBJECT","makepp_builtin_rules.mk"),a("COLOR","#0090e0")],[ ])) ), ])) ,l("e",n("",[a("OBJECT","c/c1.h"),a("COLOR","#f8e800")],[ e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],l("f",n("",[a("OBJECT","c/c.h"),a("COLOR","#f8e800")],[ e("",[a("EDGEPATTERN","thick"),a("EDGECOLOR","#ff0000"),a("_DIR","first")],l("g",n("",[a("OBJECT","c/c.h.in")],[ ])) ), ])) ), ])) ,l("h",n("",[a("OBJECT","c/c.o"),a("COLOR","#e8e8e8"),a("BORDER","double")],[ e("",[a("_DIR","first")],r("e")), e("",[a("_DIR","first")],r("f")), e("",[a("_DIR","first")],l("i",n("",[a("OBJECT","c/c.c"),a("COLOR","#f8a808")],[ e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("e")), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("f")), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],l("j",n("",[a("OBJECT","b/b.h"),a("COLOR","#f8e800")],[ e("",[a("EDGEPATTERN","dotted"),a("_DIR","both")],l("k",n("",[a("OBJECT","b/b1.h"),a("COLOR","#f8e800")],[ ])) ), ])) ), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],l("l",n("",[a("OBJECT","a.h"),a("COLOR","#f8e800")],[ e("",[a("EDGEPATTERN","dotted"),a("_DIR","both")],l("m",n("",[a("OBJECT","a1.h"),a("COLOR","#f8e800")],[ ])) ), ])) ), ])) ), e("",[a("_DIR","first")],r("k")), e("",[a("_DIR","first")],r("j")), e("",[a("_DIR","first")],r("m")), e("",[a("_DIR","first")],r("l")), ])) ,l("n",n("",[a("OBJECT","b/b.o"),a("COLOR","#e8e8e8"),a("BORDER","double")],[ e("",[a("_DIR","first")],r("k")), e("",[a("_DIR","first")],r("j")), e("",[a("_DIR","first")],l("o",n("",[a("OBJECT","b/b.c"),a("COLOR","#f8a808")],[ e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("k")), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("j")), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("l")), ])) ), e("",[a("_DIR","first")],r("m")), e("",[a("_DIR","first")],r("l")), ])) ,l("p",n("",[a("OBJECT","all"),a("_GO","ellipse")],[ e("",[a("_DIR","first")],l("q",n("",[a("OBJECT","a"),a("BORDER","double")],[ e("",[a("_DIR","first")],r("h")), e("",[a("_DIR","first")],r("n")), e("",[a("_DIR","first")],l("r",n("",[a("OBJECT","a.o"),a("COLOR","#e8e8e8"),a("BORDER","double")],[ e("",[a("_DIR","first")],r("f")), e("",[a("_DIR","first")],r("k")), e("",[a("_DIR","first")],r("j")), e("",[a("_DIR","first")],r("m")), e("",[a("_DIR","first")],r("l")), e("",[a("_DIR","first")],l("s",n("",[a("OBJECT","a.c"),a("COLOR","#f8a808")],[ e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("f")), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("j")), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("m")), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("l")), ])) ), ])) ), ])) ), ])) ,l("t",n("",[a("OBJECT","makepp_default_makefile.mk"),a("COLOR","#0090e0")],[ e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("d")), ])) ,] ### 132 644 1187268248 1283076141 answers/key.txt .../makepp --dont-build=/ --do-build=. LOAD Loading makefile `makefile' with default directory `.' TRY Trying to build `makefile' USE Using rule `default rule' DEPEND Targets `makefile' depend on UP_TO_DATE `makefile' is up to date PREBUILD Pre-building `makepp.mk' from `makefile:5' TRY Trying to build `makepp.mk' USE Using rule `default rule' DEPEND Targets `makepp.mk' depend on UP_TO_DATE `makepp.mk' is up to date LOAD_INCL Including `makepp.mk' from `makefile:5' PREBUILD Pre-building `makepp1.mk' from `makepp.mk:1' TRY Trying to build `makepp1.mk' USE Using rule `default rule' DEPEND Targets `makepp1.mk' depend on UP_TO_DATE `makepp1.mk' is up to date LOAD_INCL Including `makepp1.mk' from `makepp.mk:1' PREBUILD Pre-building `makepp1.mk' from `makefile:6' LOAD_INCL Including `makepp1.mk' from `makefile:6' IFEQ if(n)eq comparing `a' with `1' at `makefile:8' IFEQ if(n)eq comparing `a' with `2' at `makefile:9' IFEQ if(n)eq comparing `a' with `a' at `makefile:10' LOAD_INCL Including `.../makepp_builtin_rules.mk' from `makefile' LOAD_END Finished loading `makefile' TRY Trying to build `all' USE Using rule `default rule' DEPEND Targets `all' depend on `a' TRY Trying to build `a' USE Using rule `makefile:25' PREBUILD Pre-building `a.o' from `makefile:25' TRY Trying to build `a.o' USE Using rule `.../makepp_builtin_rules.mk:90(.)' SCAN_INFO Trying to retrieve scan info for `a.o' LEX_RULE Lexically analyzing rule for `a.o' because `info not cached' TRY Trying to build `a.c' USE Using rule `default rule' DEPEND Targets `a.c' depend on UP_TO_DATE `a.c' is up to date SCAN Scanning `a.c' INCL `a.c' includes `a.h' TRY Trying to build `a.h' USE Using rule `default rule' DEPEND Targets `a.h' depend on UP_TO_DATE `a.h' is up to date INCL `a.c' includes `b/b.h' TRY Trying to build `b/b.h' LOAD_DEFAULT Loading default makefile for directory `b' LOAD_INCL Including `.../makepp_builtin_rules.mk' from `.../makepp_default_makefile.mk' LOAD_END Finished loading `.../makepp_default_makefile.mk' USE Using rule `default rule' DEPEND Targets `b/b.h' depend on UP_TO_DATE `b/b.h' is up to date INCL `a.c' includes `c/c.h' TRY Trying to build `c/c.h' LOAD_DEFAULT Loading default makefile for directory `c' LOAD_INCL Including `.../makepp_builtin_rules.mk' from `.../makepp_default_makefile.mk' LOAD_END Finished loading `.../makepp_default_makefile.mk' USE Using rule `makefile:15' SCAN_INFO Trying to retrieve scan info for `c/c.h' LEX_RULE Lexically analyzing rule for `c/c.h' because `info not cached' DEPEND Targets `c/c.h' depend on `c/c.h.in' TRY Trying to build `c/c.h.in' USE Using rule `default rule' DEPEND Targets `c/c.h.in' depend on UP_TO_DATE `c/c.h.in' is up to date BUILD_OLD Rebuild `c/c.h' because it's older than `c/c.h.in' SUCCESS `makefile:15' successfully executed for `c/c.h' INCL `a.c' includes `a1.h' TRY Trying to build `a1.h' USE Using rule `default rule' DEPEND Targets `a1.h' depend on UP_TO_DATE `a1.h' is up to date SCAN Scanning `a.h' INCL `a.h' includes `a1.h' SCAN Scanning `b/b.h' INCL `b/b.h' includes `b/b1.h' TRY Trying to build `b/b1.h' USE Using rule `default rule' DEPEND Targets `b/b1.h' depend on UP_TO_DATE `b/b1.h' is up to date SCAN Scanning `c/c.h' SCAN Scanning `a1.h' INCL `a1.h' includes `a.h' SCAN Scanning `b/b1.h' INCL `b/b1.h' includes `b/b.h' DEPEND Targets `a.o' depend on `a.c', `a.h', `a1.h', `b/b.h', `b/b1.h', `c/c.h' BUILD_NONE Build `a.o' because it doesn't exist SUCCESS `.../makepp_builtin_rules.mk:90(.)' successfully executed for `a.o' PREBUILD Pre-building `b/b.o' from `makefile:25' TRY Trying to build `b/b.o' USE Using rule `.../makepp_builtin_rules.mk:90(b)' SCAN_INFO Trying to retrieve scan info for `b/b.o' LEX_RULE Lexically analyzing rule for `b/b.o' because `info not cached' TRY Trying to build `b/b.c' USE Using rule `default rule' DEPEND Targets `b/b.c' depend on UP_TO_DATE `b/b.c' is up to date SCAN Scanning `b/b.c' INCL `b/b.c' includes `b/b.h', `b/b1.h', `a.h' DEPEND Targets `b/b.o' depend on `a.h', `a1.h', `b/b.c', `b/b.h', `b/b1.h' BUILD_NONE Build `b/b.o' because it doesn't exist SUCCESS `.../makepp_builtin_rules.mk:90(b)' successfully executed for `b/b.o' PREBUILD Pre-building `c/c.o' from `makefile:25' TRY Trying to build `c/c.o' USE Using rule `.../makepp_builtin_rules.mk:90(c)' SCAN_INFO Trying to retrieve scan info for `c/c.o' LEX_RULE Lexically analyzing rule for `c/c.o' because `info not cached' TRY Trying to build `c/c.c' USE Using rule `default rule' DEPEND Targets `c/c.c' depend on UP_TO_DATE `c/c.c' is up to date SCAN Scanning `c/c.c' INCL `c/c.c' includes `c/c.h', `c/c1.h' TRY Trying to build `c/c1.h' USE Using rule `default rule' DEPEND Targets `c/c1.h' depend on UP_TO_DATE `c/c1.h' is up to date INCL `c/c.c' includes `a.h', `b/b.h' SCAN Scanning `c/c1.h' INCL `c/c1.h' includes `c/c.h' DEPEND Targets `c/c.o' depend on `a.h', `a1.h', `b/b.h', `b/b1.h', `c/c.c', `c/c.h', `c/c1.h' BUILD_NONE Build `c/c.o' because it doesn't exist SUCCESS `.../makepp_builtin_rules.mk:90(c)' successfully executed for `c/c.o' SCAN_INFO Trying to retrieve scan info for `a' LEX_RULE Lexically analyzing rule for `a' because `info not cached' DEPEND Targets `a' depend on `a.o', `b/b.o', `c/c.o' BUILD_NONE Build `a' because it doesn't exist SUCCESS `makefile:25' successfully executed for `a' BUILD_PHONY Rebuild `all' because it is a phony target SUCCESS `default rule' successfully executed for `all' N_FILES 5 files updated, 1 phony targets built and 0 targets failed ### 113 644 1187272402 1283076188 answers/log.txt .../makepp --dont-build=/ --do-build=. makepplog: Loading makefile `makefile' with default directory `.' makepplog: Trying to build `makefile' makepplog: Using rule `default rule' makepplog: Targets `makefile' depend on makepplog: `makefile' is up to date makepplog: Pre-building `makepp.mk' from `makefile:5' makepplog: Trying to build `makepp.mk' makepplog: Using rule `default rule' makepplog: Targets `makepp.mk' depend on makepplog: `makepp.mk' is up to date makepplog: Including `makepp.mk' from `makefile:5' makepplog: Pre-building `makepp1.mk' from `makepp.mk:1' makepplog: Trying to build `makepp1.mk' makepplog: Using rule `default rule' makepplog: Targets `makepp1.mk' depend on makepplog: `makepp1.mk' is up to date makepplog: Including `makepp1.mk' from `makepp.mk:1' makepplog: Pre-building `makepp1.mk' from `makefile:6' makepplog: Including `makepp1.mk' from `makefile:6' makepplog: if(n)eq comparing `a' with `1' at `makefile:8' makepplog: if(n)eq comparing `a' with `2' at `makefile:9' makepplog: if(n)eq comparing `a' with `a' at `makefile:10' makepplog: Including `.../makepp_builtin_rules.mk' from `makefile' makepplog: Finished loading `makefile' makepplog: Trying to build `all' makepplog: Using rule `default rule' makepplog: Targets `all' depend on `a' makepplog: Trying to build `a' makepplog: Using rule `makefile:25' makepplog: Pre-building `a.o' from `makefile:25' makepplog: Trying to build `a.o' makepplog: Using rule `.../makepp_builtin_rules.mk:90(.)' makepplog: Trying to build `a.c' makepplog: Using rule `default rule' makepplog: Targets `a.c' depend on makepplog: `a.c' is up to date makepplog: `a.c' includes `a.h' makepplog: Trying to build `a.h' makepplog: Using rule `default rule' makepplog: Targets `a.h' depend on makepplog: `a.h' is up to date makepplog: `a.c' includes `b/b.h' makepplog: Trying to build `b/b.h' makepplog: Loading default makefile for directory `b' makepplog: Including `.../makepp_builtin_rules.mk' from `.../makepp_default_makefile.mk' makepplog: Finished loading `.../makepp_default_makefile.mk' makepplog: Using rule `default rule' makepplog: Targets `b/b.h' depend on makepplog: `b/b.h' is up to date makepplog: `a.c' includes `c/c.h' makepplog: Trying to build `c/c.h' makepplog: Loading default makefile for directory `c' makepplog: Including `.../makepp_builtin_rules.mk' from `.../makepp_default_makefile.mk' makepplog: Finished loading `.../makepp_default_makefile.mk' makepplog: Using rule `makefile:15' makepplog: Targets `c/c.h' depend on `c/c.h.in' makepplog: Trying to build `c/c.h.in' makepplog: Using rule `default rule' makepplog: Targets `c/c.h.in' depend on makepplog: `c/c.h.in' is up to date makepplog: Rebuild `c/c.h' because it's older than `c/c.h.in' makepplog: `makefile:15' successfully executed for `c/c.h' makepplog: `a.c' includes `a1.h' makepplog: Trying to build `a1.h' makepplog: Using rule `default rule' makepplog: Targets `a1.h' depend on makepplog: `a1.h' is up to date makepplog: `a.h' includes `a1.h' makepplog: `b/b.h' includes `b/b1.h' makepplog: Trying to build `b/b1.h' makepplog: Using rule `default rule' makepplog: Targets `b/b1.h' depend on makepplog: `b/b1.h' is up to date makepplog: `a1.h' includes `a.h' makepplog: `b/b1.h' includes `b/b.h' makepplog: Targets `a.o' depend on `a.c', `a.h', `a1.h', `b/b.h', `b/b1.h', `c/c.h' makepplog: Build `a.o' because it doesn't exist makepplog: `.../makepp_builtin_rules.mk:90(.)' successfully executed for `a.o' makepplog: Pre-building `b/b.o' from `makefile:25' makepplog: Trying to build `b/b.o' makepplog: Using rule `.../makepp_builtin_rules.mk:90(b)' makepplog: Trying to build `b/b.c' makepplog: Using rule `default rule' makepplog: Targets `b/b.c' depend on makepplog: `b/b.c' is up to date makepplog: `b/b.c' includes `b/b.h', `b/b1.h', `a.h' makepplog: Targets `b/b.o' depend on `a.h', `a1.h', `b/b.c', `b/b.h', `b/b1.h' makepplog: Build `b/b.o' because it doesn't exist makepplog: `.../makepp_builtin_rules.mk:90(b)' successfully executed for `b/b.o' makepplog: Pre-building `c/c.o' from `makefile:25' makepplog: Trying to build `c/c.o' makepplog: Using rule `.../makepp_builtin_rules.mk:90(c)' makepplog: Trying to build `c/c.c' makepplog: Using rule `default rule' makepplog: Targets `c/c.c' depend on makepplog: `c/c.c' is up to date makepplog: `c/c.c' includes `c/c.h', `c/c1.h' makepplog: Trying to build `c/c1.h' makepplog: Using rule `default rule' makepplog: Targets `c/c1.h' depend on makepplog: `c/c1.h' is up to date makepplog: `c/c.c' includes `a.h', `b/b.h' makepplog: `c/c1.h' includes `c/c.h' makepplog: Targets `c/c.o' depend on `a.h', `a1.h', `b/b.h', `b/b1.h', `c/c.c', `c/c.h', `c/c1.h' makepplog: Build `c/c.o' because it doesn't exist makepplog: `.../makepp_builtin_rules.mk:90(c)' successfully executed for `c/c.o' makepplog: Targets `a' depend on `a.o', `b/b.o', `c/c.o' makepplog: Build `a' because it doesn't exist makepplog: `makefile:25' successfully executed for `a' makepplog: Rebuild `all' because it is a phony target makepplog: `default rule' successfully executed for `all' makepplog: 5 files updated, 1 phony targets built and 0 targets failed ### -55 644 1187268248 1187268248 answers/log.udg [ l("a",n("",[a("OBJECT","c/c.o"),a("COLOR","#e8e8e8")],[ e("",[a("_DIR","first")],l("b",n("",[a("OBJECT","c/c1.h"),a("COLOR","#f8e800")],[ ])) ), e("",[a("_DIR","first")],l("c",n("",[a("OBJECT","c/c.h"),a("COLOR","#f8e800")],[ e("",[a("_DIR","first")],l("d",n("",[a("OBJECT","c/c.h.in")],[ ])) ), ])) ), e("",[a("_DIR","first")],l("e",n("",[a("OBJECT","c/c.c"),a("COLOR","#f8a808")],[ ])) ), e("",[a("_DIR","first")],l("f",n("",[a("OBJECT","b/b1.h"),a("COLOR","#f8e800")],[ ])) ), e("",[a("_DIR","first")],l("g",n("",[a("OBJECT","b/b.h"),a("COLOR","#f8e800")],[ ])) ), e("",[a("_DIR","first")],l("h",n("",[a("OBJECT","a1.h"),a("COLOR","#f8e800")],[ ])) ), e("",[a("_DIR","first")],l("i",n("",[a("OBJECT","a.h"),a("COLOR","#f8e800")],[ ])) ), ])) ,l("j",n("",[a("OBJECT","b/b.o"),a("COLOR","#e8e8e8")],[ e("",[a("_DIR","first")],r("f")), e("",[a("_DIR","first")],r("g")), e("",[a("_DIR","first")],l("k",n("",[a("OBJECT","b/b.c"),a("COLOR","#f8a808")],[ ])) ), e("",[a("_DIR","first")],r("h")), e("",[a("_DIR","first")],r("i")), ])) ,l("l",n("",[a("OBJECT","all"),a("_GO","ellipse")],[ e("",[a("_DIR","first")],l("m",n("",[a("OBJECT","a")],[ e("",[a("_DIR","first")],r("a")), e("",[a("_DIR","first")],r("j")), e("",[a("_DIR","first")],l("n",n("",[a("OBJECT","a.o"),a("COLOR","#e8e8e8")],[ e("",[a("_DIR","first")],r("c")), e("",[a("_DIR","first")],r("f")), e("",[a("_DIR","first")],r("g")), e("",[a("_DIR","first")],r("h")), e("",[a("_DIR","first")],r("i")), e("",[a("_DIR","first")],l("o",n("",[a("OBJECT","a.c"),a("COLOR","#f8a808")],[ ])) ), ])) ), ])) ), ])) ,] ### 1 644 1187322170 1190053856 answers/n_files 5 1 0 ### 45 644 1187268248 1187268248 answers/rewrite.txt cwd: . . . . . . a a a a/b a/b a/b .. : : .. : : ../a :/a :a ../a/b :/a/b :a/b ../.. :/: :: ../.. :/: :: ../../a :/:/a ::a ../../a/b :/:/a/b ::a/b ../../.. :/:/: ::: ../../.. :/:/: ::: ../../../a :/:/:/a :::a ../../../a/b :/:/:/a/b :::a/b dir: / /bin /usr/bin /usr/bin /a/b |a| |a| |a|b |a|b/c usr: |l| |l|a |l|a/b |l|a/b/c |b| |b|a |b|a/b |b|a/b/c |ul| |ul|a |ul|a/b |ul|a/b/c |us| |us|a |us|a/b |us|a/b/c |uli| |uli|a |uli|a/b |uli|a/b/c |ull| |ull|a |ull|a/b |ull|a/b/c |uXb| |uXb|a |uXb|a/b |uXb|a/b/c |uXl| |uXl|a |uXl|a/b |uXl|a/b/c /nogo /nogo/a /nogo/a/b /nogo/a/b/c /tmp/nogo /tmp/nogo/a /tmp/nogo/a/b /tmp/nogo/a/b/c suf: f.x -3:*.x -2:*.x -1:*.x undef:*.x 0:*.x 1:*.x 2:*.x 3:*.x a/f.x -3:*.x -2:*.x -1:*.x undef:*.x 0:*.x 1:a/*.x 2:a/*.x 3:a/*.x a/b/f.x -3:*.x -2:*.x -1:a/*.x undef:*.x 0:*.x 1:a/*.x 2:a/b/*.x 3:a/b/*.x a/b/c/f.x -3:*.x -2:a/*.x -1:a/b/*.x undef:*.x 0:*.x 1:a/*.x 2:a/b/*.x 3:a/b/c/*.x /f.x -3:*.x -2:*.x -1:*.x undef:*.x 0:/*.x 1:/*.x 2:/*.x 3:/*.x /a/f.x -3:*.x -2:*.x -1:*.x undef:*.x 0:/*.x 1:/a/*.x 2:/a/*.x 3:/a/*.x /a/b/f.x -3:*.x -2:*.x -1:/a/*.x undef:*.x 0:/*.x 1:/a/*.x 2:/a/b/*.x 3:/a/b/*.x /a/b/c/f.x -3:*.x -2:/a/*.x -1:/a/b/*.x undef:*.x 0:/*.x 1:/a/*.x 2:/a/b/*.x 3:/a/b/c/*.x ~/f.x -3:*.x -2:*.x -1:*.x undef:*.x 0:~*.x 1:~/*.x 2:~/*.x 3:~/*.x ~/a/f.x -3:*.x -2:*.x -1:~/*.x undef:*.x 0:~*.x 1:~/*.x 2:~/a/*.x 3:~/a/*.x ~/a/b/f.x -3:*.x -2:~/*.x -1:~/a/*.x undef:*.x 0:~*.x 1:~/*.x 2:~/a/*.x 3:~/a/b/*.x ~/a/b/c/f.x -3:~/*.x -2:~/a/*.x -1:~/a/b/*.x undef:*.x 0:~*.x 1:~/*.x 2:~/a/*.x 3:~/a/b/*.x ~a/f.x -3:*.x -2:*.x -1:*.x undef:*.x 0:~*.x 1:~a/*.x 2:~a/*.x 3:~a/*.x ~a/b/f.x -3:*.x -2:*.x -1:~a/*.x undef:*.x 0:~*.x 1:~a/*.x 2:~a/b/*.x 3:~a/b/*.x ~a/b/c/f.x -3:*.x -2:~a/*.x -1:~a/b/*.x undef:*.x 0:~*.x 1:~a/*.x 2:~a/b/*.x 3:~a/b/c/*.x |a|f.x -3:*.x -2:*.x -1:*.x undef:*.x 0:|*.x 1:|a|*.x 2:|a|*.x 3:|a|*.x |a|b/f.x -3:*.x -2:*.x -1:|a|*.x undef:*.x 0:|*.x 1:|a|*.x 2:|a|b/*.x 3:|a|b/*.x |a|b/c/f.x -3:*.x -2:|a|*.x -1:|a|b/*.x undef:*.x 0:|*.x 1:|a|*.x 2:|a|b/*.x 3:|a|b/c/*.x ### -24 644 1187272450 1197503260 answers/suf.dot // Generated by makeppgraph digraph a { rankdir=LR outputorder=edgesfirst node [shape=box style=filled fillcolor="#ffffffe0"] edge [dir=back] a [label="*.c" fillcolor="#f8a808e0"] b [label="*.h" fillcolor="#f8e800e0"] a -> b [style=dotted] b -> b [style=dotted] c [label="*.in"] b -> c d [label="*.mk" fillcolor="#0090e0e0"] d -> d [style=dotted] e [label="*.o" fillcolor="#e8e8e8e0"] e -> a e -> b f [label="a"] f -> e g [label="all" shape=ellipse] g -> f h [label="makefile" fillcolor="#0090e0e0"] h -> d [style=dotted] } ### 11 644 1187272430 1187268248 answers/suf.txt all {phony} a *.o *.c {include} *.h {include} *.h {repeated} *.in *.h {repeated} makefile {include} *.mk {include} *.mk {repeated} ### -27 644 1187272450 1187268248 answers/suf.udg [ l("a",n("",[a("OBJECT","makefile"),a("COLOR","#0090e0")],[ e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],l("b",n("",[a("OBJECT","*.mk"),a("COLOR","#0090e0")],[ e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("b")), ])) ), ])) ,l("c",n("",[a("OBJECT","all"),a("_GO","ellipse")],[ e("",[a("_DIR","first")],l("d",n("",[a("OBJECT","a")],[ e("",[a("_DIR","first")],l("e",n("",[a("OBJECT","*.o"),a("COLOR","#e8e8e8")],[ e("",[a("_DIR","first")],l("f",n("",[a("OBJECT","*.h"),a("COLOR","#f8e800")],[ e("",[a("_DIR","first")],l("g",n("",[a("OBJECT","*.in")],[ ])) ), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("f")), ])) ), e("",[a("_DIR","first")],l("h",n("",[a("OBJECT","*.c"),a("COLOR","#f8a808")],[ e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("f")), ])) ), ])) ), ])) ), ])) ,] ### -32 644 1187272774 1197503261 answers/up.dot // Generated by makeppgraph digraph a { rankdir=LR outputorder=edgesfirst node [shape=box style=filled fillcolor="#ffffffe0"] edge [dir=back] a [label="a" style="filled,bold" color=red] b [label="a.o" fillcolor="#e8e8e8e0" style="filled,bold" color=red] a -> b c [label="b/b.o" fillcolor="#e8e8e8e0" style="filled,bold" color=red] a -> c d [label="c/c.o" fillcolor="#e8e8e8e0" style="filled,bold" color=red] a -> d e [label="a.c" fillcolor="#f8a808e0"] f [label="c/c.h" fillcolor="#f8e800e0" style="filled,bold" color=red] e -> f [style=dotted] b -> e b -> f g [label="all" shape=ellipse] g -> a h [label="c/c.c" fillcolor="#f8a808e0"] h -> f [style=dotted] i [label="c/c1.h" fillcolor="#f8e800e0"] h -> i [style=dotted] d -> h d -> f d -> i i -> f [style=dotted] j [label="makefile" fillcolor="#0090e0e0"] k [label="makepp.mk" fillcolor="#0090e0e0"] j -> k [style=dotted] } ### 16 644 1187272758 1187268248 answers/up.txt all {phony} a {because} a.o {because} a.c {include} c/c.h {because} c/c.h {repeated} b/b.o {because} c/c.o {because} c/c.c {include} c/c.h {repeated} {include} c/c1.h {include} c/c.h {repeated} c/c.h {repeated} c/c1.h {repeated} makefile {include} makepp.mk ### -38 644 1187272775 1187268248 answers/up.udg [ l("a",n("",[a("OBJECT","makepp.mk"),a("COLOR","#0090e0")],[ ])) ,l("b",n("",[a("OBJECT","makefile"),a("COLOR","#0090e0")],[ e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("a")), ])) ,l("c",n("",[a("OBJECT","c/c1.h"),a("COLOR","#f8e800")],[ e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],l("d",n("",[a("OBJECT","c/c.h"),a("COLOR","#f8e800"),a("BORDER","double")],[ ])) ), ])) ,l("e",n("",[a("OBJECT","c/c.o"),a("COLOR","#e8e8e8"),a("BORDER","double")],[ e("",[a("_DIR","first")],r("c")), e("",[a("_DIR","first")],r("d")), e("",[a("_DIR","first")],l("f",n("",[a("OBJECT","c/c.c"),a("COLOR","#f8a808")],[ e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("c")), e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("d")), ])) ), ])) ,l("g",n("",[a("OBJECT","b/b.o"),a("COLOR","#e8e8e8"),a("BORDER","double")],[ ])) ,l("h",n("",[a("OBJECT","all"),a("_GO","ellipse")],[ e("",[a("_DIR","first")],l("i",n("",[a("OBJECT","a"),a("BORDER","double")],[ e("",[a("_DIR","first")],r("e")), e("",[a("_DIR","first")],r("g")), e("",[a("_DIR","first")],l("j",n("",[a("OBJECT","a.o"),a("COLOR","#e8e8e8"),a("BORDER","double")],[ e("",[a("_DIR","first")],r("d")), e("",[a("_DIR","first")],l("k",n("",[a("OBJECT","a.c"),a("COLOR","#f8a808")],[ e("",[a("EDGEPATTERN","dotted"),a("_DIR","first")],r("d")), ])) ), ])) ), ])) ), ])) ,] makepp-2.0.98.3/t/load_makefile.test0000644000175000017500000000257210674045030017313 0ustar pfeifferpfeiffer### SPAR ### 6 755 1143404491 1143323853 makepp_test_script.pl # # Test the load_makefile statement and that it makes a directory # outside the root buildable. # makepp '-Crootdir'; makepp; ### 8 644 1164352749 971325229 Makeppfile load_makefile subdir1 subdir2/elifekam XVAR=X .PHONY: all all: t0 t0: subdir1/t1 subdir2/t2 &cat $^ -o $@ ### D 755 1143323853 1143323853 outside/ ### 7 644 1143324382 1177406833 outside/Makeppfile y: &echo foo bar -o y # also test toplevel commands TEXT = without rule &echo $(TEXT) -o z -&expr 0 # Don't fail. ### D 755 1143323853 1143323853 rootdir/ ### 4 644 1143397582 1143323853 rootdir/RootMakeppfile load_makefile ../outside x: ../outside/y &cp -l $(input) x ### D 755 1067451876 971325262 subdir1/ ### 6 644 1067451876 971325099 subdir1/Makeppfile # # A lower-level makefile. # t1: &echo 1 $(XVAR) -o $@ ### D 755 1067451876 971325262 subdir2/ ### 5 644 1067451876 971325089 subdir2/elifekam # # Another lower-level makefile. # t2: &echo 2 $(XVAR) -o $@ ### D 755 1067451876 965495978 answers/ ### 1 644 1067451876 1190053853 answers/n_files 3 1 0 ### 2 644 1067451876 971325134 answers/t0 1 X 2 X ### D 755 1143323853 1143323853 answers/outside/ ### 1 644 1143324537 1143323853 answers/outside/z without rule ### D 755 1143323853 1143323853 answers/rootdir/ ### 1 644 1143324537 1143323853 answers/rootdir/x foo bar makepp-2.0.98.3/t/last_chance.test0000644000175000017500000000330411715724623017006 0ustar pfeifferpfeiffer### SPAR ### 4 755 1308567017 1308567017 makepp_test_script.pl makepp qw(default dir/all); n_files 'n_files_0'; makepp '--rm_stale'; # Make sure that the wildcard doesn't match the last_chance targets 1; ### 16 644 1308566871 965331711 Makeppfile $(phony default): file1 x f%ile2x: f%ile2 &cp $< $@ f%ile3x: f%ile3 &cp $< $@ file% other%: :last_chance &echo $X $@ -o $@ &echo other$@ -o $(word 2, $(outputs)) $(phony x): file1 file2 other3 X := $(first_available file2) # Instance the rule for file2 X := $(wildcard file*) # file1 and file3 aren't instanced yet ### D 755 1308566871 1308564810 dir/ ### 12 644 1308566871 1308564770 dir/Makeppfile # These rules must not match a, which is a normal file $(phony all): a b/ c/ %/: :last-chance &mkdir $(output) &touch $(output).last-chance # TODO: file_info marks every matching output as a directory, so later "%: %.yes" never matches %/: %.yes &mkdir $(output) &touch $(output).normal ### 0 644 1308566871 1308564299 dir/a ### 0 644 1308566871 1308564717 dir/b.yes ### D 755 1308567039 1308567040 answers/ ### 1 644 1308566871 965332255 answers/file1 file2 file2x file1 ### 1 644 1308566871 965332253 answers/file2 file2 file2x file2 ### 1 644 1308566871 965332260 answers/file3 file2 file2x file3 ### 1 644 1308567026 1308567026 answers/n_files 0 2 0 ### 1 644 1308567039 1308567039 answers/n_files_0 8 3 0 ### 1 644 1308566871 965332255 answers/other1 otherfile1 ### 1 644 1308566871 965332253 answers/other2 otherfile2 ### 1 644 1308566871 965332260 answers/other3 otherfile3 ### D 755 1308566871 1308564725 answers/dir/ ### 0 644 1308566871 1308564808 answers/dir/b.normal ### 0 644 1308566871 1308564819 answers/dir/c.last-chance makepp-2.0.98.3/t/include.test0000644000175000017500000000272312067151157016166 0ustar pfeifferpfeiffer### SPAR ### 25 644 1356638908 1356638908 RootMakeppfile # # A simple makefile that tests the "include" statement, including gmake-style late rules. # .PHONY: all all: t0 t1 t2 t3 include a.mk b stale1 stale2 -include c.mk d stale3 t3: &echo $A $B $C -o $@ build_check architecture_independent # Test will run on various stale1: # Not stale after all &echo A=1 -o $@ stale2: # Not stale but up to date &echo -n B=2 -o $@ d.makepp: &echo 't2:\n\t&echo 2 -o $$@\nb.makepp:\n\t&echo "t1:\\\\n\\\\t&echo 1 -o $$$$@" -o $$@' -o $@ ### 2 644 1067451876 965496079 a.mk t0: &echo 0 -o $@ ### 1 664 1356637872 1356637872 stale1 A=0 ### -1 664 1356637872 1356637872 stale2 B=2 ### 1 664 1356637872 1356637872 stale3 C=3 ### D 755 1356637872 1356637872 .makepp ### -7 664 1356637876 1356637872 .makepp/stale1.mk CWD=. SORTED_DEPS= BUILD_SIGNATURE=1356637872,4 COMMAND=&echo A= -o stale1 DEP_SIGS= SIGNATURE=1356637872,4 END= ### -7 664 1356637876 1356637872 .makepp/stale2.mk CWD=. SORTED_DEPS= BUILD_SIGNATURE=1356637872,3 COMMAND=&echo -n B=2 -o stale2 DEP_SIGS= SIGNATURE=1356637872,3 END= ### -2 664 1356637876 1356637872 .makepp/stale3.mk BUILD_SIGNATURE=1356637872,4 END= ### D 755 1067451876 965496320 answers ### 1 644 1067451876 965496171 answers/t0 0 ### 1 644 1067451876 965496171 answers/t1 1 ### 1 644 1067451876 965496309 answers/t2 2 ### 1 644 1067451876 965496309 answers/t3 1 2 3 ### 1 644 1356113494 1356113494 answers/n_files 7 1 0 makepp-2.0.98.3/t/implicit_load.test0000644000175000017500000000345610674045030017352 0ustar pfeifferpfeiffer### SPAR ### 11 755 1143325379 1143323853 makepp_test_script.pl # # Test of implicit makefile loading, which should fail when leaving a root. # It should always succeed when there is no RootMakeppfile. # It should not go to a forbidden subdir. # eval { makepp '-Crootdir' } and die; rename 'rootdir/RootMakeppfile', 'rootdir/Makeppfile'; makepp '-Crootdir'; makepp; ### 9 644 1143324076 990028520 Makeppfile $(phony all): a c no_implicit_load subdir2 a: subdir1/b &cat $^ -o $@ c: subdir2/d subdir2/subsubdir/e &cat $^ -o $@ ### D 755 1143323853 1143323853 rootdir/ ### 2 644 1143324379 1143323853 rootdir/RootMakeppfile x: ../outside/y &cp -l $(input) x ### D 755 1143323853 1143323853 outside/ ### 2 644 1143324382 1143323853 outside/Makeppfile y: &echo foo bar -o y ### D 755 1067451875 990028507 subdir1/ ### 2 644 1067451875 990027944 subdir1/Makeppfile b: &echo 'b' -o $@ ### D 755 1067451875 990028498 subdir2/ ### 1 644 1067451875 990028523 subdir2/d d ### 5 644 1067451875 990028042 subdir2/Makeppfile # # This makefile should not be implicitly loaded. # c: &echo 'Bogus garbage from wrongly loaded makefile' -o $@ ### 1 644 1067451875 990028068 subdir2/d_orig d ### D 755 1067451875 990028498 subdir2/subsubdir/ ### 1 644 1067451875 990028523 subdir2/subsubdir/e e ### 5 644 1067451875 990028050 subdir2/subsubdir/Makeppfile # # This makefile should not be implicitly loaded. # e: &echo 'Bogus garbage from wrongly loaded makefile' -o $@ ### 1 644 1067451875 990028075 subdir2/subsubdir/e_orig e ### D 755 1067451875 990028444 answers/ ### D 755 1143323853 1143323853 answers/rootdir/ ### 1 644 1143324537 1143323853 answers/rootdir/x foo bar ### 1 644 1067451875 990028444 answers/a b ### 2 644 1067451875 990028444 answers/c d e ### 1 644 1067451875 1190053838 answers/n_files 3 1 0 makepp-2.0.98.3/t/extra_dependencies.test0000644000175000017500000000132010674045030020356 0ustar pfeifferpfeiffer### SPAR ### 30 644 1164352699 1179177721 Makeppfile # # This is a test of lines that specify extra dependencies but no rules. # .PHONY: all all: a a: b &echo a -o $@ &cat $^ -o>>$@ a: c d # # Test out this obfuscated idiom for changing two files at once with # one command: # b: c c: &echo c -o c &echo b -o b &cat d -o>>c c: $(( # Multiline list with comment, after rule. d)) d: &echo $@ -o $@ ### D 755 1067451875 965751450 answers ### 5 644 1067451875 965751410 answers/a a b c d d ### 1 644 1067451875 965751410 answers/b b ### 2 644 1067451875 965751410 answers/c c d ### 1 644 1067451875 965751410 answers/d d ### 1 644 1067451875 1190053836 answers/n_files 3 1 0 makepp-2.0.98.3/t/esql.test0000644000175000017500000000341112000307537015472 0ustar pfeifferpfeiffer### SPAR ### 6 755 1317765475 1342133044 makepp_test_script.pl makepp; n_files 'n_files_1'; c_echo '/* unimportant change */', '-o', $_ for qw(t-db2.sqc t-proc.pc); makepp qw(t-db2.c t-proc.c); ### 37 644 1103319650 1319890767 Makeppfile # # Alas all embedded SQL/C precompilers vary wildly in how they work. Test a few very different types. # # Also try alternate syntaxes, only to check if input gets generated $(phony all): xt-db2.c xt-proc.c bin$/db2 PRECOMPILE db2.sqx bin$/foo -bar foo.ec bin$/gpre gpre bin$/proc proc register-parser foo esql-compilation &mkdir bin empty inc sysinc # Generate "precompilers" bin/$(foreach) bin/$(foreach).bat: :foreach db2 foo gpre proc @&echo '#! /bin/sh\necho ok >t-$(foreach).c' -o $(output) @&chmod 755 $(output) @&echo '@echo ok >t-$(foreach).c' -o $(output 2) export DB2INCLUDE=inc:sysinc x%.c: %.sqc bin$/db2 "prep $(input) bindfile" &mv $(stem).c $(output) # Fake compiler can't handle filenames, be different from alternate above x%.c: %.pc bin$/proc config=proc.cfg MODE=ANSI iname=$(input) &mv $(stem).c $(output) $(foreach): :foreach db2.sqx inc/db2a.sqc sysinc/db2b.h \ foo.ec gpre.exx \ proc.pc empty/proc1.h sysinc/proc2.h inc/proc3.h &echo $(map $(output), tr+./++d; $_ = "int $_ = 1;") -o $(output) proc.cfg: &echo 'include=(empty,inc)' -o $(output) ### 3 644 1103319458 1294864859 t-db2.sqc EXEC SQL INCLUDE SQLCA; EXEC SQL INCLUDE db2a; EXEC SQL INCLUDE 'db2b.h'; ### 4 644 1103319429 1294613661 t-proc.pc EXEC ORACLE OPTION (sys_include=sysinc); EXEC SQL INCLUDE PROC1; #include $INCLUDE 'proc3.h'; ### D 755 1103319665 1103319662 answers/ ### 1 644 1067451878 1190053833 answers/n_files_1 20 1 0 ### 1 644 1317765460 1317765460 answers/n_files 0 0 0 makepp-2.0.98.3/t/dry_run_what_if.test0000644000175000017500000000664412041175702017726 0ustar pfeifferpfeiffer### SPAR ### 26 644 1067451874 1350842084 makepp_test_script.pl # # Test various kinds of fake signatures that we generate using the # --assume-new, --assume-old, and -n option. # sub doit { my( $sf, $opt, $bl, $af, $nowait ) = @_; c_echo $sf, '-osourcefile' if $sf; c_grep '/^&(?:cat|sed)/', "-Ii$ENV{PERL} $makepp_path -r $opt|", "-obuild_log_$bl"; c_cp allfiles => "allfiles_$bl" if $af; wait_timestamp 'allfiles' if !$nowait; } doit 'source_original', '', '0'; doit 0, '-W f', 'W_f', 1; c_touch 'h'; doit 'source_modified', '-o sourcefile', 'o_sourcefile', 1; c_echo 'g_modified', '-og'; doit 'source_original', '--dont-build g', 'dont_build_g', 1; doit 0, '-n', 'n', 1, 1; 1; ### 31 644 1118567371 1059888249 Makeppfile # # Makefile that is used to test the various kinds of fake signatures that # we use: --assume-new, --assume-old, and -n. # $(phony all): allfiles allfiles: ab ac bc &cat $^ -o $@ a : e f : build_check target_newer # Make sure target_newer supports it too. &cat $^ -o $@ b : g h &cat $^ -o $@ c : f h &cat $^ -o $@ # Sourcefile is built by makepp_test_script. e f g h: sourcefile &sed "s/$$/ $@/" sourcefile -o $@ ab: a b &cat $^ -o $@ bc: b c &cat $^ -o $@ ac: a c &cat $^ -o $@ ### D 755 1067451874 1060021421 answers ### 12 644 1067451874 1060021408 answers/allfiles_n source_original e source_original f g_modified source_original h source_original e source_original f source_original f source_original h g_modified source_original h source_original f source_original h ### 6 644 1067451874 1060021403 answers/build_log_W_f &cat e f -o a &cat a b -o ab &cat f h -o c &cat a c -o ac &cat b c -o bc &cat ab ac bc -o allfiles ### 7 644 1067451874 1060021405 answers/build_log_o_sourcefile &sed "s/$/ h/" sourcefile -o h &cat g h -o b &cat a b -o ab &cat f h -o c &cat a c -o ac &cat b c -o bc &cat ab ac bc -o allfiles ### 12 644 1067451874 1060021408 answers/allfiles_dont_build_g source_original e source_original f g_modified source_original h source_original e source_original f source_original f source_original h g_modified source_original h source_original f source_original h ### 11 644 1067451874 1060021401 answers/build_log_0 &sed "s/$/ e/" sourcefile -o e &sed "s/$/ f/" sourcefile -o f &cat e f -o a &sed "s/$/ g/" sourcefile -o g &sed "s/$/ h/" sourcefile -o h &cat g h -o b &cat a b -o ab &cat f h -o c &cat a c -o ac &cat b c -o bc &cat ab ac bc -o allfiles ### 5 644 1067451874 1060021408 answers/build_log_n &sed "s/$/ g/" sourcefile -o g &cat g h -o b &cat a b -o ab &cat b c -o bc &cat ab ac bc -o allfiles ### 1 644 1067451874 1190053829 answers/n_files 5 1 0 ### 12 644 1067451874 1060021405 answers/allfiles_o_sourcefile source_original e source_original f source_original g source_modified h source_original e source_original f source_original f source_modified h source_original g source_modified h source_original f source_modified h ### 10 644 1067451874 1060021408 answers/build_log_dont_build_g &sed "s/$/ e/" sourcefile -o e &sed "s/$/ f/" sourcefile -o f &cat e f -o a &sed "s/$/ h/" sourcefile -o h &cat g h -o b &cat a b -o ab &cat f h -o c &cat a c -o ac &cat b c -o bc &cat ab ac bc -o allfiles ### 12 644 1067451874 1060021403 answers/allfiles_W_f source_original e source_original f source_original g source_original h source_original e source_original f source_original f source_original h source_original g source_original h source_original f source_original h makepp-2.0.98.3/t/directories.test0000644000175000017500000000144611144656675017072 0ustar pfeifferpfeiffer### SPAR ### 1 755 1118558856 1212336975 .makepprc --rm-stale ### 29 644 1143572904 1234386298 Makeppfile # # Test making files in directories that don't exist yet. # .PHONY: all perl_begin # Make sure that '/' gets parsed properly (not as ''!) use Mpp::File; die unless file_info('/') == file_info('/.'); perl_end all: a b c %: subdir/% &echo $@ -o $@ &cat $< -o>>$@ subdir/$( a b c): subdir &echo $@ -o $@ subdir: &mkdir $@ subdir2/Makeppfile: &mkdir $(dir $@) &touch $@ load_makefile subdir2/Makeppfile ### D 755 1067451874 965619410 answers ### 2 644 1067451874 965619363 answers/a a subdir/a ### 2 644 1067451874 965619363 answers/b b subdir/b ### 2 644 1067451874 965619363 answers/c c subdir/c ### 1 644 1067451874 1190053826 answers/n_files 8 1 0 makepp-2.0.98.3/t/conditionals.test0000644000175000017500000001400611001221432017203 0ustar pfeifferpfeiffer### SPAR ### 381 644 1172615881 1181421762 Makeppfile # # Test the use of conditionals. # # This little (non-)rule comes from 2004_12_16_endif.test. Put it first, # so in error makepp would pick it up as the default: ifdef FOO $(phony foo): perl -e 1 endif XYZ = abc ifeq($(XYZ),abc) # comment with ) DEF := de endif ifeq('(XYZ)',"("XYZ\)) DEF := $(DEF)f endif # Test that it's enough for one of these to be defined. ifdef GHI DEF UVW # Test that none of these may be defined. ifndef ABC XYZ # just a comment XYZ := Abc endif endif # Test that none of these may be the current system. ifnsys bathtub shower basin # Test that it's enough for one of these to the current system. ifsys sparc power* i[3-6]86 *[a-zA-Z0-9]* ifneq "$(DEF)" 'dsdffasd' # Another form of ifeq GHI := ghi else GHI := GHI endif endif endif ifdef ABC PDQ JKL := JKL else JKL := jkl endif ifperl $JKL eq 'jkl' P1 := P1 else P1 := p1 endif ifmakeperl '$(JKL)' ne 'jkl' MP1 := MP1 else MP1 := mp1 endif XX1 := $(if ,xx1,XX1) XX2 := $(if 0,xx2,XX2) XX3 := $(iftrue 0,xx3,XX3) XX4 := $(iftrue zero,xx4,XX4) ifdef FOO # Check that the "else" in the perl_begin block doesn't match up with ifdef perl_begin if(1) { print "OK\n"; } else { print "NOK\n"; } perl_end endif # FOO $(phony all): testfile testfile2 testfile3 phonytarget testfile5 x ifeq testfile: ifeq ($(XYZ),abc) # Here is a comment that should be ignored. &echo abc -o $@ else &echo ABC -o $@ endif ifneq $(JKL) 'jkl' &echo JKL -o >>$@ else &echo jkl -o>>$@ endif &echo $(DEF) -o>>$@ &echo $(GHI) -o>>$@ &echo $(JKL) -o>>$@ &echo $(P1) -o>>$@ &echo $(MP1) -o>>$@ &echo $(XX1) -o>>$@ &echo $(XX2) -o>>$@ &echo $(XX3) -o>>$@ &echo $(XX4) -o>>$@ # # Test some things relating to whitespace and if statements, which are often # indented: # ifeq (,) testfile2: &echo $@ -o $@ &echo "This is another line." -o>>$@ ifeq(,) testfile3: # Not part of testfile2's action. &echo $@ -o $@ endif $(phony phonytarget): testfile4 ifeq(,) X=5 # This should not be part of phonytarget's action. endif testfile4: &echo $@ $(X) -o $@ endif # Test else within Perl blocks ifeq "a"b, 'a'b testfile5:: &echo before -o>>$@ perl { if (1) { $a = 1 } else { $a = 2 } } testfile5:: &echo after -o>>$@ else # this one is for real testfile5:: &echo no -o >>$@ perl {{ if (1) { $a = 1 } else { $a = 2 } }} testfile5:: &echo still not -o>>$@ endif ifneq 'a', a testfile5:: &echo no -o>>$@ perl_begin if (1) { $a = 1 } else { $a = 2 } perl_end testfile5:: &echo still not -o>>$@ else # this one is for real testfile5:: &echo before -o>>$@ perl_begin if (1) { $a = 1 } else { $a = 2 } perl_end testfile5:: &echo after -o>>$@ endif # This checks that unnecessary tests are not performed, and that we # get the right combined truthvalue. TRUE = 1 ifdef FALSE and ifperl die or ifdef TRUE and ifdef FALSE and ifperl die perl { die } else ifdef FALSE or ifdef TRUE and ifdef FALSE perl { die } else ifdef TRUE and ifdef TRUE or ifperl die and ifperl die or ifperl die testfile5:: &echo and or else if -o>>$(output) else perl { die } endif # Test that an initial success with else ifxxx, doesn't also do else. ifdef TRUE perl { 1 } else ifdef FALSE perl { die } else perl { die } endif ifdef FALSE perl { die } else ifdef TRUE perl { 1 } else ifdef FALSE perl { die } else perl { die } endif AAA := . BBB := 1 ifndef BBB ifneq($(AAA),.) endif perl_begin die "NOT BBB $BBB"; perl_end endif CCC := 1 # NOTE: This works if you insert a blank line after "ifdef A" ifdef CCC else perl { die } endif # This comes from former 2004_05_13_ifdef.test: XX := 0 ifdef XX Y := OK endif x: &echo $(Y) -o $@ # Now check the new 'iftrue' statement: ifntrue $(CCC) or iftrue $(XX) perl { die } endif # # Former 2003_10_11_ifeq.test # # Test of all possible syntaxes of ifeq command (submitted by Anders Johnson). # Case PAREN := (1) added on 05/07/2006 to test bug for variables having parentheses # to avoid ambiguity, var with parenthesis should be inside outer ifeq parentheses # or inside quotes # PLAIN := 1 PAREN := (1) $(phony ifeq): ifeq ("$(PLAIN)","1") @&echo ok1 else @&expr -n endif ifeq ($(PLAIN),1) @&echo ok2 else @&expr -n endif ifeq $(PLAIN) 1 @&echo ok3 else @&expr -n endif ifeq ($(PLAIN), 1) @&echo ok4 else @&expr -n endif ifeq "$(PLAIN)" "1" @&echo ok5 else @&expr -n endif ifeq ("$(PLAIN)", "1") @&echo ok6 else @&expr -n endif ifeq ('$(PLAIN)','1') @&echo ok7 else @&expr -n endif ifeq ('$(PLAIN)', '1') @&echo ok8 else @&expr -n endif ifeq '$(PLAIN)' '1' @&echo ok9 else @&expr -n endif ifeq('$(PLAIN)','1') @&echo ok10 else @&expr -n endif ifneq ('$(PLAIN)','1') @&expr -n else @&echo ok11 endif ifneq($(PLAIN),1) @&expr -n else @&echo ok12 endif ifeq (1,1) @&echo ok13 else @&expr -n endif ifeq 1 1 @&echo ok14 else @&expr -n endif ifeq (1 , 1) @&echo ok15 else @&expr -n endif ifeq ("$(PAREN)", "(1)") @&echo ok16 else @&expr -n endif ifeq ($(PLAIN), 1) @&echo ok17 else @&expr -n endif ifeq "(1)" , "$(PAREN)" @&echo ok18 else @&expr -n endif ifeq ($(PAREN) , (1)) # )) @&echo ok19 else @&expr -n endif ifeq ('$(PAREN)', '(1)') @&echo ok20 else @&expr -n endif ifeq '$(PAREN)','(1)' @&echo ok21 else @&expr -n endif ifneq ($(PLAIN),1 ) @&echo ok22 else @&expr -n endif ifnsys MSWin* # Test that ! is executable ! false endif ### D 755 1172615888 973201896 answers/ ### 1 644 1172615881 1190053819 answers/n_files 6 3 0 ### 11 644 1172615881 973201862 answers/testfile abc jkl def ghi jkl P1 mp1 XX1 xx2 XX3 xx4 ### 2 644 1172615881 973201862 answers/testfile2 testfile2 This is another line. ### 1 644 1172615881 973201862 answers/testfile3 testfile3 ### 1 644 1172615881 973201862 answers/testfile4 testfile4 5 ### 5 644 1172615881 973201862 answers/testfile5 before after before after and or else if ### 1 644 1172615881 1084501218 answers/x OK makepp-2.0.98.3/t/changed_inputs.test0000644000175000017500000000233112000307540017513 0ustar pfeifferpfeiffer### SPAR ### 14 644 1103821381 1103821396 Makeppfile # # This makefile tests the $(changed_inputs) variable and the # ignore_action build check method. # $(phony all): abcdef abcdef_always abcdef : a b c d e f : build_check ignore_action &echo $(changed_inputs) -o $(output) # This isn't a very useful command; we just want # the output to vary depending on the command. abcdef_always : a b c d e f # Same thing except without ignore_action. &echo $? -o $(output) ### 18 755 1103821634 1342132448 makepp_test_script.pl # # Test what happens if we have $(changed_inputs) in a command, and we # only change a few of the inputs. # c_touch qw(a b c d e f); # Create the initial files. makepp; rename abcdef => 'abcdef_1'; # # Now change 3 of the files: # c_echo $_, '-o', $_ for qw(a b c); makepp; rename abcdef => 'abcdef_2'; makepp; # This one should not rebuild abcdef # though the command has changed. # However, it will build abcdef_always. ### D 755 1103821506 1103821509 answers/ ### 1 644 1103821477 1103821477 answers/abcdef a b c d e f ### L H 0 0 answers/abcdef_1 answers/abcdef ### L H 0 0 answers/abcdef_2 answers/abcdef ### 1 644 1103821476 1103821477 answers/abcdef_always makepp-2.0.98.3/t/c_compilation.test0000644000175000017500000000201012000311123017322 0ustar pfeifferpfeiffer### SPAR ### 1 644 1329052295 1329052295 is_relevant.pl have_cc ### 3 755 1067451873 1329052311 makepp_test_script.pl makepp qw(--no_path_executable_dep compilation_test); c_cp 'n_files.win', 'answers/n_files' if is_windows; !system '.' . ($^O =~ /^MSWin/ ? '\\' : '/') . 'compilation_test >output'; ### 9 644 1120067422 1055627995 compilation_test.c #include #include "x.h" #include "y.h" int main() { printf("%d %d %d %d\n", __LINE__, X, X2, Y); return 0; } ### 2 644 1236523730 1236523995 hint This test either requires makepp to find a known compiler in your PATH, or you must provide one in the environment variable CC. ### 1 644 1067451873 1055628127 n_files.win 2 1 0 ### 1 644 1067451873 1055626466 x.h #define X 1 ### 1 644 1067451873 1055551960 x2.h #define X2 2 ### 2 644 1067451873 1055626463 y.h #include "x2.h" #define Y 3 ### D 755 1067451873 1055628127 answers ### 1 644 1067451873 1055628127 answers/n_files 2 0 0 ### 1 644 1067451873 1055628033 answers/output 7 1 2 3 makepp-2.0.98.3/t/builtins.test0000644000175000017500000003266311757513750016410 0ustar pfeifferpfeiffer### SPAR ### 191 421 1162935563 1217791125 RootMakeppfile # # This file tests the builtin commands. # # Test &rm by specifying dirs first and deleting answers for files we never create $(phony all): a b c \ dir2/c dir2/d dir2/subdir/c dir2/subdir/d dir2/subdir/d1 install_log \ c[au]t.out echo.out sed.out expr.out grep.out sort.out template.out uniq.out uc.out \ preprocess.out &rm -fv bogus answers/bogus answers/bogus/subdir answers/bogus/file answers/bogus/subdir/file IGNINST = ifperl ((stat 'RootMakeppfile')[2] & 01777) != 0421 CHMOD = @&echo chmod not working, //server/share? CHMODTEST = perl { unlink 'answers/install_log' } ifnsys cygwin IGNINST = - # Because &install fails if chmod() does endif else CHMOD = &chmod CHMODTEST = perl { ((stat 'b')[2] & 0777) == 0664 && ((stat 'c')[2] & 0777) == 0750 or die } endif # Test comment on same line and &touch a b: &touch -v $(outputs) # tab comment $(CHMOD) -v 664 $(outputs) # space comment # Test that &ln -f removes an empty dir and &chmod c: dir1/c b &ln -v --force $(input) . &ln -fv RootMakeppfile dir1 $(CHMOD) 750 c $(CHMODTEST) # Test &mkdir -p implicitly also making parent and -A dir2/subdir dir2: &echo -o $(mktemp) -- -vpfm750 &mkdir -A $(mktemp /) $(output) # Test &ln dir2/c: dir1/c dir2 &ln -v $(input) $(dir $(output)) # Test &ln -s dir2/d: dir1/d dir2 &ln --verbose --symbolic ../$(input) $(output) # Test &ln -r dir2/subdir/c dir2/subdir/d: dir1/c dir1/d dir2 &ln --verbose --resolve $(wordlist 1, 2, $(inputs)) $(dir $(output)) # Test &ln -r with short opts dir2/subdir/d1: dir1/d dir2 &ln -vr $(input) $(output) # Test &sed and -r0 # helper variable for sed what = just %.out: %.in uniq.in &perl -r0 'print tr/a-e//, ":"' $(inputs) --output=$(output) &perl 'print "$$.\n"' $(input) --output=>>$(output) &sed -v s/$$what/only/o $(input) --output=>>$(output) &sed -v 'chomp; $$_ .= "|" . reverse . "\n"' -o +<$(output) # Test complicated variant of &cat with missing newline and multi line file. cat.out: sed.in uniq.in &cat --sync-lines $(inputs 1 2 1) -o $(output) # Test various variants of &cut cut.out: cut.in &cut -vf1..-2 -d\ $(input) -o $(output) &cut -vmp '%s\0%3s\0%2s\n' -f1,3,-1 -d\ $(input) -o >>$(output) &cut -vmf16 -d\ $(input) -o >>$(output) &cut -vf1 -sdf $(input) -o >>$(output) &cut -vc0,1,4..6,11..-1 $(input) -o >>$(output) &cut -vl1,4,6..-5 $(input) -o >>$(output) &cut -vSmf1 -dF $(input) -o >>$(output) &cut -vSl1,-2 $(input) uniq.in -o >>$(output) # Test various variants of &echo and its siblings echo.out: &echo -o $(output) - -- no options - -n -o $(output) &echo -nE aa\\tbb \# no comment! -o >>$(output) # NUL is the only code portable to EBCDIC &echo 'aa\tbb\x00cc\x{0000}dd\000ee' -o >>$(output) &printf -E '%03d\t%02.2f:%s:' 5 5 '\123' -o >>$(output) &printf '%03d\t%02.2f:%s:\n' 5 5 '\123' -o >>$(output) ifnsys MSWin* &yes Hi there! -o '| read x; echo $$x >>$(output)' &yes -o '| read x; read y; echo $$x $$y >>$(output)' else # Complex Shell command not available on native Windows. &echo 'Hi there!\ny y' -o >>$(output) endif # Test arithmetic, logical and string &expr expr.out: -&expr -n 8 - 3 * 2 - 2 -o $(output) &expr 8 - 3 * 2 > 1 && "'joy'" || \'sorrow\' -o >>$(output) # Test various variants of &grep sub choose_a { /a/ } grep.out grep.o grep.ou: grep.in &grep --separator=, /a/ grep.in -o grep.o -w grep.waste &grep -co '>>grep.o' /a/ template.tmpl &grep --vice-versa -s, /a/ grep.in -o '>>grep.o' &grep -r3 /a/ grep.in -o '>>grep.o' &grep -vco '>>grep.o' &choose_a template.tmpl &grep -l /[Jj]ust/ RootMakeppfile sed.in template.tmpl -o '>>grep.o' &echo -o '>>grep.o' &grep -vl /[Jj]ust/ RootMakeppfile sed.in template.tmpl -o '>>grep.o' &echo -o '>>grep.o' &grep -vvl /[Jj]ust/ RootMakeppfile grep.in template.tmpl uniq.in -o '>>grep.o' &cp -vfl grep.o grep.ou &cp -v grep.ou grep.ou1 &mv -v grep.ou1 $(output) # Test &sort perl { sub transform { $_ = ((split)[1] || '')."\0$_" } sub detransform { (split "\0")[1] }} sort.out: template.tmpl ifperl 'a' lt 'A' # Ebcdic, sorts differently &cp -l answers/sort.out . else &sort $(input) -o $(output) &echo + -o >>$(output) &sort --compare '$$b cmp $$a' $(input) -o >>$(output) &echo + -o >>$(output) &sort -t '$$_ = [lc, $$_]' -c '$$a->[0] cmp $$b->[0]' -d '$$_->[1]' $(input) -o >>$(output) &echo + -o >>$(output) &sort -t &transform -d &detransform $(input) -o >>$(output) &echo +++ -o >>$(output) &sort --uniq $(input) $(input) -o >>$(output) &echo + -o >>$(output) &sort --unique --compare '$$b cmp $$a' $(input) $(input) -o >>$(output) &echo + -o >>$(output) &sort -ut '$$_ = [lc, $$_]' -c '$$a->[0] cmp $$b->[0]' -d '$$_->[1]' $(input) $(input) -o >>$(output) &echo + -o >>$(output) &sort -urt transform -d detransform $(input) $(input) -o >>$(output) &echo + -o >>$(output) &sort -uc 'ord( $$a ) <=> ord $$b' $(input) -o >>$(output) endif # Test &template perl { %hash = (aa => 1, aaa => "1\n2", TITLE => 'Test') } %.out: title.tmpl %.tmpl &template -v -o $(output) -h\\%hash THIS=foo THAT=bar:$$1: $(inputs) &template -dv --simple=|<|/>| --multiline=|<|>|| -h '+{%hash, bb => 2}' template.xml -o >>$(output) &template -vS -o >>$(output) -h\\%hash THIS=foo THAT=bar:$$1: $(input 2) # Test &uniq # helper function for --compare sub c0(\$) { substr ${$_[0]}, 0, 1 } uniq.out: uniq.in sed.in &uniq $(input) -o $(output) &uniq -c 'c0( $$a ) ne c0 $$b' $(input) -o >>$(output) &uniq -S $(inputs 2 1) -o >>$(output) &uniq -S $(inputs 1 1) -o >>$(output) # Must reemit file name first time. install_log: &rm -f .install_log installog &install --directory --mode=750 dest $(IGNINST)&install -v --mode=640 grep.in dest $(IGNINST)&install -vc --log installog --mode=666 sed.in dest/foobar &sed 's/^[^ ].*/date/; s|`[^`]+(?=/dest)|`...|' .install_log installog -o install_log &uninstall -v &uninstall -v installog @perl { and die "uninstall failed\n" } # Test own command with frame and loaded fom a module perl { use mymodule } uc.out: uniq.in &uc -v $(input) -o $(output) preprocess.out: preprocess.test &preprocess -v v4=foobar e== -h\\%hash preprocess.test -o preprocess.out &preprocess -va v2=xyz e== preprocess.test -o >>preprocess.out ### 13 644 1141068683 1140901286 mymodule.pm package mymodule; require Exporter; our @ISA = 'Exporter'; our @EXPORT = 'c_uc'; sub c_uc { local @ARGV = @_; Mpp::Cmds::frame { print "\u\L$_" while <>; } qw(f i I o O r s); } 1; ### -12 644 1134923188 1134923188 cut.in ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ !"# $%&' ()*+ ,-./ 0123 4567 89:; <=>? @ABC DEFG HIJK LMNO PQRS TUVW XYZ[ \]^_ `abc defg hijk lmno pqrs tuvw xyz{ |}~ ### 0 644 1107332258 1105783994 dir2 ### 1 644 1107332258 1107331351 grep.in aha,foo,bar,with a,without ### 4 644 1236528312 1236528312 hint This tests links and symbolic links, among other things. If your file system doesn't support either of these, you can try running this test with a workaround that consists in setting the environment variable MAKEPP_LN_CP to 1, 2 or 3. If you want to use the &ln builtin later on, always set it. ### 22 644 1153676973 1313824017 preprocess.test # empty & comment $() $()# empty & comment not gone con- \$() tinuation no \ continuation v1 += 5 override v2 := $(v1) define v3 long var enddef $()v4 = 1 show aa $e $(aa); v1 $e $(v1); v2 $e $(v2); v3 $e $(v3); v4 $e $(v4) $()include plain text ifeq $(v1),5 -include $( preprocess.test) # Force expand text, which didn't initially work. endif ### -1 644 1107332258 1105995922 sed.in just some text ### 7 644 1107332258 1106072810 template.tmpl Just a silly test to see if @THIS@ and @aaa@ all @@THIS@@ and this@@ before here @@THAT(stuff)@@ foo bar goner @@ gets replaced. 1 + 2 = @{ 1 + 2 }@ ### 7 644 1113205406 1113205406 template.xml <{ 1 + 2 }/> foo bar ### 7 644 1107332258 1106067541 title.tmpl @UNDEF@@field=Title@\ @TITLE?=nothing@\ @field@\ @field { ' ' . ($_[0]+1) . " is$_[1]" }@\ @n=0@\ @field(@n@,:)@ @TITLE@ -------------------- ### 5 644 1112771877 1112771877 uniq.in aa aa b bb bcd ### D 755 1107332258 1105873176 c/ ### D 755 1107332258 1105741386 dir1/ ### 1 644 1107332258 1105741331 dir1/c c ### 1 644 1107332258 1105741386 dir1/d d ### D 755 1172254968 1172254974 answers/ ### 0 644 1107332258 1105741346 answers/a ### 0 644 1107332258 1105741350 answers/b ### 1 644 1107332258 1105873176 answers/c c ### -10 644 1191603652 1191603922 answers/cat.out #line 1 "sed.in" just some text #line 1 "uniq.in" aa aa b bb bcd #line 1 "sed.in" just some text ### 48 644 1134924208 1217791214 answers/cut.out ! " # $ % & ' ( ) * + , - . 1 2 3 4 5 6 7 8 9 : ; < = > A B C D E F G H I J K L M N Q R S T U V W X Y Z [ \ ] ^ a b c d e f g h i j k l m n q r s t u v w x y z { | } 0123 4567 89:; <=>? @ABC DEFG HIJK LMNO PQRS TUVW XYZ[ \]^_ `abc defg hijk lmno pqrs tuvw xyz{ |}~ " / 1 3 ? A C O Q S _ a c o q s ~ / g h i j k l m n o g hijk lmno " # & ' ( ) * + , - . / 0 2 3 6 7 8 9 : ; < = > ? @ B C F G H I J K L M N O P R S V W X Y Z [ \ ] ^ _ ` b c f g h i j k l m n o p r s v w x y z { | } ~ ! $%)*+ ,-./ 01 459:; <=>? @A DEIJK LMNO PQ TUYZ[ \]^_ `a deijk lmno pq tuyz{ |}~ ! " # $ % & ' ( ) * + , - . / P Q R S T U V W X Y Z [ \ ] ^ _ p q r s t u v w x y z { | } ~ !"# $%&' ()*+ ,-./ 0123 4567 89:; <=>? #line 3 "cut.in" G H I J K L M N O #line 9 G HIJK LMNO #line 1 "cut.in" ! " # $ % & ' ( ) * + , - . / #line 11 `abc defg hijk lmno #line 1 "uniq.in" aa #line 4 bb ### 5 644 1112222831 1112222831 answers/echo.out - no options - -n -o echo.out aa\tbb # no comment!aa bbccddee 005\t5.00:\123:005 5.00:\123: Hi there! y y ### 1 644 1107332258 1105998624 answers/expr.out 0joy ### 12 644 1139267891 1107332362 answers/grep.out aha,bar,with a,4 foo,without ahaar,h a3 RootMakeppfile sed.in template.tmpl RootMakeppfile template.tmpl grep.in uniq.in ### 1 644 1172254973 1172254973 answers/grep.waste foo,without ### 8 644 1135411294 1135030728 answers/install_log date create directory `.../dest' date move `grep.in' to `.../dest/grep.in' set mode for `.../dest/grep.in' date copy `sed.in' to `.../dest/foobar' set mode for `.../dest/foobar' ### 1 644 1107332258 1106296317 answers/n_files 24 1 0 ### 27 644 1153678733 1153342165 answers/preprocess.out # empty & comment not gone con- \ tinuation no continuation v1 += 5 override v2 := define v3 long var enddef v4 = 1 show aa = 1; v1 = ; v2 = ; v3 = ; v4 = foobar include plain text # empty & comment not gone con- \ tinuation no continuation show aa = ; v1 = 5; v2 = 5; v3 = long var; v4 = 1 include plain text # empty & comment not gone con- \ tinuation no continuation show aa = ; v1 = 5 5; v2 = 5 5; v3 = long var; v4 = 1 include plain text ### 2 644 1139987227 1217368876 answers/sed.out 2:10:1|1:01:2 only some text|txet emos ylno ### 69 644 1137661544 1134935825 answers/sort.out @@ @@THAT(stuff)@@ Just a silly test to see if @THIS@ and @aaa@ all @@THIS@@ and this@@ before here foo bar gets replaced. 1 + 2 = @{ 1 + 2 }@ goner + goner gets replaced. 1 + 2 = @{ 1 + 2 }@ foo bar all @@THIS@@ and this@@ before here Just a silly test to see if @THIS@ and @aaa@ @@THAT(stuff)@@ @@ + @@ @@THAT(stuff)@@ all @@THIS@@ and this@@ before here foo bar gets replaced. 1 + 2 = @{ 1 + 2 }@ goner Just a silly test to see if @THIS@ and @aaa@ + @@ @@THAT(stuff)@@ goner all @@THIS@@ and this@@ before here Just a silly test to see if @THIS@ and @aaa@ foo bar gets replaced. 1 + 2 = @{ 1 + 2 }@ +++ @@ @@THAT(stuff)@@ Just a silly test to see if @THIS@ and @aaa@ all @@THIS@@ and this@@ before here foo bar gets replaced. 1 + 2 = @{ 1 + 2 }@ goner + goner gets replaced. 1 + 2 = @{ 1 + 2 }@ foo bar all @@THIS@@ and this@@ before here Just a silly test to see if @THIS@ and @aaa@ @@THAT(stuff)@@ @@ + @@ @@THAT(stuff)@@ all @@THIS@@ and this@@ before here foo bar gets replaced. 1 + 2 = @{ 1 + 2 }@ goner Just a silly test to see if @THIS@ and @aaa@ + gets replaced. 1 + 2 = @{ 1 + 2 }@ foo bar Just a silly test to see if @THIS@ and @aaa@ all @@THIS@@ and this@@ before here goner @@THAT(stuff)@@ @@ + @@THAT(stuff)@@ Just a silly test to see if @THIS@ and @aaa@ all @@THIS@@ and this@@ before here foo bar goner ### 20 644 1107332258 1181388408 answers/template.out Title 1 is: Test -------------------- Just a silly test to see if foo and 1 2 all foo before here bar:stuff: gets replaced. 1 + 2 = 3 1 2 3 4 #line 1 "template.tmpl" Just a silly test to see if foo and 1 #line 1 2 all foo before here #line 6 bar:stuff: gets replaced. 1 + 2 = 3 ### 5 644 1140901721 1140901721 answers/uc.out Aa Aa B Bb Bcd ### 26 644 1112771877 1180279531 answers/uniq.out aa b bb bcd aa b #line 1 "sed.in" just some text #line 1 "uniq.in" aa #line 3 b bb bcd #line 1 "uniq.in" aa #line 3 b bb bcd #line 1 aa #line 3 b bb bcd ### D 755 1109777984 1109777998 answers/bogus/ ### 0 644 1109777998 1109777998 answers/bogus/file ### D 755 1109777984 1109777984 answers/bogus/subdir/ ### 0 644 1109777998 1109777998 answers/bogus/subdir/file ### D 755 1107332258 1105873176 answers/dir2/ ### 1 644 1107332258 1105741331 answers/dir2/c c ### 1 644 1107332258 1105741407 answers/dir2/d d ### D 755 1107332258 1105741407 answers/dir2/subdir/ ### 1 644 1107332258 1105741407 answers/dir2/subdir/c c ### 1 644 1107332258 1105873176 answers/dir2/subdir/d d ### 1 644 1107332258 1105871996 answers/dir2/subdir/d1 d makepp-2.0.98.3/t/build_cache.test0000644000175000017500000001414412000307541016750 0ustar pfeifferpfeiffer### SPAR ### 55 755 1103935704 1342132247 makepp_test_script.pl makepp \'builtin', qw(-MMpp::BuildCacheControl create --subdir-chars= ./build_cache); # # Now build some junk with makepp. # makepp 'two_letter_files'; # Make a bunch of files with the name [ab]?. # # Now check whether makepp can automatically add files to the build cache # if we let it. # unlink 'mt'; makepp qw(--build-cache build_cache derived_files); # # Now verify that rebuilding the file with different contents does not wipe # out the value in the build cache, but it can be brought back without # difficulty. # unlink <*_build_record>; makepp qw(--build-cache build_cache derived_files EXTRA_WORD=test2); # Rebuild the files. -e $_.'_build_record' or die $_ for ; # This should rebuild everything. unlink <*_build_record>; # Get rid of the build record from the last build. makepp qw(--build-cache build_cache derived_files); # Rebuild the files. This should bring back # the old ones from the cache, and they should # not have been overwritten by the new ones. -e $_.'_build_record' and die $_ for ; # # Test copying the build files into a different subdirectory than they # were created in. # makepp qw(--build-cache build_cache -F subdir1 derived_files); -e $_.'_build_record' and die $_ for ; # Do it again with the altered files. makepp qw(--build-cache build_cache -F subdir2 derived_files EXTRA_WORD=test2); -e $_.'_build_record' and die $_ for ; # # Corrupt one file in the build cache, and verify that the file is # correctly rejected. # for( ) { chmod 0755, $_; c_echo 'an improper modification', "-o>>$_"; } makepp qw(--build-cache build_cache -F subdir3 aa); 1; # No error. ### 34 644 1103934641 1103934641 Makeppfile # # Test of the build cache. # $(phony two_letter_files): ba bb bc bd aa ab ac ad: : signature md5 &echo $@ $(EXTRA_WORD) -o $@ &echo $@ -o $@_build_record # Side effect that makepp should not know # about enables us to test whether they come # out of the build cache. b% : a% : signature md5 &cat $< -o $@ &echo $@ -o>>$@ &echo $@ -o $@_build_record # Side effect that makepp should not know # about enables us to test whether they come # out of the build cache. mt : &touch $@ $(phony derived_files): $(wildcard c_[ab]?) c_%: % : signature md5 &echo This file is derived from $<. -o $@ &cat $< -o>>$@ &echo $@ -o $@_build_record SUBDIRS = $(dir_noslash $(wildcard */Makeppfile)) include mt ### D 755 1103935490 1103936160 subdir1/ ### L H 0 0 subdir1/Makeppfile Makeppfile ### D 755 1103935490 1103936160 subdir2/ ### L H 0 0 subdir2/Makeppfile Makeppfile ### D 755 1103935620 1103936160 subdir3/ ### L H 0 0 subdir3/Makeppfile Makeppfile ### D 755 1103936101 1103936159 answers/ ### 2 644 1103936084 1103936090 answers/aa aa an improper modification ### 1 444 1103936084 1103936084 answers/ab ab ### 1 444 1103936084 1103936084 answers/ac ac ### 1 444 1103936084 1103936084 answers/ad ad ### 2 444 1103936084 1103936084 answers/ba aa ba ### 2 444 1103936084 1103936084 answers/bb ab bb ### 2 444 1103936084 1103936084 answers/bc ac bc ### 2 444 1103936085 1103936085 answers/bd ad bd ### 3 644 1103936086 1103936090 answers/c_aa This file is derived from aa. aa an improper modification ### 2 444 1103936086 1103936086 answers/c_ab This file is derived from ab. ab ### 2 444 1103936086 1103936086 answers/c_ac This file is derived from ac. ac ### 2 444 1103936086 1103936086 answers/c_ad This file is derived from ad. ad ### 3 444 1103936086 1103936086 answers/c_ba This file is derived from ba. aa ba ### 3 444 1103936086 1103936086 answers/c_bb This file is derived from bb. ab bb ### 3 444 1103936086 1103936086 answers/c_bc This file is derived from bc. ac bc ### 3 444 1103936086 1103936086 answers/c_bd This file is derived from bd. ad bd ### D 755 1103936123 1103936143 answers/subdir1/ ### L H 0 0 answers/subdir1/aa answers/aa ### L H 0 0 answers/subdir1/ab answers/ab ### L H 0 0 answers/subdir1/ac answers/ac ### L H 0 0 answers/subdir1/ad answers/ad ### L H 0 0 answers/subdir1/ba answers/ba ### L H 0 0 answers/subdir1/bb answers/bb ### L H 0 0 answers/subdir1/bc answers/bc ### L H 0 0 answers/subdir1/bd answers/bd ### L H 0 0 answers/subdir1/c_aa answers/c_aa ### L H 0 0 answers/subdir1/c_ab answers/c_ab ### L H 0 0 answers/subdir1/c_ac answers/c_ac ### L H 0 0 answers/subdir1/c_ad answers/c_ad ### L H 0 0 answers/subdir1/c_ba answers/c_ba ### L H 0 0 answers/subdir1/c_bb answers/c_bb ### L H 0 0 answers/subdir1/c_bc answers/c_bc ### L H 0 0 answers/subdir1/c_bd answers/c_bd ### D 755 1103936123 1103936147 answers/subdir2/ ### 2 644 1103936087 1103936090 answers/subdir2/aa aa test2 an improper modification ### 1 444 1103936087 1103936087 answers/subdir2/ab ab test2 ### 1 444 1103936087 1103936087 answers/subdir2/ac ac test2 ### 1 444 1103936087 1103936087 answers/subdir2/ad ad test2 ### 2 444 1103936087 1103936087 answers/subdir2/ba aa test2 ba ### 2 444 1103936087 1103936087 answers/subdir2/bb ab test2 bb ### 2 444 1103936087 1103936087 answers/subdir2/bc ac test2 bc ### 2 444 1103936087 1103936087 answers/subdir2/bd ad test2 bd ### 3 644 1103936087 1103936090 answers/subdir2/c_aa This file is derived from aa. aa test2 an improper modification ### 2 444 1103936087 1103936087 answers/subdir2/c_ab This file is derived from ab. ab test2 ### 2 444 1103936087 1103936087 answers/subdir2/c_ac This file is derived from ac. ac test2 ### 2 444 1103936087 1103936087 answers/subdir2/c_ad This file is derived from ad. ad test2 ### 3 444 1103936087 1103936087 answers/subdir2/c_ba This file is derived from ba. aa test2 ba ### 3 444 1103936087 1103936087 answers/subdir2/c_bb This file is derived from bb. ab test2 bb ### 3 444 1103936087 1103936087 answers/subdir2/c_bc This file is derived from bc. ac test2 bc ### 3 444 1103936087 1103936087 answers/subdir2/c_bd This file is derived from bd. ad test2 bd ### D 755 1103936123 1103936150 answers/subdir3/ ### 1 444 1103936091 1103936091 answers/subdir3/aa aa ### 1 644 1103936091 1103936091 answers/subdir3/aa_build_record aa makepp-2.0.98.3/t/additional_tests/0000755000175000017500000000000012115460733017165 5ustar pfeifferpfeiffermakepp-2.0.98.3/t/additional_tests/xml.test0000644000175000017500000000251612003073623020664 0ustar pfeifferpfeiffer### SPAR ### 4 755 1321222152 1325022022 is_relevant.pl my $warn; # AS 5.14.0 has dirty XML::Parser. Skip as warn means fail. local $SIG{__WARN__} = sub { $warn = 1 }; (eval 'use XML::Parser; XML::Parser->new( Style => "Tree" )->parsefile( "a.xml" )' or eval 'use XML::LibXML; XML::LibXML->load_xml( location => "a.xml" )') && !$warn ### 12 755 1321222152 1342994322 makepp_test_script.pl # A simple test of xml signatures. makepp; n_files 'n_files_0'; c_printf '-oa.xml', q@%c%c%c%s@, 0xEF, 0xBB, 0xBF, < great tool it provides XML makepp; 1; ### 11 644 1321222152 1321222152 RootMakeppfile override signature xml # Just test that override is accepted .PHONY: all all: a1.xml a2.xml a1.xml: a.xml &cp $< $@ a2.xml: a.xml :signature xml-space &cp $< $@ ### 8 644 1321222152 1321222152 a.xml great tool compiling & linking it provides ### D 755 1321222152 1321222152 answers ### 1 644 1321222152 1321222152 answers/n_files 1 1 0 ### 1 644 1321222152 1321222152 answers/n_files_0 2 1 0 makepp-2.0.98.3/t/additional_tests/spar_unix.test0000644000175000017500000002047411045674123022106 0ustar pfeifferpfeiffer### SPAR ### 15 444 1120166745 1215861917 is_relevant.pl # This tests spar itself, and not any makepp functionality. The test is # integrated here because spar is hosted in the test section of makepp (for # which it was originally conceived.) # 5.6.0 doesn't have preprocess, so spar content order is random die if $] == 5.006; # FreeBSD 4.10 and Darwin 5.5 allow truncating a write protected file :-( die if open my $fh, '>', 'd.spar'; # Can we chmod on this fs? ((stat 'd.spar')[2] & 0777) == 0444 and chmod 0650, 'd.spar' and # chmod fails with success on Samba. ((stat 'd.spar')[2] & 0777) == 0650; ### 28 755 1079987495 1079987351 makepp_test_script #!/bin/sh -x unset LANG LC_MESSAGES LC_ALL PATH=..:../..:$PATH; export PATH spar="${PERL-perl} -S spar" $spar -e >spar-mode.el $spar -p >un_spar.pl $spar -x answers/dir.pl $spar -c dir.pl dir rm -fr dir ${PERL-perl} answers/dir.pl $spar dir.spar dir ${PERL-perl} answers/dir.pl $spar -a dir-a.spar dir ${PERL-perl} answers/dir.pl $spar -d dir-d.spar dir $spar -x d.spar $spar -a dir-a.spar dir/d rm -fr dir/a chmod a-w dir/b dir echo junk line >>dir.spar $spar -x dir.spar 2>errors chmod u+w dir/b dir ### 4 444 1079987495 1079872464 d.spar ### SPAR ### D 755 1079872401 1079870636 dir/d/ ### 1 644 1079872401 1079872401 dir/d/d ddd ### D 755 1164319650 1079870636 .makepp/ ### 3 644 1164319650 1190056091 .makepp/log This is a dummy file present so as to satisfy makepp's test harness. N_FILES000 ### D 755 1079988067 1079987490 answers/ ### 56 755 1120163193 1217802666 answers/dir.pl #! /usr/bin/env perl # This file was generated by spar # Run it with perl to unpack it. my( $lines, $kind, $mode, %mode, $atime, $mtime, $name, $nl ) = (-1, 0); while( ) { s/\r?\n$//; # cross-plattform chomp if( $lines >= 0 ) { print F $_, $lines ? "\n" : $nl; } elsif( $kind eq 'L' ) { if( $mode eq 'S' ) { symlink $_, $name; } else { link $_, $name; } $kind = 0; } elsif( /^###\t(?!SPAR)/ ) { (undef, $kind, $mode, $atime, $mtime, $name) = split /\t/, $_, 6; if( !$name ) { } elsif( $kind eq 'D' ) { $name =~ s!/+$!!; -d $name or mkdir $name, 0700 or warn "spar: can't mkdir `$name': $!\n"; $mode{$name} = [$atime, $mtime, oct $mode]; } elsif( $kind ne 'L' ) { open F, ">$name" or warn "spar: can't open >`$name': $!\n"; $lines = abs $kind; $nl = ($kind < 0) ? '' : "\n"; } } elsif( defined $mode ) { warn "spar: $archive:$.: trailing garbage ignored\n"; } # else before beginning of spar } continue { if( !$lines-- ) { close F; chmod oct( $mode ), $name and utime $atime, $mtime, $name or warn "spar: $archive:$name: Failed to set file attributes: $!\n"; } } for( keys %mode ) { chmod pop @{$mode{$_}}, $_ and utime @{$mode{$_}}, $_ or warn "spar: $archive:$_: Failed to set directory attributes: $!\n"; } __DATA__ ### D 755 1079872402 1079872572 dir/ ### -1 644 1079872401 1079820029 dir/b bbb ### 1 644 1079872401 1079820044 dir/c ccc ### D 755 1079872401 1079869652 dir/a/ ### 1 644 1079872401 1079820004 dir/a/a aaa ### 45 644 1120163329 1217802687 answers/un_spar.pl # spar extraction function # assumes DATA to be opened to the spar sub un_spar() { my( $lines, $kind, $mode, %mode, $atime, $mtime, $name, $nl ) = (-1, 0); while( ) { s/\r?\n$//; # cross-plattform chomp if( $lines >= 0 ) { print F $_, $lines ? "\n" : $nl; } elsif( $kind eq 'L' ) { if( $mode eq 'S' ) { symlink $_, $name; } else { link $_, $name; } $kind = 0; } elsif( /^###\t(?!SPAR)/ ) { (undef, $kind, $mode, $atime, $mtime, $name) = split /\t/, $_, 6; if( !$name ) { } elsif( $kind eq 'D' ) { $name =~ s!/+$!!; -d $name or mkdir $name, 0700 or warn "spar: can't mkdir `$name': $!\n"; $mode{$name} = [$atime, $mtime, oct $mode]; } elsif( $kind ne 'L' ) { open F, ">$name" or warn "spar: can't open >`$name': $!\n"; $lines = abs $kind; $nl = ($kind < 0) ? '' : "\n"; } } elsif( defined $mode ) { warn "spar: $archive:$.: trailing garbage ignored\n"; } # else before beginning of spar } continue { if( !$lines-- ) { close F; chmod oct( $mode ), $name and utime $atime, $mtime, $name or warn "spar: $archive:$name: Failed to set file attributes: $!\n"; } } for( keys %mode ) { chmod pop @{$mode{$_}}, $_ and utime @{$mode{$_}}, $_ or warn "spar: $archive:$_: Failed to set directory attributes: $!\n"; } } ### 12 644 1079987495 1079872624 answers/dir-a.spar ### SPAR ### D 755 1079872402 1079872572 dir/ ### -1 644 1079872401 1079820029 dir/b bbb ### 1 644 1079872401 1079820044 dir/c ccc ### D 755 1079872401 1079869652 dir/a/ ### 1 644 1079872401 1079820004 dir/a/a aaa ### D 755 1079872401 1079870636 dir/d/ ### 1 644 1079872401 1079872401 dir/d/d ddd ### 9 644 1079987495 1079872623 answers/dir-d.spar ### SPAR ### D 755 1079872402 1079872572 dir/ ### -1 644 1079872401 1079820029 dir/b bbb ### 1 644 1079872401 1079820044 dir/c ccc ### D 755 1079872401 1079869652 dir/a/ ### 1 644 1079872401 1079820004 dir/a/a aaa ### 10 644 1079987495 1079872624 answers/dir.spar ### SPAR ### D 755 1079872402 1079872572 dir/ ### -1 644 1079872401 1079820029 dir/b bbb ### 1 644 1079872401 1079820044 dir/c ccc ### D 755 1079872401 1079869652 dir/a/ ### 1 644 1079872401 1079820004 dir/a/a aaa junk line ### 6 644 1079987495 1216459969 answers/errors spar: can't open >`dir/b': Permission denied spar: can't mkdir `dir/a': Permission denied spar: can't open >`dir/a/a': No such file or directory spar: dir.spar:dir/a/a: Failed to set file attributes: No such file or directory spar: dir.spar:10: trailing garbage ignored spar: dir.spar:dir/a: Failed to set directory attributes: No such file or directory ### 71 644 1120163292 1167363038 answers/spar-mode.el (setq auto-mode-alist `(("\\.spar$\\|/makepp.+\\.test$" . spar-mode) ,@auto-mode-alist)) (defun spar-show () "Show this subfile in an indirect buffer with right mode. It is in fact the same buffer as the SPAR, so be careful not to change the number of lines, or the SPAR will become inconsistent." (interactive) (let ((obuf (current-buffer)) (fl font-lock-mode) a z buf) (save-excursion (outline-back-to-heading) (beginning-of-line 2) (setq buf (match-string-no-properties 1) a (point)) (outline-next-heading) (setq z (point))) (switch-to-buffer (make-indirect-buffer (current-buffer) buf t)) (narrow-to-region a z) (let ((buffer-file-name buf)) (set-auto-mode)) (and fl (not font-lock-mode) (set-buffer obuf) (font-lock-mode fl)))) (defun spar-fix () "Fix the number of lines declared in the heading of this subfile. If this subfile is within a nested SPAR, the outer heading will not be fixed." (interactive) (save-match-data (outline-back-to-heading) (if (looking-at "### -?\\([0-9]+\\) [0-9]+ [0-9]+ \\([0-9]+\\)") (let ((a (point)) n) (save-match-data (outline-next-heading)) (setq n (prin1-to-string (1- (count-lines a (point))))) (replace-match (format "%.0f" (float-time)) nil nil nil 2) (unless (string= n (match-string-no-properties 1)) (replace-match n nil nil nil 1))) (error "Not on a normal file")))) (defun spar-level () (let ((z (1- (match-end 1))) (n 1)) (save-excursion (goto-char (match-beginning 1)) (while (search-forward "/" z t) (setq n (1+ n)))) n)) (define-derived-mode spar-mode outline-mode "Spar" "Major mode for editing Simple Perl ARchives. Command \\[spar-show] allows editing one subfile section. Command \\[spar-fix] fixes the lenth of one subfile section. Note that SPARs can contain other SPARs. But this mode does not recognize that. Outline levels are the same for nested SPARs as for outer ones, so you cannot normally hide a subtree containing a nested SPAR." (set (make-local-variable 'outline-regexp) "^### .+ \\(.+\\)") (set (make-local-variable 'outline-level) 'spar-level) (setq imenu-generic-expression '(("links" "^### [LS] .+ \\(.+\\)" 1) ("directories" "^### D .+ \\(.+\\)" 1) (nil "^### .+ \\(.+\\)" 1)))) (define-key spar-mode-map "\C-cs" 'spar-show) (define-key spar-mode-map "\C-cf" 'spar-fix) makepp-2.0.98.3/t/additional_tests/double_colon.test0000644000175000017500000000106610674045033022535 0ustar pfeifferpfeiffer### SPAR ### 24 644 1164354575 1060925871 Makeppfile # # A test of our hack to support the dastardly double colon syntax (often # used by makefiles from MakeMaker). # $(phony all):: a a:: c &cat c -o $@ b :: d &cat d -o $@ a :: d &cat d -o>>$@ # Can't use $< here--would be c, not d!!! b :: c &cat c -o>>$@ c d : &echo $@ -o $@ all:: b ### D 755 1067451882 1060925891 answers ### 2 644 1067451882 1060925879 answers/a c d ### 2 644 1067451882 1060925879 answers/b d c ### 1 644 1067451882 1190056049 answers/n_files 4 1 0 makepp-2.0.98.3/t/additional_tests/2009_12_27_skip_word_unix.test0000644000175000017500000000155311715735765024441 0ustar pfeifferpfeiffer### SPAR ### 1 644 1329052295 1329052295 is_relevant.pl have_cc ### 29 644 1289337252 1289337252 Makeppfile # The 1st rule used complain that it did not find a parser in the recursive # parse, as did the 2nd in the outer parse, which additionally didn't recognize # the compiler. This is history because the new special parsers don't recurse. $(phony all): $( a/a b c d).o a/a.o: if [ ! -d a ]; then mkdir a; fi $(CC) -E a.c > $(output) b.o: : parser shell trap '$(CC) -E c.c > $(output)' 0 register-parser echo skip-word c.o: echo libtool $(CC) -E b.c > $(output) d.o: : parser none echo libtool $(CC) -E d.c > $(output) %.c: :last_chance &echo '#include "$(stem).h"' -o $(output) %.h: :last_chance &echo 'int f();' -o $(output) ### D 755 1261610241 1261610241 answers ### 1 644 1289337201 1289337201 answers/n_files 10 1 0 makepp-2.0.98.3/t/additional_tests/2009_01_08_symlink.test0000644000175000017500000000351712003073105023030 0ustar pfeifferpfeiffer### SPAR ### 29 644 1161580578 1231322001 makepp_test_script.pl # Test all variants of existing and created symlinks, to existing and created files. makepp; my %warnings; n_files 'n_files1', sub { undef $warnings{$1} if /warning:.*?(is a symbolic link|I attempted to build|\w+ is probably also phony|There is no rule to build inexistent.+)/; }; die if 5 != keys %warnings; unlink qw(a bl f g h); # Force rebuild of linkee or make link stale. wait_timestamp qw(c e); for my $file (qw(c e)) { # Edit linkees. open my $fh, '>', $file or die "$file--$!"; close $fh; } eval { makepp qw(D=dd -k) }; # [a-e]l2 and dl must not be rebuilt! %warnings = (); n_files 'n_files2', sub { undef $warnings{$1} if /warning:(.*)/; }; die unless 1 == keys %warnings; makepp qw(--rm-stale D=dd); die if grep -f, qw(fl fl2 fc gl gl2 gc hl hl2 hc); 1; ### 32 644 1230569382 1304538479 Makeppfile default: default1 # Provoke inexistent warnings. default1: default2 default2: default3 # Provoke no-phony warnings. @&expr 1 default3: ?c @&expr 1 $(foreach) $(foreach)l: :foreach a b # Both created in one rule. &echo $(output) -o $(output) &ln -fs $(outputs) %l: % &ln -fs $(input) $(output) %l2: %l &ln -fs $(input) $(output) %c: %l2 :signature md5 &cp $(input) $(output) cl: &echo $(output) -o $(output) # Should warn about link to c. D=d d: &echo $D -o $(output) %l: % &ln -fs $(input) $(output) ### 0 644 1230569045 1230571314 c ### L S 0 0 cl c ### 1 644 1230569045 1230569045 e e ### 1 644 1230569045 1230569045 f f ### 1 644 1230569045 1230569045 g g ### L S 0 0 gl g ### 1 644 1230569045 1230569045 h h ### D 755 1230569356 1230569356 answers ### 1 644 1230569356 1230569356 answers/n_files1 27 4 0 ### 1 644 1230569356 1230569356 answers/n_files2 9 0 3 ### 1 644 1230569356 1230569356 answers/n_files 0 4 0 makepp-2.0.98.3/t/additional_tests/2008_05_21_install.test0000644000175000017500000000325212073103766023020 0ustar pfeifferpfeiffer### SPAR ### 3 755 1067451881 1211218113 is_relevant.pl # When testing an already installed version, this test doesn't make sence. substr +($Mpp::makepp_dir = $makepp_path), -7, 7, ''; -f "$Mpp::makepp_dir/install.pl"; ### 29 644 1164353916 1357678563 makepp_test_script.pl my $cwd = cwd; my $havepod = -d "$Mpp::makepp_dir/pod/"; # complete distro? my $haveman = $havepod && eval 'use Pod::Man; 1'; # broken on StrawberryPerl V5.8.9 my $haveutf8 = $] > 5.008 && $havepod; # no print wide char warning chdir $Mpp::makepp_dir; # install.pl and config.pl are to be run here my $cmd = "$Mpp::makepp_dir/install.pl"; system_intabort \$cmd, PERL, $cmd, "$cwd/instbin", "$cwd/instshare", $haveman ? "$cwd/instman" : 'none', $haveutf8 ? "$cwd/insthtml" : 'none', 'none'; die if $haveman && ! <$cwd/instman/man1/makepp.?{,.gz}>; # ? makes this a wildcard die if $haveutf8 && ! -f "$cwd/insthtml/index.html"; $cmd = "$Mpp::makepp_dir/config.pl"; system_intabort \$cmd, PERL, $cmd, "--makefile=$cwd/config.mk", '-p', $cwd, $haveman ? "-m$cwd/confman" : '-mnone', $haveutf8 ? "-h$cwd/confhtml" : '-hnone'; makepp "-f$cwd/config.mk", '--dont-build=all', 'install'; die if $haveman && ! <$cwd/confman/man1/makepp.?{,.gz}>; die if $haveutf8 && ! -f "$cwd/confhtml/index.html"; chdir $cwd; $cmd = is_windows < 1 ? 'bin/mpp' : 'bin\mpp'; system_intabort \$cmd, $cmd, '--version'; # Can it start, loading some of our modules? substr $cmd, 0, 0, 'inst'; system_intabort \$cmd, $cmd, '--version'; 1; ### D 755 1164319650 1079870636 .makepp/ ### 3 644 1164319650 1190056091 .makepp/log This is a dummy log present so as to satisfy makepp's test harness. N_FILES000 makepp-2.0.98.3/t/additional_tests/2007_08_20_phony_include.test0000644000175000017500000000076710662424312024216 0ustar pfeifferpfeiffer### SPAR ### 7 644 1103567918 1103567911 Makeppfile # Make sure that we don't consider dir/incfile.makepp as a possible source, # even though we don't learn that it's phony until after we find out that there # is a rule to build it. (Was broken as of 2007-08-19.) include dir/incfile $(phony default): @&echo "nothing to build" ### D 755 1103567918 1103567911 dir ### 5 644 1103567918 1103567911 dir/Makeppfile $(phony incfile.makepp): @&echo -n incfile: &touch $@ makepp-2.0.98.3/t/additional_tests/2007_08_15_no_extra_fork_unix.test0000644000175000017500000000137011016104513025244 0ustar pfeifferpfeiffer### SPAR ### 17 644 1103567918 1211618426 Makeppfile # Test to verify (on UNIX) that we don't have an unnecessary fork on the # last action, which could waste an enormous amount of memory. # Set SLEEP if you want to debug the process tree using pstree. ifdef SLEEP export SLEEP endif # The process of the last action should be the 'sh' running the 'checker' # script (because there are no shell metacharacters in the action), which # should be the same PID as the makepp process that is running the rule, # because it should have been exec'ed therefrom. EMPTY = $(phony pidcheck): perl { $ENV{PID} = $$ } ./checker $(EMPTY) ### 3 755 1103567918 1187882940 checker #! /bin/sh [ "$SLEEP" ] && sleep 60 [ $PID = $$ ] || exit 1 makepp-2.0.98.3/t/additional_tests/2007_05_15_autoload.test0000644000175000017500000000215511144402767023166 0ustar pfeifferpfeiffer### SPAR ### 1 644 1103317920 1208344763 is_relevant.pl is_windows < 2 ### 2 755 1164209909 1209463398 makepp_test_script.pl substr $ENV{PATH}, 0, 0, '.:'; makepp; ### 35 644 1103567918 1210352253 Makeppfile X := x $(phony test): a.$(X) b.$(X) &echo OK a b: &echo $@ -o $@ # Now make sure we don't build built-ins: ifperl Mpp::is_windows < 1 -source /dev/null endif case 1 in 1) echo "OK";; esac for x in 1; do break; done while :; do break; done until :; do break; done cd . ; export FOO echo eval echo if [ "" ] ; then echo ; fi # Now make sure we don't autoload for executables: grep $@ $@ autoload more_rules.makeppfile autoload die.makeppfile die.makeppfile: perl { use Carp; confess } # Make sure that we don't try to build these due to executable dependency: source case break esac cd export echo eval if fi for do done while until: false more_rules.makeppfile: d/foo &perl 'chomp; print "$$_.\$$(X):\n\t\&touch \$$\@\n\n"' $< -o $(output) ### D 755 1164209909 1103567781 d ### 2 755 1164209909 1103567781 d/Makeppfile foo: ../a ../b &cat $(inputs) -o $(output) makepp-2.0.98.3/t/additional_tests/2007_05_09_dont_build.test0000644000175000017500000000062612003072465023476 0ustar pfeifferpfeiffer### SPAR ### 6 644 1103567918 1103567911 Makeppfile $(phony test): &echo OK prebuild d/foo load_makefile d ### D 755 1164209909 1103567781 d ### 2 755 1164209909 1103567781 d/Makeppfile foo: &touch $@ ### 5 755 1164209909 1103567781 makepp_test_script.pl makepp qw(d/foo); makepp qw(--dont-build d); open my $fh, '<.makepp/log' or die; /warning/ and die $_ for <$fh>; 1; makepp-2.0.98.3/t/additional_tests/2007_02_02_md5_bchk_phony_dep.test0000644000175000017500000000102410674045033025056 0ustar pfeifferpfeiffer### SPAR ### 5 755 1164209909 1103567781 makepp_test_script.pl makepp; # It apears that signature statement is causing makepp to think that all targets # including phony targets should be checked before rebuilding. # this generates warning about uninitialized variables makepp; ### 7 644 1103567918 1103567911 Makeppfile signature md5 default : x &touch $@ $(phony x): @&echo "nothing to build" ### D 755 1079988067 1079987490 answers/ ### 1 644 1079987495 1190056018 answers/n_files 0 1 0 makepp-2.0.98.3/t/additional_tests/2007_01_31_build_check_ignore_action.test0000644000175000017500000000201112000311115026445 0ustar pfeifferpfeiffer### SPAR ### 11 755 1152637069 1208536507 makepp_test_script.pl local $ENV{SUF} = is_windows > 1 ? 'bat' : 'sh'; # Build once makepp qw{ SCRIPT=test }; # Build with different command line, should not execute command makepp qw{ SCRIPT=test1 }; c_cp "x", "y"; # Now change the dependencies, and check that the build info is saved with # virtual sandboxes (this was broken once). makepp qw{ --virtual-sandbox Y=Makeppfile SCRIPT=test1 }; # Build with different command line, should not execute command makepp qw{ Y=Makeppfile SCRIPT=test }; ### 2 664 1152637082 1208536569 Makeppfile x : $(Y) : build_check ignore_action .$/$(SCRIPT).$(SUF) > $@ ### 1 755 1132010446 1208536620 test.bat @echo OK ### 2 755 1132010446 1125361510 test.sh #!/bin/sh echo OK ### 1 755 1132010446 1208536617 test1.bat @echo NOK ### 2 755 1132010446 1125361510 test1.sh #!/bin/sh echo NOK ### D 777 1079144793 1079144618 answers ### 1 777 1079144618 1079144618 answers/x NOK ### 1 777 1079144618 1079144618 answers/y OK makepp-2.0.98.3/t/additional_tests/2006_12_07_scan_order.test0000755000175000017500000000315212003072007023455 0ustar pfeifferpfeiffer### SPAR ### 1 644 1329052295 1329052295 is_relevant.pl have_cc ### 13 644 1169469581 1169504947 makepp_test_script.pl # # This test checks that 2nd level includes are correctly found and that a # symlink is not rebuilt just because the linkee is. # makepp; n_files 'n_files_1'; unlink 'answers/n_files' # This file system emulates symlinks by copying. Thus if !-l 'include/a.h'; # makepp will recreate the "links", so count is wrong. c_echo 'int i;', '-oa/a1.h'; unlink 'a/a2.h'; makepp; ### 24 644 1165597567 1186006155 RootMakeppfile makepp_percent_subdirs = 1 $(phony all): a/a.i c.i ifeq $(filter %cl %cl.exe %bcc32 %bcc32.exe, $(CC)) LN = &ln -fr else LN = &cp # These don't understand Cygwin symlinks endif include/%.h: a/%.h $(LN) $(input) include include/%.h: b/%.h $(LN) $(input) include d.h a/a2.h: &touch $@ %.i: %.c $(CC) -E -I$(ROOT)/include $(input) >$(output) c.i: c.c :smartscan $(CC) -E -I$(ROOT)/include $(input) >$(output) ### D 755 1165597598 1165597598 a/ ### 2 644 1165597567 1165595737 a/a.c #include "b.h" #include "a.h" ### 1 644 1165597567 1165597311 a/a.h #include "a1.h" ### 0 644 1165597567 1165597200 a/a1.h ### D 755 1165597598 1165597517 b/ ### 2 644 1165597567 1169470101 b/b.h #include "a.h" #include "a2.h" ### D 755 1165597598 1165597598 include/ ### 1 644 1165597567 1165597311 c.h #define X ### 6 644 1165597567 1165597311 c.c #include "c.h" #undef X #include "c.h" #ifdef X #include "d.h" #endif ### D 755 1169470547 1169470547 answers/ ### 1 644 1169470547 1190056014 answers/n_files_1 8 1 0 ### 1 644 1169470587 1190056004 answers/n_files 2 1 0 makepp-2.0.98.3/t/additional_tests/2006_09_20_build_cache_none.test0000644000175000017500000000346011144124454024610 0ustar pfeifferpfeiffer### SPAR ### 5 755 1067749983 1174084135 is_relevant.pl # # Test if unpacking managed to set the timestamp required by SIGNATURE. # !no_symlink && (stat 'build_cache/small')[9] == 1103934737 ### 13 664 1124224809 1233523265 Makeppfile # This used to cause an error, so we should test that it works: build_cache none perl { use Mpp::BuildCacheControl; } # Cache entries have no \n, to avoid DOS headaches. # The --size option used to be messed up, so check for that: $(phony default): &create -e build_cache group_cache # Extend to group. &clean -v --build-info-check --size +10 build_cache # Replicates retained file. perl { chdir 'build_cache'; -e and die for qw(big corrupt none wrong) } ### D 755 1148062992 1103934737 build_cache ### 1 644 1148062992 1180026366 build_cache/build_cache_options.pl { SUBDIR_CHARS => [] } ### D 755 1148062992 1103934737 build_cache/.makepp ### -1 644 1148062992 1103934737 build_cache/big This file is too big to survive a cleaning. ### -2 644 1148062992 1173968421 build_cache/.makepp/big.mk SIGNATURE=1103934737,43 END= ### 0 644 1148062992 1103934737 build_cache/corrupt ### 1 644 1148062992 1173968421 build_cache/.makepp/corrupt.mk SIGNATURE=1103934737,0 ### -1 644 1148062992 1103934737 build_cache/none no info ### -1 644 1148062992 1103934737 build_cache/small OK ### -2 644 1148062992 1173968388 build_cache/.makepp/small.mk SIGNATURE=1103934737,2 END= ### 0 644 1148062992 1103934737 build_cache/wrong ### -2 644 1148062992 1173968388 build_cache/.makepp/wrong.mk SIGNATURE=wrong END= ### D 755 1180344749 1180344749 answers ### D 755 1180344749 1180344749 answers/build_cache ### -1 644 1180344749 1180344749 answers/build_cache/small OK ### D 755 1180344749 1180344749 answers/group_cache ### -1 644 1180344749 1180344749 answers/group_cache/small OK makepp-2.0.98.3/t/additional_tests/2006_09_14_preexec_rule.test0000644000175000017500000000060511144402767024040 0ustar pfeifferpfeiffer### SPAR ### 11 644 1143581184 1122590436 Makeppfile perl_begin $Mpp::preexecute_rule_hook = sub { -e 'y' and die; open(OUT, '>', 'y') or die; print OUT "OK\n"; close(OUT); }; perl_end x: &echo $(output) -o $(output) ### D 755 1122590527 1122590522 answers ### 1 644 1122590442 1122590513 answers/x x ### 1 644 1122590442 1122590513 answers/y OK makepp-2.0.98.3/t/additional_tests/2006_02_18_makeppbuiltin.test0000644000175000017500000001317711754004066024224 0ustar pfeifferpfeiffer### SPAR ### 34 755 1154536064 1224957725 makepp_test_script.pl # # This if a multiple hack. First we steal the contents of another test, because # we want to test the same things, only invoked from the command line. Then we # call makepp to tell us what it would have done, so we can inherit any future # changes as well. Then we call makeppbuiltin once, and perform everything # internally, so that we don't have to fork exec perl many times. This is not # how makeppbuiltin usually works, but builtins within a rule do. # # Slurp this test into our directory. open DATA, "$Mpp::source_path/builtins.test" or die "can't find builtins.test near here--$!\n"; eval { un_spar() }; # makepp --dry-run barfs at rules treating plain file as dir. rename dir2 => 'tempdir2'; mkdir 'dir2'; # Ask politely what we need to do. { open my $fh, '>&STDOUT'; open STDOUT, '>commands'; makepp '--dry-run'; open STDOUT, '>&', $fh; close $fh; } # Restore the way it was in builtins.test. rmdir 'dir2'; rename 'tempdir2' => dir2; # We don't start a real command, just use this to get our code loaded # within the context of makeppbuiltin. makepp \'builtin', '-Mworker', 'clonetest'; ### 43 644 1153861432 1140276843 worker.pm use mymodule; # Normally from the command line the commands can inherit nothing from the # context of their makefile (since there is none). But here we rerun tests # that do have such a context, so get it from the makefile. open my $mf, 'RootMakeppfile' or die $!; while( <$mf> ) { print, eval if /^sub / or s/^perl /eval / or s/^(\w+) *= *(.*)/our \$$1 = '$2'/; } # pseudocommand which in fact runs all the others sub c_clonetest { open my $fh, 'commands'; while( <$fh> ) { next if !/^&/; warn $_; chop; my $comment = Mpp::Text::index_ignoring_quotes( $_, '#' ); $_ = substr $_, 0, $comment if $comment > -1; $0 = 'makeppbuiltin'; @ARGV = Mpp::Text::unquote_split_on_whitespace( $_ ); substr( $ARGV[0], 0, 1 ) = ''; # Remove & eval { Mpp::doit }; warn $@ if $@; } # We don't know how many files we created, but just to satisfy the test harness: Mpp::Cmds::c_sed 's/(\d+) (\d+) (\d+)/N_FILES\01$1\01$2\01$3\01/', 'answers/n_files', '-o', '.makepp/log'; # Now do as makeppbuiltin does with --help. @ARGV = '--help'; open STDERR, '>help'; for $0 ( sort grep { /^c_/ and defined &{"Mpp::Cmds::$_"} } keys %Mpp::Cmds:: ) { eval { Mpp::doit }; warn "\n"; } close STDERR; unlink 'answers/help' if 'a' lt 'A'; # Ebcdic does it the other way round, failing on -i/-I } 1; ### D 755 1140344139 1140344139 answers ### 174 644 1153678523 1229044125 answers/help cat options: -f, --force -i, --inpipe=arg -I, --infail -o, --output=arg -O, --outfail -S, --sync-lines -v, --verbose chmod options: -v, --verbose cp options: -f, --force -l, --link -s, --symbolic-link -v, --verbose cut options: -c, --characters=arg -d, --delimiter=arg -E, --no-escape -f, --fields=arg --force -i, --inpipe=arg -I, --infail -l, --lines=arg -m, --matching -o, --output=arg -O, --outfail -p, --printf=arg -r, --record-size=arg -s, --only-delimited --separator=arg -S, --sync-lines -v, --verbose echo options: -E, --no-escape -f, --force -n, --no-newline -o, --output=arg -O, --outfail -v, --verbose expr options: -f, --force -n, --no-newline -o, --output=arg -O, --outfail -v, --verbose grep options: -c, --count -f, --force -i, --inpipe=arg -I, --infail -l, --list, --files-with-matches -o, --output=arg -O, --outfail -r, --record-size=arg -s, --separator=arg -S, --sync-lines -v, --vice-versa, --revert-match --verbose -w, --waste-file=arg install options: -c, --copy -d, --directory -g, --group=arg -l, --link --logfile=arg -m, --mode=arg -o, --owner=arg -r, --resolve-symbolic-link -s, --strip -S, --symbolic-link -v, --verbose ln options: -f, --force -r, --resolve-symbolic-link -s, --symbolic-link -v, --verbose mkdir options: -f, --force -m, --mode=arg -p, --parent -v, --verbose mv options: -f, --force -v, --verbose perl options: -f, --force -i, --inpipe=arg -I, --infail -o, --output=arg -O, --outfail -r, --record-size=arg -s, --separator=arg -S, --sync-lines -v, --verbose preprocess options: -a, --assignment -f, --force -h, --hashref=arg -o, --output=arg -O, --outfail -S, --sync-lines -v, --verbose printf options: -E, --no-escape -f, --force -o, --output=arg -O, --outfail -v, --verbose rm options: -f, --force -m, --metainfo -v, --verbose sed options: -f, --force -i, --inpipe=arg -I, --infail -o, --output=arg -O, --outfail -r, --record-size=arg -s, --separator=arg -S, --sync-lines -v, --verbose sort options: -c, --compare=arg -d, --detransform=arg -f, --force -i, --inpipe=arg -I, --infail -n, --numeric-sort -o, --output=arg -O, --outfail -r, --reverse --record-size=arg -s, --separator=arg -t, --transform=arg -u, --unique -v, --verbose template options: -d, --defined -f, --force -h, --hashref=arg -i, --inpipe=arg -I, --infail -m, --multiline=arg -o, --output=arg -O, --outfail -s, --simple=arg -S, --sync-lines -v, --verbose touch options: -v, --verbose uninstall options: -i, --inpipe=arg -I, --infail -v, --verbose uniq options: -c, --compare=arg -f, --force -i, --inpipe=arg -I, --infail -o, --output=arg -O, --outfail -r, --record-size=arg -s, --separator=arg -S, --sync-lines -v, --verbose yes options: -E, --no-escape -f, --force -n, --no-newline -o, --output=arg -O, --outfail -v, --verbose makepp-2.0.98.3/t/additional_tests/2005_08_31_build_cache_pop_options.test0000644000175000017500000000336611144402767026235 0ustar pfeifferpfeiffer### SPAR ### 61 664 1164313904 1125528381 makepp_test_script.pl # Create the build cache: makepp \'builtin', qw{-MMpp::BuildCacheControl create ./build_cache}; sub clean { # Utility to save calling makepp unlink qw(my_true sort sort.o), ; rmdir '.makepp'; } #----- Test 1 # Now build targets, but don't populate BC makepp qw{--build-cache build_cache --nopopulate-bc}; clean; # This should run the rule again makepp qw{--build-cache build_cache --nopopulate-bc}; -f 'sort_build_record' || die 1; -f 'sort.o_build_record' || die 2; #----- Test 2 clean; # Now build targets normally makepp qw{--build-cache build_cache}; clean; # This should copy from BC makepp qw{--build-cache build_cache --nopopulate-bc --force-copy-from-bc}; -f 'sort_build_record' && die 3; -f 'sort.o_build_record' && die 4; #----- Test 3 clean; # This should run the rule yet again makepp qw{--build-cache build_cache --populate-bc-only}; -f 'sort_build_record' || die 5; -f 'sort.o_build_record' || die 6; #----- Test 4 clean; # Clean the BC makepp \'builtin', qw{-MMpp::BuildCacheControl clean --mtime +-1 ./build_cache}; # This should run the rule yet again makepp qw{--build-cache build_cache --populate-bc-only}; clean; # This should copy from BC makepp qw{--build-cache build_cache}; -f 'sort_build_record' && die 7; -f 'sort.o_build_record' && die 8; 1 ### 21 664 1164313913 1209736023 Makeppfile $(phony all): sort run sort: sort.o &touch $@ &echo $@ -o $@_build_record sort.o: &touch $@ &echo $@ -o $@_build_record $(phony run): my_true .$/$< my_true: ifperl Mpp::is_windows < 2 &echo -o $@ "#!/bin/sh" &chmod 755 $@ else &touch $@ &echo -o $@.bat "@echo" # Not a clean dep-chain... endif makepp-2.0.98.3/t/additional_tests/2005_08_29_build_cache_md5copy.test0000644000175000017500000000200611144124454025233 0ustar pfeifferpfeiffer### SPAR ### D 775 1132010765 1132010763 answers/ ### 6 664 1132010446 1132010446 answers/newsort #include int A[] = { 99, 43, 22, 17, 57, 32, 43, 19, 26, 48, 87, 12, 75, 0 }; const int numEntries = sizeof(A)/sizeof(int); #include int 345[] = { 99, 43, 22, 17, 57, 32, 43, 19, 26, 48, 87, 12, 75, 0 }; const int numEntries = sizeof(345)/sizeof(int); ### 3 664 1152637082 1132010425 Makeppfile newsort: sort.c &cat sort.c -o $@ &sed 's/A/345/' sort.c -o >>$@ ### 13 755 1152637069 1125360871 makepp_test_script.pl # # Test a build cache that md5s while copying # # Create the build cache: makepp \'builtin', qw{-MMpp::BuildCacheControl create ./build_cache}; # Now build targets makepp qw{--build-cache build_cache --md5check-bc}; unlink 'newsort'; makepp qw{--build-cache build_cache --md5check-bc}; ### 3 644 1132010446 1125361510 sort.c #include int A[] = { 99, 43, 22, 17, 57, 32, 43, 19, 26, 48, 87, 12, 75, 0 }; const int numEntries = sizeof(A)/sizeof(int); makepp-2.0.98.3/t/additional_tests/2005_08_16_build_cache_clean.test0000644000175000017500000000153311144124454024735 0ustar pfeifferpfeiffer### SPAR ### 14 664 1124224809 1124226006 Makeppfile ANIMALS=\ cat\ dog\ cow\ wolf\ pig $(phony default): $(ANIMALS) $(ANIMALS): &echo $@ -o >>$@ $(phony clean): &rm -f $(ANIMALS) ### 15 755 1152636440 1125017144 makepp_test_script.pl # Create the build cache: makepp \'builtin', qw{-MMpp::BuildCacheControl create ./build_cache}; makepp qw{--build-cache build_cache --force_copy_from_bc}; # clean (incoming.dir should be empty already, so use age threshold of 2 hours) # threshold for everything else covers stuff less than 1 day in the future. makepp \'builtin', qw{-MMpp::BuildCacheControl clean --mtime +-1 ./build_cache}; unlink './build_cache/build_cache_options.pl' or die; rmdir './build_cache/incoming.dir' || die; rmdir './build_cache' || die; makepp 'clean'; # TODO: Is this really part of the test? makepp-2.0.98.3/t/additional_tests/2005_08_12_build_cache_exmatch.test0000644000175000017500000000150011144124454025272 0ustar pfeifferpfeiffer### SPAR ### D 775 1123879739 1123871271 answers/ ### D 775 1123882078 1123882011 answers/dir2/ ### 1 664 1123881976 1123884551 answers/dir2/file1 GOOD\n ### D 775 1123882078 1123882001 answers/dir1/ ### 2 664 1123881976 1123884545 answers/dir1/file1 GOOD\n BAD ### D 775 1123884574 1123884574 dir1/ ### D 775 1123884574 1123884574 dir2/ ### 5 664 1152635935 1123884442 Makeppfile dir1/file1 dir2/file1 : &touch $(outputs) &echo 'GOOD\\n' -o >>dir1/file1 &echo 'GOOD\\n' -o >>dir2/file1 &echo 'BAD' -o >>$(output) ### 9 755 1152635933 1123884520 makepp_test_script.pl # Create the build cache: makepp \'builtin', qw{-MMpp::BuildCacheControl create ./build_cache}; # Now build targets makepp qw{--build-cache build_cache}; unlink qw(dir1/file1 dir2/file1); makepp qw{--build-cache build_cache}; makepp-2.0.98.3/t/additional_tests/2005_07_12_build_cache_cp.test0000644000175000017500000000272512002500145024241 0ustar pfeifferpfeiffer### SPAR ### 1 644 1329052295 1329052295 is_relevant.pl have_cc ### 29 755 1164320845 1342865499 makepp_test_script.pl makepp \'builtin', qw(-MMpp::BuildCacheControl create build_cache); # Populate the cache makepp '--build-cache=build_cache', '--force-copy-from-bc', '--stop-on-race'; n_files 'n1'; # Now get a new foo.o with an update timestamp. If it works properly, then # the foo executable will still come from the cache, because it uses an MD5 of # foo.o in its cache key instead of the timestamp. wait_timestamp grep -e, qw(foo.o foo.obj); unlink qw(foo.o foo.obj) or die "Can't unlink foo.o or foo.obj"; makepp '--build-cache=build_cache', '--force-copy-from-bc', '--stop-on-race'; n_files 'n2'; # Make sure that the DEP_SIGS in the 'foo' executable build info was updated, # so that it ooks up-to-date even though the foo.o timestamp is different from # the DEP_SIGS in the build cache. makepp; die unless -d 'build_cache/incoming.dir'; my @garbage = glob 'build_cache/incoming.dir/*'; die "@garbage" if @garbage; if( is_windows ) { for my $n ( qw(1 2 _files) ) { c_sed 's/ 1 / 2 /', "-o+ ### 1 644 1329052295 1329052295 is_relevant.pl have_cc ### 17 644 1159374480 1186006640 Makeppfile ifeq $(filter %cl %cl.exe %bcc32 %bcc32.exe, $(CC)) $(phony default): x.o else $(phony default): x.obj endif ifndef NORULE x.x: ifdef BROKEN perl { die "FAIL" } else &echo "#define X" -o $@ endif # BROKEN endif # NORULE %.h: %.x &cp $< $@ ### 20 755 1164351460 1112308605 makepp_test_script.pl # Make sure that the include directive is cached even if we can't find the # include file. eval { makepp 'NORULE=1' } and die; open my $mk, '.makepp/x.c.mk'; my $inc = 0; while( <$mk> ) { $inc++ if /INCLUDES=.*x.h/; } die if !$inc; # Now just make sure that it builds. makepp; # Finally, make sure that when we update x.x on behalf of cached scanner # info, we get a good diagnostic. eval { makepp 'BROKEN=1' } and die; n_files 0, sub { $fail++ if /because .*x.x failed to build/ }; die if !$fail; 1; ### 4 644 1112308158 1112308295 x.c #include "x.h" #ifndef X # error #endif ### D 755 1112308158 1112308295 answers makepp-2.0.98.3/t/additional_tests/2005_01_17_runtime.test0000644000175000017500000000132412000311115023004 0ustar pfeifferpfeiffer### SPAR ### 1 775 1168790726 1168790726 is_relevant.pl -x 'a'; # Can't set this on VFAT, but may be the default. ### 3 775 1168790818 1168790819 makepp_test_script.pl makepp; c_cp x => 'x-1'; makepp 'C=12'; ### 14 775 1168790874 1168789807 Makeppfile runtime $(patsubst %.m, %.n, a), b runtime b, c C := 1 $(phony default): x x: ./a > x c: &echo "#!/bin/sh" -o $@ &echo "echo $(C)" -o>>$@ -&chmod 755 $@ # Can't set this on VFAT. ### 3 775 1168789807 1168789807 a #!/bin/sh exec ./b "$@" ### 3 775 1168789807 1168789807 b #!/bin/sh exec ./c "$@" ### D 775 1168789807 1168789807 answers/ ### 1 775 1168789807 1168789807 answers/x 12 ### 1 775 1168789807 1168789807 answers/x-1 1 makepp-2.0.98.3/t/additional_tests/2004_12_29_repository_mkdir.test0000644000175000017500000000077111020616053024751 0ustar pfeifferpfeiffer### SPAR ### 2 755 1104359644 1212339178 .makepprc -R test_subdir=. -F test_subdir ### 3 644 1104360682 1104360682 Makeppfile $(phony all): subdir1/testfile subdir1/testfile : &echo $@ -o $@ ### D 755 1104360599 1104360642 subdir1/ ### D 755 1104360699 1104360701 answers/ ### D 755 1104360691 1104360803 answers/test_subdir/ ### D 755 1104360691 1104360803 answers/test_subdir/subdir1/ ### 1 444 1104360691 1104360691 answers/test_subdir/subdir1/testfile subdir1/testfile makepp-2.0.98.3/t/additional_tests/2004_12_20_errors.test0000644000175000017500000000275612002601052022646 0ustar pfeifferpfeiffer### SPAR ### 48 644 1103567918 1103567911 makefile perl_begin warn 0; sub f_foo { warn 1; "foo" } perl_end sub f_bar { warn 2; "bar" } perl { sub f_fubar { warn 3; "fubar" } } X := $(perl sub f_foobar { warn 4; "foobar" }) $(phony default): input_check foo &echo $(foo 2) &echo $(bar) &echo $(fubar 2) &echo $(foobar) &echo a $(warning 5) b perl {{ warn 6; }} include dir/foo.mk input_check: nothing perl {{ my ($input, $output) = (f_input(undef, @Cxt), f_output(undef, @Cxt)); open(OUT, ">$output") or die; print OUT "$input\n"; close(OUT); }} $(phony nothing): ifeq $(warning 8) Y := $(warning 9) endif ### D 755 1103567444 1103567383 answers ### 10 644 1119250783 1103567928 answers/warnings *** warning: 0 at makefile line 2. *** warning: 8 at `makefile:46' *** warning: 9 at `makefile:47' *** warning: 1 at makefile line 4. *** warning: 2 at makefile line 10. *** warning: 3 at makefile line 16. *** warning: 4 at makefile line 21. *** warning: 5 at `makefile:23' *** warning: 7 at foo.mk line 2. *** warning: 6 at makefile line 24. ### 1 644 1103567804 1103567928 answers/input_check nothing ### D 755 1103567444 1103567383 dir ### 4 644 1103567804 1103567928 dir/foo.mk $(phony foo): perl {{ warn 7; }} ### 10 755 1164209909 1342898729 makepp_test_script.pl makepp; sub dewarn { /warning:/ or return 1; tr/\02//d; s!(at `?).*/!$1!; # Remove path, which varies 0; } c_grep '-wwarnings', '&dewarn', '-o+<.makepp/log'; makepp-2.0.98.3/t/additional_tests/2004_12_17_idl.test0000644000175000017500000000234011715735517022125 0ustar pfeifferpfeiffer### SPAR ### 1 644 1329052295 1329052295 is_relevant.pl have_cc ### 13 644 1113847363 1113847363 Makeppfile # This tests that parser c_compilation finds an #include in an IDL file. # And that this happens from a C compiler including the output without # an undefined value being returned from Mpp::Scanner::include. %.h %.c: %.idl : parser c_compilation .$/idlcompiler -Iinclude $(input) include/%.idl: from/%.idl &ln $(input) $(output) test.i: test.c # AIX compiler doesn't like -o here $(CC) -E $(input) >$(output) ### 4 755 1113847363 1113847363 idlcompiler #! /bin/sh # Never mind real IDL compiler functionality. echo a >try.h # AIX compiler would warn about empty file >try.c ### 2 755 1113847363 1208539694 idlcompiler.bat @echo a >try.h @echo >try.c ### 1 644 1113847363 1113847363 test.c #include "try.h" ### 1 644 1105301400 1105300333 try.idl #include "more.idl" ### D 755 1105301531 1105301438 from/ ### 1 644 1105301400 1105300066 from/more.idl /* to be found automatically */ ### D 755 1105301531 1105301524 include/ ### D 755 1105301531 1105301438 answers/ ### D 755 1105301531 1105301438 answers/include/ ### 1 644 1105301400 1105300066 answers/include/more.idl /* to be found automatically */ makepp-2.0.98.3/t/additional_tests/2004_12_14_comma.test0000644000175000017500000000111111561224243022425 0ustar pfeifferpfeiffer### SPAR ### 11 644 1103070911 1304122775 Makeppfile # This verifies that wildcards finally do match filenames containing comma. # They didn't because that used to get interpreted as argument separators. # Test that this is no longer the case. # Cygwin lowercases and thus wildcard sorts differently X := $(makeperl sort map lc, qw'$(wildcard *)') $(phony default): x x: &echo $(join $(X),1 2 3 4) -o $@ ### D 755 1103070976 1103070920 answers ### 1 644 1103070920 1304122786 answers/x answers1 makeppfile2 x,y3 4 ### 0 644 1103070741 1304122791 x,y makepp-2.0.98.3/t/additional_tests/2004_12_14_clean.test0000644000175000017500000000124512002504310022406 0ustar pfeifferpfeiffer### SPAR ### 19 755 1154549128 1342866883 makepp_test_script.pl # Ignore child process INT (matters on AIX) $SIG{INT} = 'IGNORE'; eval { makepp } and die 1; -f 'x' and -f '.makepp/x.mk' or die 2; for( qw(a lb) ) { unlink; open my $fh, '>', $_; close $fh; } makepp \'clean'; -f 'la' || -f 'b' || -f 'x' and die 3; -f 'a' && -f 'lb' or die 4; mkdir '.makepp'; # test harness needs it c_echo 'N_FILES\0010\0010\0010\01', '-o.makepp/log'; 1; ### 15 644 1103069835 1253820874 Makeppfile x: la lb &touch $@ perl { Mpp::is_windows ? die : kill 'INT', $$ } a: &echo a -o a la: a &ln -fs a la b: &echo b -o b lb: b &ln -fs b lb makepp-2.0.98.3/t/additional_tests/2004_12_06_scancache.test0000644000175000017500000000234312002502502023236 0ustar pfeifferpfeiffer### SPAR ### 1 644 1329052295 1329052295 is_relevant.pl have_cc ### 24 755 1154546812 1342866673 makepp_test_script.pl my $x = is_windows > 0 ? '.\\x' : './x'; makepp; system $x or die 1; # Make sure error status propagates if we need something that failed to build # on behalf of cached scanner info earlier. eval { makepp 'ERROR=1' } and die 2; wait_timestamp 'x.o'; makepp; system $x or die 3; # Make sure that we can fail to build on behalf of cached scanner info, and # still succeed if we didn't actually need the target that failed to build. wait_timestamp 'x.o'; makepp 'ERROR=1', 'NOINC=1'; system $x and die 4; # Make sure we rescan (not just rebuild) if x.c changes. c_sed 's/^$/#include "z.h"/', '-o+ ### 1 644 1103317920 1336936334 is_relevant.pl is_windows < 1 # Strawberry and ActiveState don't export empty vars ### 20 755 1100740057 1210256087 makepp_test_script.pl $ENV{FOO} = ''; makepp qw(RUN=1 PARSER=foo); c_cp 'a', 'a-1'; c_cp 'b', 'b-1'; c_cp 'c', 'c-1'; c_cp 'd', 'd-1'; rename 'rescan', 'rescan-1'; # a gets rebuilt, because $A goes from undef to '' $ENV{A} = ''; makepp qw(B_VAL=b_val MY_PATH_VAL=.:nodir RUN=2 PARSER='Mpp::CommandParser::foo'); c_cp 'a', 'a-2'; c_cp 'b', 'b-2'; c_cp 'c', 'c-2'; c_cp 'd', 'd-2'; rename 'rescan', 'rescan-2'; $ENV{A} = 'a'; delete $ENV{FOO}; makepp qw(B_VAL=b F_IN_DIR=1 RUN=3 PARSER=bar); ### 53 644 1289339760 1289339760 Makeppfile $(phony default): a b c d export RUN := $(RUN) MY_PATH_VAL ?= .:dir export MY_PATH := $(MY_PATH_VAL) B_VAL ?= b_val export B := $(B_VAL) perl_begin open(RESCAN, '>', "rescan") or die; close(RESCAN); { package Mpp::CommandParser::foo; our @ISA = qw/Mpp::CommandParser/; sub xparse_command { my $self = shift; open(RESCAN, '>', "rescan") or die; print RESCAN "yes\n"; close(RESCAN); $self->add_env_dependency("FOO"); } sub factory { shift; __PACKAGE__->new( @_ ); } } *p_bar = \&Mpp::CommandParser::foo::factory; perl_end a: :env A echo $$A $$RUN > $@ b: :environment B echo $$B $$RUN > $@ c: : env "f in MY_PATH" echo $$RUN > $@ d: : parser $(PARSER) # try both class and function echo $$RUN > $@ ifdef F_IN_DIR dir/f: &touch $@ else f: &touch $@ endif ### D 755 1100740147 1100740140 answers ### 1 644 1100655058 1100655039 answers/a a 3 ### 1 644 1100655058 1100655039 answers/a-1 1 ### 1 644 1100655058 1100655039 answers/a-2 2 ### 1 644 1100655058 1100655039 answers/b b 3 ### 1 644 1100655058 1100655039 answers/b-1 b_val 1 ### 1 644 1100655058 1100655039 answers/b-2 b_val 1 ### 1 644 1100655058 1100655039 answers/c 3 ### 1 644 1100655058 1100655039 answers/c-1 1 ### 1 644 1100655058 1100655039 answers/c-2 1 ### 1 644 1100740140 1100740140 answers/d 3 ### 1 644 1100740140 1100740140 answers/d-1 1 ### 1 644 1100740140 1100740140 answers/d-2 1 ### 1 644 1100740140 1100740140 answers/rescan yes ### 1 644 1100740140 1100740140 answers/rescan-1 yes ### 0 644 1100740140 1100740140 answers/rescan-2 makepp-2.0.98.3/t/additional_tests/2004_11_02_repository_rmstale.test0000644000175000017500000000346112002513135025275 0ustar pfeifferpfeiffer### SPAR ### 1 644 1329052295 1329052295 is_relevant.pl have_cc ### 30 644 1099447329 1342866492 makepp_test_script.pl makepp 'BUILD=1'; print "Checking that ./x exits nonzero...\n"; -x 'x' or die; system './x' or die; c_cp qw(targlist targlist-1); makepp 'BUILD=1'; c_cp qw(targlist targlist-2); # The x.o timestamp has to change, or else we might not rebuild x wait_timestamp 'x.o'; makepp '--rm_stale'; c_cp qw(targlist targlist-3); # Scanner removed the stale include file: -f 'stale2' and die; print "Checking that building a stale file results in an error...\n"; eval { makepp qw(--rm_stale stale) } and die; c_echo '/* Repos */', '-orepos/stale1'; makepp qw(--rm_stale stale1); 1; ### 25 644 1099447411 1099447387 Makeppfile repository repos CFLAGS := -I inc ifdef BUILD $(phony default): stale1 stale2 repos/stale x targlist frail2 perl {} else $(phony default): x targlist ./x endif ifdef BUILD stale$(foreach): : foreach 1 2 &echo "/* $@ */" -o $@ endif frail%: stale% &cp $< $@ targlist: &echo $(wildcard frail* stale*) -o $@ oldlist: &echo $(only_stale frail* stale*) -o $@ ### 6 644 1099422033 1099421990 x.c #define RETURN return 1 #include "stale2" int main() { RETURN; } ### D 755 1099447412 1099447412 inc ### 2 644 1099422496 1099422491 inc/stale2 #undef RETURN #define RETURN return 0 ### D 755 1099447412 1099447412 repos ### 7 644 1099421311 1099421301 repos/Makeppfile $(phony default): perl {} ifdef BUILD stale: &echo $@ -o $@ endif ### D 755 1099447412 1099447366 answers ### 1 644 1099447362 1099447333 answers/stale1 /* Repos */ ### 1 644 1099447358 1099447329 answers/targlist-1 frail1 frail2 stale1 stale2 ### 1 644 1099447360 1099447330 answers/targlist-2 frail frail1 frail2 stale stale1 stale2 ### 1 644 1099447362 1099447333 answers/targlist-3 makepp-2.0.98.3/t/additional_tests/2004_05_04_double_dollar.test0000644000175000017500000000107611010670663024153 0ustar pfeifferpfeiffer### SPAR ### 1 644 1103317920 1208344763 is_relevant.pl is_windows < 2 ### 13 644 1083646809 1083646829 Makeppfile # # Test bug reported by Ian Zimmerman where $$ didn't work if # rc_substitution := 0 (changed to makepp_simple_concatenation). # makepp_simple_concatenation := 1 $(phony all): xyz_val XYZ_VAL := $(shell eval `./get_xyz`; echo $$XYZ) xyz_val : &echo $(XYZ_VAL) -o $@ ### 2 755 1083646727 1083646727 get_xyz #!/bin/sh echo XYZ=abc ### D 755 1083646856 1083646858 answers/ ### 1 644 1083646851 1083646851 answers/xyz_val abc makepp-2.0.98.3/t/additional_tests/2004_04_28_unshift_makefile_lines.test0000644000175000017500000000053311144124454026055 0ustar pfeifferpfeiffer### SPAR ### 11 755 1083168750 1083168738 Makeppfile # test Mpp::Makefile::unshift_makefile_lines perl { Mpp::Makefile::unshift_makefile_lines <<'__HERE'; $(phony pass): perl {} __HERE } $(phony fail): perl { die } ### D 775 1083171684 1083171707 answers/ ### 1 664 1083171707 1190055864 answers/n_files 0 1 0 makepp-2.0.98.3/t/additional_tests/2004_04_22_envexe.test0000644000175000017500000000060211144402767022635 0ustar pfeifferpfeiffer### SPAR ### 8 644 1082657847 1209464896 Makeppfile export DOT := . x: ifperl Mpp::is_windows < 2 $$DOT/ec_o OK > $@ else %DOT%\ec_o OK > $@ endif ### 3 755 1082657833 1082657806 ec_o #!/bin/sh echo "$@" ### 1 755 1082657833 1209462365 ec_o.bat @echo %1 ### D 755 1082657921 1082657919 answers ### 1 644 1082657919 1082657919 answers/x OK makepp-2.0.98.3/t/additional_tests/2004_04_01_stale_repository.test0000644000175000017500000000317012035546125024747 0ustar pfeifferpfeiffer### SPAR ### 19 644 1161580578 1220024351 makepp_test_script.pl open my $x, '>res'; sub reptest { eval { &makepp }; print $x "-\n"; -f and print $x $_ . (stat _)[7] . "\n" or -l and print $x "$_ -> " . readlink() . "\n" for qw'a al b bl c cl dir/d e el fl'; } makepp qw(-Crep default -C../rep1 default); reptest '-Rrep'; unlink 'rep/a', 'rep/e', 'f'; # Make a disappear and preexisting fl stale. reptest qw(--dont-read=rep1/a --dont-read=rep1/dir -Rrep1 -Rrep); unlink 'rep/c'; # Make c and cl stale. reptest qw(--rm-stale-files -Rrep); reptest '--rm-stale-files'; close $x; ### 8 644 1159480520 1219830903 Makeppfile $(phony default): ? ?l dir/* e el: # Also test both created in one rule. &cp b e &ln -fs $(outputs) %l: % &ln -fs $(input) $(output) ### 0 644 1080844382 1080844382 f ### L S 0 0 fl f ### D 755 1080844589 1080844382 rep ### L S 0 0 rep/Makeppfile ../Makeppfile ### 0 644 1080844382 1080844382 rep/a ### 0 644 1080844382 1080844382 rep/b ### 0 644 1211984169 1211984169 rep/c ### D 755 1211984169 1211984169 rep/dir ### 0 644 1211984169 1211984169 rep/dir/d ### 0 644 1080844382 1080844382 rep/e ### D 755 1211984169 1211984169 rep1 ### L S 0 0 rep1/Makeppfile ../Makeppfile ### -1 644 1211984169 1211984169 rep1/a x ### -1 644 1211984169 1211984169 rep1/b x ### D 755 1211984169 1211984169 rep1/dir ### -1 644 1211984169 1211984169 rep1/dir/d x ### -1 644 1080844382 1080844382 rep/e x ### D 755 1080845081 1080844879 answers ### 29 644 1161580578 1231320028 answers/res - a0 al0 b0 bl0 c0 cl0 dir/d0 e0 el0 fl0 - al -> a b1 bl1 c0 cl0 dir/d0 e1 el1 - b0 bl0 dir/d0 e0 el0 - e0 el0 makepp-2.0.98.3/t/additional_tests/2004_03_31_stale.test0000644000175000017500000000331312000311117022430 0ustar pfeifferpfeiffer### SPAR ### 11 755 1119219345 1231331952 makepp_test_script.pl makepp qw(gone2 generated stale); c_cp 'generated', 'generated-1'; c_cp 'stale', 'stale-1'; unlink 'gone'; eval { makepp qw(-k --rm-stale) }; c_cp 'generated', 'generated-2'; c_cp 'stale', 'stale-2'; -f 'subdir/foo' or die; # Verify that it wasn't spuriously removed by makepp makepp qw(generated stale x STALE=1); ### 37 644 1151616989 1231331948 Makeppfile $(phony default): * perl_begin # Test that command line variables are accessible in Perl $MY_STALE = $makefile->expand_variable( 'STALE' ); perl_end a: d &touch $@ ifndef STALE b: &touch $@ endif register_input_suffix echo .x d: d.x : parser c_compilation echo $< > $@ x: &echo $(MY_STALE) -o $@ # Fake makepp into thinking that '0' will be a directory 0/y: &touch $@ gone2: gone1 &cp gone1 gone2 gone1: gone &cp gone gone1 generated: &echo $(only_generated *) -o $@ stale: &echo $(only_stale *) -o $@ ### 0 644 1080781634 1080781634 c ### 2 644 1119219345 1080782214 d.x #include "subdir/foo" #include "0" ### 0 644 1231330532 1231330532 gone ### D 755 1080782838 1080782836 subdir ### 4 644 1080782838 1080782836 subdir/Makeppfile bar: &touch foo bar prebuild bar ### D 755 1080782838 1080782836 answers ### 1 644 1080782836 1080782836 answers/generated a b d generated stale x ### 1 644 1080782836 1080782836 answers/generated-1 gone1 gone2 ### 1 644 1080782836 1080782836 answers/generated-2 a b d generated gone1 gone2 stale ### 1 644 1080782836 1080782836 answers/stale b ### 1 644 1080782836 1080782836 answers/stale-1 ### 1 644 1080782836 1080782836 answers/stale-2 ### 1 644 1080782836 1080782836 answers/x 1 makepp-2.0.98.3/t/additional_tests/2004_03_26_exit_status.test0000644000175000017500000000132610760362076023727 0ustar pfeifferpfeiffer### SPAR ### 12 755 1119217723 1066416654 makepp_test_script.pl # # Test whether $(perl ) aborts correctly with an error and whether # overriding the variables on the command line eliminates the error. # # # First two tests should fail: # eval { makepp 'X=x' } and die; eval { makepp 'Y=y' } and die; makepp 'X=x', 'Y=y'; ### 9 644 1164354228 1203697219 Makefile # # This makefile should abort with an error unless X and Y are overridden from # the command line. # X = $(perl die) Y = $(perl exit 1) x_contents: &echo X=$(X) Y=$(Y) -o $@ ### D 755 1067451882 1066416776 answers ### 1 644 1067451882 1066416701 answers/x_contents X=x Y=y ### 1 644 1067451882 1190055847 answers/n_files 1 0 0 makepp-2.0.98.3/t/additional_tests/2004_03_25_repository_rule.test0000644000175000017500000000121710760362436024617 0ustar pfeifferpfeiffer### SPAR ### 12 644 1080239550 1080240115 Makeppfile # Test case to make sure that we don't publish files from a repository # just because they can be built, because that interferes with the same # file being published when a rule to build it locally is encountered. x: d/foo.v &cp -l $< x %.v: %.vx &cp -l $< $@ foo.vx: bar.vx &cp -l $< $@ ### D 755 1080240134 1080240122 d ### 7 644 1080239413 1080239329 d/Makeppfile repository .. %.v: %.vx &cp -l $< $@ foo.vx: bar.vx &cp -l $< $@ ### 1 644 1080239531 1080239512 d/bar.vx OK ### D 755 1080239550 1080239531 answers ### 1 644 1080239811 1080239531 answers/x OK makepp-2.0.98.3/t/additional_tests/2004_03_24_scanner_c_lib.test0000644000175000017500000000366011715734605024137 0ustar pfeifferpfeiffer### SPAR ### 3 775 1168790726 1329052036 is_relevant.pl have_cc and is_windows < 0 || is_windows == 1 ? makepp( '-nfMakefile.relevant' ) : # Let makepp test if it uses a -l capable compiler. !is_windows ### 5 644 1077141637 1186229250 Makefile.relevant $(phony x): iftrue $(filter %cl %cl.exe %bcc32 %bcc32.exe, $(CC)) perl { die } endif ### 62 644 1160341077 1287952300 RootMakeppfile # # Test various things about the lexer, command parsers and C scanner: # 1) Splitting command up into multiple lines; # 2) Ignoring the echo with quoted string; # 3) Handling -lxyz. # 4) Whether a program is automatically recognized as an implicit dependency. # 5) Whether register_input_suffix works # # Also tests the builtin rule picking up xyz dependencies for xyz.exe on Windows. # $(phony all): .$/main CPP := $(find-program cpp) ifeq cpp, $(CPP) register_input_suffix $(CPP) .vpp %.v: %.vpp $(CPP) $< > $@ all: b.v c.v: &touch c.v perl { $two_more = 1 } endif perl {{ my $n_files = $two_more ? 8 : 6; $n_files .= Mpp::is_windows ? ' 2' : ' 1'; open my $fh, '>answers/n_files' or die; print $fh "$n_files 0\n"; }} main: LDLIBS = -L. -lxyz main: xyz1.o %.o : %.c @echo Compiling $(input) echo dummy > /dev/null; $(CC) $(CFLAGS) -c $(input) -o $(output) echo ' ; gcc a.c ' > /dev/null # Tests ignoring semicolon in quotes libxyz.a : xyz.o ifnsys Darwin $(AR) rs $(output) $(inputs) else $(AR) r $(output) $(inputs) ranlib $(output) endif # # This target should be made: # xyz.h: @&echo 'int xyz();' -o $(output) # # This target should not be made. # a.c : &touch $@ ### 1 644 1080322036 1080160284 b.vpp #include "c.v" ### 9 644 1080322036 1210245158 main.c #include "xyz.h" int xyz1(); int main() { return xyz(); } ### 4 644 1080322036 1080160259 xyz.c int xyz() { return 0; } ### 4 644 1080322036 1080160259 xyz1.c int xyz1() { return 0; } ### D 755 1080322113 1080161189 answers/ makepp-2.0.98.3/t/additional_tests/2004_03_16_recscan.test0000644000175000017500000000161011617225021022752 0ustar pfeifferpfeiffer### SPAR ### 16 644 1079481382 1311623828 Makeppfile register_command_parser ./nop skip_word CC := .$/nop $(CC) $(phony default): main.o perl { Mpp::Cmds::c_cp 'answers/x' unless -e 'x' } $(phony main.o): main.c : smartscan - $(CC) $(CFLAGS) $(CPPFLAGS) -c $(input) -o $(output) && echo "NOK" > x perl_begin use Mpp::Scanner::Verilog; my $s = new Mpp::Scanner::Verilog( Mpp::File::file_info('main.o')->get_rule, '.' ); $s->continue_scanning; $s->get_context; perl_end ### 2 755 1079480259 1079480254 nop #!/bin/sh exec "$@" ### 1 755 1079480259 1208539324 nop.bat @%1 %2 %3 %4 %5 %6 %7 %8 %9 ### 4 644 1079480259 1079480254 a.h #if 1 # include "a.h" #endif #define A 1 ### 8 644 1079480259 1079140626 main.c #include "a.h" int main() { #if A return 0; #endif return 1; } ### D 755 1079481394 1079144618 answers ### 1 644 1079144793 1079144618 answers/x OK makepp-2.0.98.3/t/additional_tests/2004_03_12_condscan.test0000644000175000017500000000775312002513137023133 0ustar pfeifferpfeiffer### SPAR ### 1 644 1329052295 1329052295 is_relevant.pl have_cc ### 11 755 1164319503 1342866383 makepp_test_script.pl makepp; my $correct=9; my $count=0; n_files 0, sub { $count++ if /File\s+warn_header/ }; c_echo '-ox2', $count == $correct ? 'OK' : "Warning \"File warn_header ...\" occured $count/$correct times, see C.pm"; 1; ### 23 644 1079144736 1186282528 Makeppfile _OBJ_SUFFIX := $(filter %cl %cl.exe %bcc32 %bcc32.exe, $(CC)) ifdef _OBJ_SUFFIX _OBJ_SUFFIX := .obj else _OBJ_SUFFIX := .o endif $(phony default): main1 main2 perl { Mpp::Cmds::c_cp 'answers/x1' unless -e x1 } perl { Mpp::Cmds::c_cp 'answers/x3' unless -e x3 } %$(_OBJ_SUFFIX): %.c :smartscan $(CC) $(CFLAGS) $(CPPFLAGS) -c $(input) -o $(output) b.h: &echo "NOK" -o x1 wrong.h: &echo "INCLUDE WRONG FILE" -o x2 wrong_header: &echo "INCLUDE WRONG FILE" -o x3 ### 4 644 1079140748 1079140593 a1.h #if 0 # include "b.h" #endif #define A 1 ### 62 644 1079140748 1079140593 a2.h #define FUNNY(x2) x2 #if FUNNY(1) #include "warn_header" //1 #elif FUNNY(2) #include "warn_header" //2 #else #include "warn_header" //3 #endif #if 1 #include "corr.h" #elif FUNNY(3) #include "wrong.h" #else #include "wrong.h" #endif #if 0 #include "wrong.h" #elif FUNNY(4) #include "warn_header" //4 #else #include "warn_header" //5 #endif #if FUNNY(5) #include "warn_header" //6 #elif 1 #include "warn_header" //7 #else #include "wrong.h" #endif #if FUNNY(6) #include "warn_header" //8 #elif 0 #include "wrong.h" #else #include "warn_header" //9 #endif #if 1 #define C1 1 #elif 0 #include "wrong.h" #else #include "wrong.h" #endif #if 0 #include "wrong.h" #elif 1 #define C2 1 #else #include "wrong.h" #endif #if 0 #include "wrong.h" #elif 0 #include "wrong.h" #else #define C3 1 #endif #if C1 && C2 && C3 #include "corr.h" #else #include "wrong.h" #endif ### 2 644 1079140748 1079140593 corr.h #define FALSE 0 #define TRUE 1 ### 1 644 1079140748 1079140593 warn_header #define C 1 ### 47 644 1079140748 1079140593 gcc_header.h #define C1 1 /* comment */ #define /* comment */ C2 1 #define C3 /* comment */ 1 #define C4 /* */ 1 // #include "wrong_header" /* /* #include "wrong_header" */ /* // #include "wrong_header" */ /* #include "wrong_header" */ /* //some/comment */ #define C5/**/1 /* */#define C6 1/**/ #define /* */C7/* */1 #define C8 \ 1 /* */ /* // */#define C9 1 // This comment continues on the next line, \ so don't be a fool and undef C9 \ #undef C9 #define C10 \ /* Not a continuation line */ #define C11 1 #if C1 && C2 && C3 && C4 && C5 && C6 && C7 && C8 && C9 && defined(C10) & C11 #include "corr3.h" #else #include "wrong_header" #endif #if 1 \ && 1 \ && A #include "wrong_header" #endif #ifndef C1 /* */ #include "wrong_header" #endif #ifndef C3 #include "wrong_header" #endif /* #include "wrong_header" //comm */ ### 39 644 1079140748 1079140593 cc_header.h #define C1 1 /* comment */ #define /* comment */ C2 1 #define C3 /* comment */ 1 #define C4 /* */ 1 /* #include "wrong_header" */ /* #include "wrong_header" */ /* //some/comment */ #define C5/*comm*/1 /* comm*/#define C6 1/*comm*/ #define /* */C7/* */1 #define C8 \ 1 /* */ /* */#define C9 1 #if C1 && C2 && C3 && C4 && C5 && C6 && C7 && C8 && C9 #include "corr3.h" #else #include "wrong_header" #endif #if 1 \ && 1 \ && A #include "wrong_header" #endif #ifndef C1 /* */ #include "wrong_header" #endif #ifndef C3 #include "wrong_header" #endif /* #include "wrong_header" //comm */ ### 1 644 1079140748 1079140593 corr3.h #define A 0 ### 8 644 1079140745 1079140626 main1.c #include "a1.h" int main() { #if A return 0; #endif return 1; } ### 4 644 1079140745 1079140626 main2.c #include "a2.h" int main() { return 0; } ### 8 644 1079140745 1079140626 main3.c #ifdef __GNUC__ #include "gcc_header.h" #else #include "cc_header.h" #endif int main() { return 0; } ### D 755 1079144793 1079144618 answers ### 1 644 1079144618 1079144618 answers/x1 OK ### 1 644 1079144618 1079144618 answers/x2 OK ### 1 644 1079144618 1079144618 answers/x3 OK makepp-2.0.98.3/t/additional_tests/2004_03_03_scan_build.test0000644000175000017500000000103511010670663023437 0ustar pfeifferpfeiffer### SPAR ### 1 644 1103317920 1208344763 is_relevant.pl is_windows < 2 ### 3 755 1119218920 1078367492 makepp_test_script.pl eval { makepp '-k' } and die; 1; ### 8 644 1078366902 1186228198 Makeppfile %: %.o &echo "NOK" -o x %: %.obj # Alternate rule for Windows native compilers &echo "NOK" -o x a.h: if [ ! -f a ]; then echo "OK" >a; fi perl { die } ### 3 644 1078366655 1078366653 a.c #if 0 # include "a.h" #endif ### D 755 1078366735 1078366724 answers ### 1 644 1078366735 1078366724 answers/a OK makepp-2.0.98.3/t/additional_tests/2004_03_03_minusk.test0000644000175000017500000000162712047225261022652 0ustar pfeifferpfeiffer### SPAR ### 3 755 1119218920 1078367492 makepp_test_script.pl eval { makepp '-k' } and die; 1; ### 27 644 1078366452 1189018730 RootMakeppfile $(phony all): a f g a: b d &echo "NOK" -o e &cat b d -o $@ b: c &echo "NOK" -o e &cp $< $@ c: &echo "OK" -o $@ perl { die } d: perl { unless( -f 'e' ) { open my $fh, '>', 'e'; print $fh "OK\n" }} &echo "OK" -o $@ # This tests that an inexistent file marked for dont-build (because outside of # ROOT) will cause an error if it doesn't exist (verified through n_files): f: $(mktemp /a) &touch f # This tests that we can prevent a target from being implicitly phony: makepp_require_phony = 1 g: &echo ### D 755 1078366417 1078366377 answers ### 1 644 1078366417 1078366377 answers/c OK ### 1 644 1078366417 1078366377 answers/d OK ### 1 644 1078366417 1078366377 answers/e OK ### 1 644 1119218920 1190055629 answers/n_files 1 1 2 makepp-2.0.98.3/t/additional_tests/2004_02_27_srctarg.test0000644000175000017500000000063612000311117022776 0ustar pfeifferpfeiffer### SPAR ### 2 755 1119218629 1077933027 makepp_test_script.pl c_cp 'dir/M', 'dir/Makeppfile'; makepp; ### 1 644 1077932896 1077932821 Makeppfile $(phony default): dir/test ### D 755 1077933102 1077933039 answers ### 1 644 1077933039 1077933039 answers/x OK ### D 755 1077933102 1077933085 dir ### 2 644 1077933077 1077932860 dir/M $(phony test): &echo OK $(only_targets *) -o ../x makepp-2.0.98.3/t/additional_tests/2004_02_25_only_targets_rule.test0000644000175000017500000000247111471045270025106 0ustar pfeifferpfeiffer### SPAR ### 6 755 1164318052 1078114112 makepp_test_script.pl makepp; n_files 'n_files_0'; rename 'libshared.sl', 'libshared.sl_0'; unlink <*.o *.co>; makepp 'working'; ### 31 644 1164354017 1078114267 Makeppfile ######################################## # # Run this makeppfile with some randomly # named .cpp files in the same directory # # makepp_no_builtin = 1 # Make some nice pattern rules %.o : %.cpp : parser none # or it will try to understand this "compiler" &touch $(output) # And another pattern rule involving .o files %.co : %.o &touch $(output) # # Note that the two rules below differ only # in the order of the dependencies! # $(phony default) : aother_tgt libshared.sl $(phony working) : libshared.sl aother_tgt $(phony aother_tgt) : $(only_targets **/*.co) @&echo Other_tgt dependencies are [ $(inputs) ] libshared.sl : $(only_targets **/*.o) &echo Compiling libshared.sl with [ $(inputs) ] -o $(output) ### 0 644 1078113901 1078113901 x.cpp ### D 755 1078114191 10781140241 answers ### 1 644 1078114206 1190055587 answers/n_files 3 2 0 ### 1 644 1078114177 1190055595 answers/n_files_0 3 2 0 ### 1 644 1078114184 1078114184 answers/libshared.sl Compiling libshared.sl with [ x.o ] ### 1 644 1078114183 1078114183 answers/libshared.sl_0 Compiling libshared.sl with [ x.o ] makepp-2.0.98.3/t/additional_tests/2004_02_19_repository_change.test0000644000175000017500000000357412002563333025075 0ustar pfeifferpfeiffer### SPAR ### 1 775 1168790726 1329052044 is_relevant.pl have_cc and is_windows ? makepp( '-n' ) : 1; # Let makepp test if it uses a symlink capable compiler. ### 54 644 1159479798 1342866037 makepp_test_script.pl sub sed_17($) { # Make sure that the foo.c timestamp changes wait_timestamp 'foo.c'; c_sed "s/17/$_[0]/", 'foo/f.c', '-ofoo/foo.c'; } sub from_rep($) { c_cp 'foo/bar/x', $_[0]; open my $in, 'foo/bar/.makepp/foo.c.mk'; /FROM_REPOSITORY/ and return while <$in>; open my $out, ">>$_[0]"; print $out "Lost repository\n"; } c_cp qw(M foo/Makeppfile); makepp qw(-R foo/bar=foo foo/bar/nothing); unlink 'foo/Makeppfile'; makepp qw(-R foo/bar=foo); c_cp qw(M foo/Makeppfile); c_cp qw(foo/f.c foo/foo.c); makepp qw(-R foo/bar=foo foo/bar/x); sed_17 18; makepp qw(-R foo/bar=foo foo/bar/x); from_rep 'x'; c_cp qw(foo/f.c foo/foo.c); makepp 'foo/x'; makepp \'clean', '--only-repository-links', 'foo/bar'; # This should pick up x from foo/ makepp qw(-R foo/bar=foo foo/bar/x); sed_17 18; makepp 'foo/x'; makepp \'clean', '--only-repository-links', 'foo/bar'; # This should pick up x from foo/ makepp qw(-R foo/bar=foo foo/bar/x); from_rep 'y'; sed_17 19; # Now it should recompile, but still remember that foo.c comes from a repos makepp qw(-R foo/bar=foo foo/bar/x); from_rep 'z'; 1; ### 5 644 1077141637 1186229250 Makeppfile $(phony x): iftrue $(filter %cl %cl.exe %bcc32 %bcc32.exe, $(CC)) perl { die } endif ### 5 644 1077143366 1077143363 M $(phony nothing): @perl {} x: foo .$/foo > $@ ### D 755 1077216823 1077216823 foo ### 5 644 1077143391 1077143389 foo/f.c #include int main() { printf("17\n"); return 0; } ### D 755 1077216767 1077216766 foo/bar ### D 755 1077216766 1077216761 answers ### 1 644 1077144030 1077144018 answers/x 18 ### 1 644 1077216767 1077216761 answers/y 18 ### 1 644 1077216767 1077216761 answers/z 19 makepp-2.0.98.3/t/additional_tests/2004_02_12_xargs.test0000644000175000017500000001041510531705337022465 0ustar pfeifferpfeiffer### SPAR ### 14 644 1076629100 1076629025 Makeppfile MT := X := 0 1 2 3 4 5 6 7 8 9 Y := $(X)$(X)$(X) $(phony default): mt y mt: &touch $@ $(xargs &echo, $(MT), -o>>$@) y: $(xargs &echo, $(Y), -o>>$@) ### D 755 1076629100 1076629100 answers ### 0 644 1076629059 1076629059 answers/mt ### 5 644 1076629062 1076629062 answers/y 000 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 032 033 034 035 036 037 038 039 040 041 042 043 044 045 046 047 048 049 050 051 052 053 054 055 056 057 058 059 060 061 062 063 064 065 066 067 068 069 070 071 072 073 074 075 076 077 078 079 080 081 082 083 084 085 086 087 088 089 090 091 092 093 094 095 096 097 098 099 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 makepp-2.0.98.3/t/additional_tests/2004_01_21_repository_build.test0000644000175000017500000000137710245162277024747 0ustar pfeifferpfeiffer### SPAR ### 17 644 1074727871 1074727839 Makeppfile FOO := $(wildcard */x) repository rep BAR := $(wildcard ./*x) # At this point, we think that we can build ./x by grabbing it from the # repository, but we can't because it hasn't been built there. y: $(BAR) &echo $^ -o $@ # This is needed to invoke the ADDITIONAL_DEPENDENCIES clause for the # DefaultRule class. Otherwise, makepp dies because it can't build ./x # when it needs to, even though it thought that it could when it computed # $(BAR). x: xx ### D 755 1074727871 1074727871 answers ### 1 644 1074727886 1074727854 answers/y xx ### D 755 1074727871 1074727871 rep ### 2 644 1074724642 1074724550 rep/Makeppfile x: &echo X -o $@ ### 1 644 1074727515 1074727482 xx XX makepp-2.0.98.3/t/additional_tests/2003_12_05_phony_repository.test0000644000175000017500000000140310661143674025000 0ustar pfeifferpfeiffer### SPAR ### 1 644 1070669423 1070669357 Makeppfile $(phony target): ### 1 644 1070669423 1070669357 foo A file not imported from the repository to link to. ### D 755 1070668820 1070668804 answers ### 0 644 1070668804 1070668804 answers/x ### D 755 1070669462 1070669468 dir ### 6 644 1070669423 1070669362 dir/Makeppfile repository .. bar%: tar% touch $@ $(phony target): $(wildcard bar*) ### 8 644 1070669422 1070669410 makepp_test_script.pl symlink qw/foo tarfoo/; makepp qw(--symlink-in-repos-as-file dir/target); open my $out, '>x'; if( -l 'dir/target' ) { print $out "oops1\n" } if( -e 'dir/barget' ) { print $out "oops2\n" } unless( -e 'dir/barfoo' ) { print $out "oops3\n" } unless( -e 'dir/tarfoo' ) { print $out "oops4\n" } 1; makepp-2.0.98.3/t/additional_tests/2003_11_25_wild.test0000644000175000017500000000172111715735363022312 0ustar pfeifferpfeiffer### SPAR ### 1 644 1329052295 1329052295 is_relevant.pl have_cc ### 5 755 1164315688 1210172653 makepp_test_script.pl makepp '-Cdir'; rename 'dir/z', 'z'; rename 'dir/.makepp/log', 'log'; rename 'log', '.makepp/log'; 1; ### 10 644 1143325703 1234180236 RootMakeppfile.mk FILES := $(wildcard *.x) perl { Mpp::File::path_file_info '/foo'; } ifneq($(filter //, $(wildcard /*)),) perl { die } endif x.h: $(FILES) &cat $(inputs) -o $@ ### 1 644 1069788782 1069788602 bar.x #define X 0 ### 3 644 1069789246 1069789240 foo.x #ifndef X # define X 1 #endif ### D 755 1069789370 1069789370 dir ### 4 644 1069788872 1208527221 dir/Makeppfile.mk CFLAGS := -I .. z: .$/y > $@ ### 3 644 1069789252 1069789246 dir/foo.x #ifndef X # define X 1 #endif ### 7 644 1069788645 1069788529 dir/y.c #include #include "x.h" int main() { printf("%d\n", X); return 0; } ### D 755 1069789369 1069789369 answers ### 1 644 1069789051 1069788703 answers/z 0 makepp-2.0.98.3/t/additional_tests/2003_11_25_repository_tot.test0000644000175000017500000000106710531705337024454 0ustar pfeifferpfeiffer### SPAR ### 0 644 1069811870 1069811870 TOT ### D 755 1069812716 1069812716 answers ### 1 644 1069812196 1069812190 answers/x ../../ ../../ ### D 755 1069812716 1069812716 d1 ### D 755 1069812716 1069812716 d1/var ### 8 644 1164315563 1069812011 d1/var/Makeppfile FOO := $(dir $(find_upwards TOT)) repository .=.. BAR := $(dir $(find_upwards TOT)) x: &echo $(FOO) $(BAR) -o $@ ### 6 755 1164321341 1069812714 makepp_test_script.pl chdir 'd1/var'; makepp; rename 'x', '../../x'; rename '.makepp', '../../.makepp'; chdir '../..'; 1; makepp-2.0.98.3/t/additional_tests/2003_11_14_timestamp_md5.test0000644000175000017500000000163612002500526024103 0ustar pfeifferpfeiffer### SPAR ### 11 755 1119251973 1342865688 makepp_test_script.pl { open my $fh, '>', 'raw' } # There is no guarantee that a bug will actually show up here, because it # might always take long enough to load makepp that the timestamps always # change on generated targets. If the environment is conducive to exposing # such a bug, then it will usually happen by the 4th run. makepp "X=$_" for 1..4; c_grep '-v', '/^makepp[: ]/', 'raw', '-ocommands'; 1; ### 1 644 1119251973 1208342214 makeppextra.pm open STDOUT, '>>', 'raw'; # Doing this in run_tests can prevent raw from being deleted. ### 9 644 1163099047 1068849106 Makeppfile override signature md5 $(phony default): y x: &echo -o $(output) $(X) y: x &cp $< $@ ### D 755 1068849350 1068849350 answers ### 8 644 1119253233 1068849337 answers/commands &echo -o x 1 &cp x y &echo -o x 2 &cp x y &echo -o x 3 &cp x y &echo -o x 4 &cp x y makepp-2.0.98.3/t/additional_tests/2003_11_14_repository_unlink.test0000644000175000017500000000107412000311121025113 0ustar pfeifferpfeiffer### SPAR ### 4 755 1068846494 1210885908 makepp_test_script.pl makepp qw(-F base); eval { makepp qw(x y die) } or print $@; makepp qw(Y=1 x); c_cp 'base/y', 'z'; ### 2 644 1068850460 1068850417 Makeppfile repository base include base.mk ### D 755 1068850460 1068850460 answers ### 1 644 1068846723 1068846482 answers/z y ### D 755 1068850460 1068850460 base ### 9 644 1068848941 1210885918 base/base.mk X ?= x Y ?= y x y: &echo $X -o x &echo $Y -o y die: x y perl { die } ### 1 644 1068771992 1068771967 base/Makeppfile include base.mk makepp-2.0.98.3/t/additional_tests/2003_10_11_idash.test0000644000175000017500000000621112074531774022433 0ustar pfeifferpfeiffer### SPAR ### 5 755 1067451881 1208283124 is_relevant.pl # # -I- is supported by gcc, but I don't know what else. We'll just skip unless # gcc is in the path, but maybe the scope of the test should be broadened. # !system $ENV{CC} || 'gcc', '-I-', '-v' if exists $ENV{CC} ? $ENV{CC} =~ /\bg[^\/]+(?:\.exe)?$/ : 1; ### 36 644 1164353916 1358082973 makepp_test_script.pl # # This test depends entirely on the builtin rules. # # Tests several things about C compilation: # 1) Correctly parsing command lines to scan for include files. # 2) Correctly calculating checksums so if files change we do not # rebuild, but we always rebuild when necessary. # 3) Tests the builtin rules. # # This makefile depends on the existence of a C compiler. # # Replace the .c file multiple times and see which replacements trigger a # rebuild. # my @exe_dep = is_windows ? '--no-path-exe-dep' : (); my $compiled; for $iter (0 .. 3) { print "**** Iteration $iter\n"; wait_timestamp 'compilation.o' if $compiled; makepp @exe_dep, 'CPPFLAGS=-I subdir1 -I- -Isubdir2', "ITERATION=$iter", 'compilation_test'; open STDOUT, ">iteration_$iter"; system '.' . ($^O =~ /^MSWin/ ? '\\' : '/') . 'compilation_test'; # Make sure makepp found x2 in subdir1, not # in the main directory. $compiled = "0 0 0\n" ne n_files "n_files_$iter", sub { die if /warning: can.t locate file/ }; # Make sure makepp correctly found all include files. open STDOUT, '>/dev/null'; # placeholder } if( is_windows ) { for my $n ( '', qw(_0 _1 _2 _3) ) { c_sed 's/ 0 / 1 /', "-o+ #include "x.h" #include "y.h" #include int main() { printf("%d %d %d %d\n", X, Y, Y2, Z); return 0; } ### D 755 1067451881 1065044637 subdir1 ### 19 644 1067451881 1065042122 subdir1/Makeppfile Y2 := 2 ifeq ($(ITERATION),3) Y2 := 22 endif Z := 3 ifneq ($(ITERATION),0) Z := 23 endif x.h: &echo '#define X 1' -o $(output) y2.h: &echo '#define Y2 $(Y2)' -o $(output) # Not used z.h: &echo '#define Z $(Z)' -o $(output) ### D 755 1067451881 1065044637 subdir2 ### 23 644 1067451881 1065042233 subdir2/Makeppfile Y2 := 11 ifneq ($(ITERATION),0) Y2 := 31 endif Z := 12 ifeq ($(ITERATION),2) Z := 32 endif ifeq ($(ITERATION),3) Z := 32 endif y.h: &echo '#define Y 10' -o $(output) &echo '#include "y2.h"' -o>>$(output) # Not used y2.h: &echo '#define Y2 $(Y2)' -o $(output) z.h: &echo '#define Z $(Z)' -o $(output) ### D 755 1067451881 1065041959 answers ### 1 644 1067451881 1190055512 answers/n_files 3 0 0 ### 1 644 1067451881 1065042284 answers/iteration_0 1 10 2 12 ### 1 644 1067451881 1065042284 answers/iteration_1 1 10 2 12 ### 1 644 1067451881 1065042284 answers/iteration_2 1 10 2 32 ### 1 644 1067451881 1065042284 answers/iteration_3 1 10 22 32 ### 1 644 1067451881 1190055524 answers/n_files_0 6 0 0 ### 1 644 1067451881 1190055527 answers/n_files_1 0 0 0 ### 1 644 1067451881 1190055532 answers/n_files_2 3 0 0 ### 1 644 1067451881 1190055536 answers/n_files_3 3 0 0 makepp-2.0.98.3/t/additional_tests/2003_08_13_load_makefile_quotes.test0000644000175000017500000000176411514623246025532 0ustar pfeifferpfeiffer### SPAR ### 5 755 1295029025 1295029025 is_relevant.pl # # Test if unpacking used our uid (nfs) and managed to chmod to a special value. # my( $mode, $uid ) = (stat 'Makeppfile')[2, 4]; $uid == $> && ($mode & 0777) == 0400; ### 9 400 1164353694 1060835785 Makeppfile # # Test bug reported by Chris van Engelen about quotes in load_makefile command # strings and whether a makefile can be read when it has a mode of 0400. (Bug # reported by Hagen Ulrich in makepp 1.19.). # load_makefile subdir1 VAR1="a b c" $(phony all): subdir1/$( a b c) ### D 755 1067451881 1060835822 subdir1 ### 4 644 1164353486 1060835783 subdir1/Makeppfile X := $(print $(VAR1)) $(VAR1): &echo $@ -o $@ ### D 755 1067451881 1060835819 answers ### 1 644 1067451881 1190055489 answers/n_files 3 1 0 ### D 755 1067451881 1060835811 answers/subdir1 ### 1 644 1067451881 1060835793 answers/subdir1/a a ### 1 644 1067451881 1060835793 answers/subdir1/b b ### 1 644 1067451881 1060835793 answers/subdir1/c c makepp-2.0.98.3/t/additional_tests/2003_08_08_whitespace.test0000644000175000017500000000111410531705337023503 0ustar pfeifferpfeiffer### SPAR ### 20 644 1067451881 1060385735 Makeppfile # # Test comment syntax (bug reported by hgoldman) # $(phony all): xyz abc xyz: &echo This is a test. -o $@ # this is a comment &echo This is the second part of the test. -o>>$@ # # Test ifeq syntax with spaces (bug reported by Chris van Engelen): # abc: ifeq (a, a) &echo good -o $@ else &echo bad -o $@ endif ### D 755 1067451881 1060385756 answers ### 1 644 1067451881 1060385743 answers/abc good ### 2 644 1067451881 1060385743 answers/xyz This is a test. This is the second part of the test. makepp-2.0.98.3/t/additional_dependencies.test0000644000175000017500000000241110674045027021353 0ustar pfeifferpfeiffer### SPAR ### 46 644 1067451873 967513317 Makeppfile # # Test specifying additional dependencies on a line that does not have any # actions. # .PHONY: all all: c d f c: a &cat $^ -o $@ # # This tests the horrible idiom whereby a command with several targets is # sometimes split up so that one target depends on the other, in order to # get around make's stupid restriction of one target per command. # a: b b: &echo a -o a &echo b -o b # # Test depending on a wildcard. # d: [12].c d: e &cat $^ -o $@ 1.c 2.c 3.c 4.c: &echo $@ -o $@ e: &echo e -o $@ # # Test depending on a wildcard when there's no rule. # f: g [34].c g: &echo g -o g &echo f -o f ### D 755 1067451873 967513503 answers ### 1 644 1067451873 967513497 answers/a a ### 1 644 1067451873 967513497 answers/b b ### 1 644 1067451873 967513497 answers/c a ### 3 644 1067451873 967513497 answers/d e 1.c 2.c ### 1 644 1067451873 967513497 answers/e e ### 1 644 1067451873 967513497 answers/f f ### 1 644 1067451873 967513497 answers/g g ### 1 644 1067451873 967513497 answers/1.c 1.c ### 1 644 1067451873 967513497 answers/2.c 2.c ### 1 644 1067451873 967513497 answers/3.c 3.c ### 1 644 1067451873 967513497 answers/4.c 4.c ### 1 644 1067451873 1190053811 answers/n_files 9 1 0 makepp-2.0.98.3/t/aaasimple.test0000644000175000017500000000116711160544530016472 0ustar pfeifferpfeiffer### SPAR ### 13 644 1067451873 965331711 Makeppfile # # This test is about the simplest possible test of a makefile, using # the most straightforward inference rules. # file3: file1 file2 &cat file1 file2 -o $@ file2: &echo 2 -o $(target) file1: &echo 1 -o $(target) ### 1 644 1236523730 1236523730 hint This test is fundamental. Something is totally wrong! ### D 755 1067451873 965332260 answers ### 1 644 1067451873 965332255 answers/file1 1 ### 1 644 1067451873 965332253 answers/file2 2 ### 2 644 1067451873 965332260 answers/file3 1 2 ### 1 644 1067451873 965332231 answers/n_files 3 0 0 makepp-2.0.98.3/recursive_makepp0000644000175000017500000000500512107720651016656 0ustar pfeifferpfeiffer#!/usr/bin/env perl # # This is a script that runs when make is invoked recursively using the # $(MAKE) variable. It simply reports to the parent make process what # the make command was and what the current working directory is now. # The parent makepp process sets the environment variable MAKEPP_SOCKET # to be the name of a file that we're supposed to write information about the # cwd and make command. # $Id: recursive_makepp,v 1.8 2013/02/16 15:11:37 pfeiffer Exp $ # use Cwd; use IO::Socket; my $socket_name = $ENV{'MAKEPP_SOCKET'}; # Where are we supposed to send the output? defined $socket_name or die "$0: not invoked from makepp\n"; my $socket = IO::Socket::UNIX->new(Peer => $socket_name, Type => SOCK_STREAM); # Open the socket. unless( defined $socket ) { print "Error opening $socket_name--$!\n"; sleep 500; die "recursive makepp: socket open error--$!\n"; } # # Replace the quotes that used to be around each of the arguments. We # can't make it exactly like it used to be, but if we place quotes around # every argument, then we'll certainly not be confused by spaces. # my @words; foreach (@ARGV) { s/\\/\\\\/g; # Protect all backslashes. s/\"/\\\"/g; # Protect all single quotes. push @words, /[^-.\/\w]/ ? qq["$_"] : $_; # Append this word, keeping spaces intact. } my $message = join(' ', cwd, @words) . "\n"; # Send the command first. while (($var, $val) = each %ENV) { # Send the environment back too. $val =~ s{([\0-\037\\])}{sprintf("\\%o", ord($1))}eg; # Protect any binary characters or backslashes. $message .= "$var=$val\n"; } print $socket $message . "\01END\01" or # Send to makepp. die "recursive makepp: error writing to socket--$!\n"; my $response; sysread $socket, $response, 16384; $response .= $_ while sysread $socket, $_, 16384; # Wait for rest of response before we proceed. if( $response =~ s/\A(\d+)\s+// ) { # Status is the first word of the response. $status = $1; } elsif( $response =~ /\Aexec (.+)\n(.*)\n/ ) { # Need to recurse traditionally $ENV{_MAKEPPFLAGS} = $2; my $cmd = join ' ', $1, grep !/^"recursive_makepp=\d+"$/, @words; print "$cmd\n"; exec $cmd; die "$0: can't exec $cmd--$!"; } else { warn "recursive_makepp: protocol error '$response'\n"; $status = 253; } chomp $response; # Strip extra newline out if there is one. $response and print STDERR "\$(MAKE): $response\n"; # Any error message? #chomp $_; #print "Recursive make: status was '$_'\n"; exit $status; # Exit with the same error code. makepp-2.0.98.3/pod/0000755000175000017500000000000012115460735014154 5ustar pfeifferpfeiffermakepp-2.0.98.3/pod/pod2htmd.tmp0000644000175000017500000000240512115460733016416 0ustar pfeifferpfeiffer. . makepp_variables ./makepp_variables.pod: makepp_incompatibilities ./makepp_incompatibilities.pod: makepp_signatures ./makepp_signatures.pod: makepp_build_cache ./makepp_build_cache.pod: makepp_command ./makepp_command.pod: makepp_compatibility ./makepp_compatibility.pod: makeppbuiltin ./makeppbuiltin.pod: makepp_sandboxes ./makepp_sandboxes.pod: makepp_scanning ./makepp_scanning.pod: makeppinfo ./makeppinfo.pod: makepp_speedup ./makepp_speedup.pod: makepp_rules ./makepp_rules.pod: makepp_builtin ./makepp_builtin.pod: makepp_tutorial_compilation ./makepp_tutorial_compilation.pod: makepp_statements ./makepp_statements.pod: makepp_functions ./makepp_functions.pod: makepp_tutorial ./makepp_tutorial.pod: makepp_repositories ./makepp_repositories.pod: makepp ./makepp.pod: makepp_faq ./makepp_faq.pod: perl_performance ./perl_performance.pod: makepp_release_notes ./makepp_release_notes.pod: html ./html: makeppgraph ./makeppgraph.pod: makepp_builtins ./makepp_builtins.pod: makepp_cookbook ./makepp_cookbook.pod: makepp_build_algorithm ./makepp_build_algorithm.pod: makepplog ./makepplog.pod: makepp_extending ./makepp_extending.pod: makeppclean ./makeppclean.pod: makepp_build_check ./makepp_build_check.pod: makeppreplay ./makeppreplay.pod: makepp_index ./makepp_index.pod: makepp-2.0.98.3/pod/pod2htmi.tmp0000644000175000017500000006157512115460733016440 0ustar pfeifferpfeiffer. . C_suffix1_suffix2_suffix3 ./makepp_signatures.html verbose ./makeppclean.html tr ./makepp_builtins.html register_command_parser_command_word_parser ./makepp_statements.html DELETE_ON_ERROR ./makepp_incompatibilities.html override_signature_method_method ./makepp_command.html BC ./makepplog.html m4 ./makepp_builtins.html date ./makepp_builtins.html zOS ./makepp_compatibility.html lines_list ./makepp_builtins.html include_dir_directory ./makeppreplay.html MODE_mode ./makepp_build_cache.html Inline_Perl_code ./makepp_tutorial.html ADATE_MDATE_CDATE ./makepp_build_cache.html strip_string ./makepp_functions.html unique ./makepplog.html transform_perlcode ./makepp_builtins.html addprefix_prefix_words ./makepp_functions.html prebuild_target ./makepp_statements.html chars ./makepp_tutorial.html atime ./makepp_build_cache.html i_shellcommand ./makepp_builtins.html FC ./makepp_variables.html += ./makepp_variables.html sed_option_perlcode_filename ./makepp_builtins.html dir ./makeppgraph.html recon ./makeppreplay.html signature_method ./makepp_command.html build_info_check ./makepp_build_cache.html load_makefile_subdir ./makepp_statements.html only_nontargets_filenames ./makepp_functions.html sandbox_path ./makepp_sandboxes.html last_chance_rules ./makepp_command.html keep_going ./makeppreplay.html traditional_recursive_make ./makepp_command.html global_build_check_build_check_method ./makepp_statements.html q_or_question ./makepp_incompatibilities.html W_filename ./makepp_command.html filename ./makepp_builtins.html make_target ./makepp_statements.html export_assignment ./makepp_statements.html only_stale_filenames ./makepp_functions.html CC ./makepp_variables.html chmod_option_mode_filename ./makepp_builtins.html a ./makepp_builtins.html UID ./makepp_build_cache.html dates ./makeppinfo.html dependencies ./makeppgraph.html Comments_don_t_have_continuation_lines ./makepp_incompatibilities.html load_makefile_VAR1_value1_VAR2_value2_subdir ./makepp_statements.html cwd_number ./makeppgraph.html infer_objects_file1_file2_pattern ./makepp_functions.html k ./makeppreplay.html Win ./makepp_compatibility.html dispatch_command ./makepp_rules.html make_targets ./makepp_functions.html infail ./makepp_builtins.html C_number ./makepplog.html MAKEPPFLAGS ./makepp_variables.html w_filename ./makepp_builtins.html do_read_path ./makepp_sandboxes.html U ./makepp_builtins.html only_action ./makepp_build_check.html atime_mtime_ctime ./makepp_build_cache.html install_dirs ./makepplog.html subdir_chars_n1_n2 ./makepp_build_cache.html predicate_perlcode ./makepp_build_cache.html dependency ./makepp_variables.html warn_undefined_variables ./makepp_incompatibilities.html p_prefix_path_to_installation ./makepp_faq.html preprocess_option_variable_definition_filename ./makepp_builtins.html iftrue_string_result_if_string_true_result_if_string_false ./makepp_functions.html uniq_option_filename ./makepp_builtins.html $DIRECTNAMEFLAGS ./makeppbuiltin.html phony ./makeppgraph.html only_build_cache_links ./makeppclean.html $(outputs) ./makepp_tutorial.html ?= ./makepp_variables.html keep_src_info ./makeppclean.html ifdef_VARIABLE ./makepp_statements.html R ./makeppclean.html subst_from_to_text ./makepp_functions.html environment_overrides ./makepp_command.html prefix ./makepplog.html suffix_names ./makepp_functions.html log_file_logfilename ./makeppreplay.html strip ./makepp_builtins.html cwd ./makeppgraph.html c_spec ./makepp_build_cache.html wordlist_indexlist_words ./makepp_functions.html modification_time_spec ./makepp_build_cache.html s_spec ./makepp_build_cache.html printf_format ./makepp_builtins.html f_list ./makepp_builtins.html echo_option_string ./makepp_builtins.html export_MAKEPP_LN_CP_3 ./makepp_builtins.html w_or_print_directory ./makepp_incompatibilities.html words_text ./makepp_functions.html m_method ./makepp_command.html force_copy_from_bc ./makepp_command.html deletable ./makepp_build_cache.html filter_out_patterns_words ./makepp_functions.html VFAT_on_GNU_Linux ./makepp_compatibility.html h_htmldir_path_to_installation_share_html ./makepp_faq.html absolute_filename_files ./makepp_functions.html BI_UID ./makepp_build_cache.html workdays ./makepp_build_cache.html sed_perl_expression ./makeppreplay.html $< ./makepp_variables.html global_override_signature_name ./makepp_statements.html R_or_no_builtin_variables ./makepp_incompatibilities.html rm_option_filename ./makepp_builtins.html nonewline ./makepp_builtins.html MFLAGS ./makepp_incompatibilities.html makemap_words_perlcode ./makepp_functions.html merge_perlcode ./makeppgraph.html ifntrue_expression ./makepp_statements.html resolve ./makepp_builtins.html yes_option_string ./makepp_builtins.html down ./makeppgraph.html root_dir ./makeppreplay.html defined ./makepp_builtins.html no_implicit_load ./makepp_statements.html mv_option_sourcefile ./makepp_builtins.html in_sandbox_directory ./makepp_command.html reverse ./makepp_builtins.html & ./makepp_rules.html ignore_action ./makepp_build_check.html remove_stale_files ./makepp_command.html user_user ./makepp_build_cache.html m_perms ./makepp_build_cache.html shellcommand ./makepp_builtins.html up ./makeppgraph.html $MAKEPPINFOFLAGS ./makeppinfo.html s_n1_n2 ./makepp_build_cache.html findfile_filename_path ./makepp_functions.html symlink ./makepp_builtins.html sx ./makepp_incompatibilities.html cat_option_filename ./makepp_builtins.html log ./makeppclean.html unremembered ./makeppinfo.html Not_specifying_all_dependencies ./makepp_tutorial.html extend_group ./makepp_build_cache.html change_time_spec ./makepp_build_cache.html p ./makepplog.html populate_bc_only ./makepp_command.html wildcard_pattern ./makepp_functions.html new_group_group ./makepp_build_cache.html S ./makepp_builtins.html outputs ./makepp_variables.html separate_directions ./makeppgraph.html inpipe_shellcommand ./makepp_builtins.html r_perlcode ./makeppgraph.html loop ./makepp_command.html e_group ./makepp_build_cache.html makepptemplate ./makeppbuiltin.html waste_file_filename ./makepp_builtins.html metainfo ./makepp_builtins.html repository_links ./makeppclean.html p_none_p_skip_word_or_p_shell ./makepp_scanning.html filter_out_dirs_filenames ./makepp_functions.html dont_build_path ./makepp_sandboxes.html undef ./makepp_scanning.html access_time ./makepp_build_cache.html ATIME_MTIME_CTIME ./makepp_build_cache.html sandbox_directory ./makepp_command.html global_build_cache_path_to_build_cache ./makepp_statements.html D ./makeppgraph.html parser_parser ./makepp_rules.html w ./makepp_build_cache.html $MAKEPPLOGFLAGS ./makepplog.html t_or_touch ./makepp_incompatibilities.html sorted_dependencies ./makepp_variables.html signature_name ./makepp_statements.html $MAKEPPREPLAYFLAGS ./makeppreplay.html p_pattern ./makepp_build_cache.html only_repository_links ./makeppclean.html C ./makepp_signatures.html s_string ./makepp_builtins.html detransform_perlcode ./makepp_builtins.html targets ./makepp_variables.html arguments_file_filename ./makeppreplay.html env_overrides ./makepp_command.html long_x ./makepp_incompatibilities.html s_prefix_suffix ./makepp_builtins.html recursive ./makeppclean.html perl ./makepp_rules.html Syntax ./makeppbuiltin.html d_perlcode ./makepp_builtins.html exe ./makeppgraph.html ZGRViewer ./makeppgraph.html cp_option_sourcefile_destdir ./makepp_builtins.html M_module_arg ./makeppreplay.html symbolic_link ./makepp_builtins.html owner_owner ./makepp_builtins.html $/ ./makepp_variables.html runtime_program_library ./makepp_statements.html absolute_filename_nolink_files ./makepp_functions.html bidirectional ./makeppgraph.html include_file_or_pattern ./makepp_rules.html only_phony_targets_names ./makepp_functions.html includes ./makeppgraph.html repeated ./makeppgraph.html firstword_words ./makepp_functions.html template ./makeppbuiltin.html makesub ./makepp_statements.html inputs ./makepp_variables.html expr_option_perlcode ./makepp_builtins.html ifnsys_wildcard ./makepp_statements.html ifsys_wildcard ./makepp_statements.html c ./makeppreplay.html recurse ./makeppclean.html command_arguments ./makepp_extending.html register_input_suffix_command_word_suffix ./makepp_statements.html installation_directories ./makepplog.html symlink_check ./makepp_build_cache.html mtime_spec ./makepp_build_cache.html j_n ./makepp_command.html include ./makeppgraph.html $MAKEPPBUILTINFLAGS ./makeppbuiltin.html foreach ./makepp_variables.html no_populate_bc ./makepp_command.html implicit_load_makeppfile_only ./makepp_command.html find_program_name ./makepp_functions.html first_available_file1_file2 ./makepp_functions.html l_list ./makepp_builtins.html preferred ./makepp_build_cache.html m ./makeppclean.html makeperl ./makepp_rules.html abspath_files ./makepp_functions.html extend_group_group ./makepp_build_cache.html load_makeppfile_Makefile ./makepp_command.html export_MAKEPP_LN_CP_1 ./makepp_builtins.html Makefile_PL ./makepp_faq.html old_file_filename ./makepp_command.html awk ./makepp_builtins.html h_hash ./makepp_builtins.html YACC ./makepp_variables.html register_parser_command_word_parser ./makepp_statements.html relative_to_file1_file2_file3_directory ./makepp_functions.html uniq ./makepplog.html include_directory ./makeppreplay.html input ./makepp_variables.html no_warn ./makeppreplay.html mode_mode ./makepp_builtins.html K ./makepplog.html leave_src_info ./makeppclean.html install_pl ./makepp_faq.html E ./makepp_builtins.html ln_option_sourcefile_destfile ./makepp_builtins.html dont_read_path ./makepp_sandboxes.html in_mtime_spec ./makepp_build_cache.html delimiter_string ./makepp_builtins.html xargs_command_arguments_suffix_length ./makepp_functions.html MAKEPP_VERSION ./makepp_variables.html output_filename ./makepplog.html build_check_method_method ./makepp_command.html $(input) ./makepp_tutorial.html s_list ./makepp_build_cache.html final_rules_only ./makepp_command.html chown ./makepp_builtins.html dump_makeppfile_filename ./makepp_command.html last_chance ./makepp_rules.html mktemp_prefixXXX ./makepp_functions.html b ./makeppgraph.html graphviz ./makeppgraph.html ignore_error ./makepp_rules.html c_compilation_md5 ./makepp_signatures.html MAKEINFO ./makepp_variables.html hybrid_recursion ./makepp_command.html tabulate ./makepplog.html no_print_directory ./makeppreplay.html cwd_number_name_separator ./makeppgraph.html f_findbin_relative_path_to_datadir_from_bindir ./makepp_faq.html text ./makeppgraph.html build_cache_path_to_build_cache ./makepp_statements.html numeric_sort ./makepp_builtins.html home ./makeppgraph.html no_path_executable_dependencies ./makepp_command.html ctime ./makepp_build_cache.html a_spec ./makepp_build_cache.html Unix_SMBFS_from_GNU_Linux ./makepp_compatibility.html NFS ./makepp_compatibility.html d_or_debug ./makepp_incompatibilities.html temporary_words ./makepp_functions.html VPATH ./makepp_variables.html b_directory ./makepp_command.html configure ./makepp_faq.html downwards ./makeppgraph.html log_file_filename ./makepplog.html p_perlcode ./makepp_build_cache.html rc_style_substitution ./makepp_tutorial.html o_owner ./makepp_builtins.html makepp_signature_C_flat ./makepp_variables.html k_list ./makepplog.html xHH_x_HHHH ./makepp_builtins.html rename_perlcode ./makeppgraph.html $MAKEFLAGS ./makepp_command.html basename_filenames ./makepp_functions.html makepp_build_cache_control_command ./makepp_build_cache.html $@ ./makepp_variables.html $(output) ./makepp_tutorial.html no_indent ./makepplog.html v ./makeppclean.html record_size_number ./makepp_builtins.html do_build_filename ./makepp_command.html $(inputs) ./makepp_tutorial.html fields_list ./makepp_builtins.html print_text ./makepp_functions.html blend_groups ./makepp_build_cache.html disk ./makepp_build_cache.html md5_check_bc ./makepp_command.html makepp_simple_concatenation ./makepp_variables.html perl_option_perlcode_filename ./makepp_builtins.html stop_on_race ./makepp_command.html long ./makepp_incompatibilities.html outfail ./makepp_builtins.html fmt ./makepp_builtins.html link ./makepp_builtins.html x2 ./makeppgraph.html Substitution_references ./makepp_tutorial.html simple_prefix_suffix ./makepp_builtins.html empty_directories ./makeppclean.html invert_match ./makepp_builtins.html ifeq_string1_string2 ./makepp_statements.html force ./makeppinfo.html r_number ./makepp_builtins.html l ./makeppclean.html cA ./makepp_builtins.html c_perlcode ./makepp_builtins.html NOEXPORT ./makepp_incompatibilities.html create_option_path_to_cache ./makepp_build_cache.html CXXFLAGS ./makepp_variables.html symbolic_link_check ./makepp_build_cache.html map_words_perlcode ./makepp_functions.html blend ./makepp_build_cache.html sort_option_filename ./makepp_builtins.html rm_stale ./makepp_command.html ln_option_sourcefile_destdir ./makepp_builtins.html mv_option_sourcefile_destfile ./makepp_builtins.html ifndef_VARIABLE ./makepp_statements.html relative_filename_file1_file2_file3_slash ./makepp_functions.html separator_string ./makepp_builtins.html e ./makepp_command.html makefile_Makefile ./makepp_command.html autoload_filename ./makepp_statements.html compare_perlcode ./makepp_builtins.html and_condition1_condition2_condition3 ./makepp_functions.html repository_directory ./makepp_statements.html sandbox_warn ./makepp_sandboxes.html file_Makefile ./makepp_command.html load_makefile_Makefile ./makepp_command.html mode_perms ./makepp_build_cache.html assume_old_filename ./makepp_command.html A_filename ./makeppreplay.html only_targets_filenames ./makepp_functions.html SVG ./makeppgraph.html traditional ./makepp_command.html MAKE ./makepp_variables.html AD_MD_CD ./makepp_build_cache.html info_text ./makepp_functions.html ifneq_string1_string2 ./makepp_statements.html follow ./makepplog.html $MAKEPPCLEANFLAGS ./makeppclean.html target_newer ./makepp_build_check.html s_perl_expression ./makeppreplay.html stem ./makepp_variables.html copies ./makepp_build_cache.html SCAN ./makepplog.html any_reference_e_g_1 ./makepp_scanning.html dump_makefile_filename ./makepp_command.html - ./makepp_rules.html hashref_hash ./makepp_builtins.html ARFLAGS ./makepp_variables.html hybrid_recursive_make ./makepp_command.html only_delimited ./makepp_builtins.html noescape ./makepp_builtins.html version ./makeppreplay.html repository_destdir_srcdir ./makepp_statements.html hybrid ./makepp_command.html g_group ./makepp_builtins.html decode_dates ./makeppinfo.html touch_option_filename ./makepp_builtins.html IGNORE ./makepp_incompatibilities.html change_time ./makepp_build_cache.html chgrp ./makepp_builtins.html env_VARIABLE ./makepp_rules.html = ./makepp_variables.html addsuffix_suffix_words ./makepp_functions.html findstring_find_in ./makepp_functions.html build_check_method ./makepp_command.html build_cache_links ./makeppclean.html copy ./makepp_builtins.html u ./makepplog.html filesubst_pattern_substitute_words ./makepp_functions.html only_generated_filenames ./makepp_functions.html I_directory ./makeppreplay.html parent ./makepp_builtins.html build_check_build_check_method ./makepp_statements.html m_perlcode ./makeppgraph.html C_directory ./makeppreplay.html vpath_pattern_directory ./makepp_statements.html CFLAGS ./makepp_variables.html MAKEPP_LN_CP ./makepp_variables.html MAKECMDGOALS ./makepp_variables.html root_directory ./makeppreplay.html current_working_directory ./makepplog.html synclines ./makepp_builtins.html * ./makepp_tutorial.html Variables_and_Functions ./makeppbuiltin.html global_assignment ./makepp_statements.html The_patsubst_function ./makepp_tutorial.html RULE ./makepplog.html mktemp_prefix ./makepp_functions.html no_remake_makefiles ./makepp_command.html quiet ./makeppinfo.html out_of_sandbox_filename ./makepp_command.html if_string_result_if_string_not_blank_result_if_string_blank ./makepp_functions.html DEFAULT ./makepp_incompatibilities.html do_read_filename ./makepp_command.html sort_list ./makepp_build_cache.html log_filename ./makepplog.html run_script_arguments ./makepp_extending.html Windows_CIFS_on_GNU_Linux ./makepp_compatibility.html Not_specifying_all_targets ./makepp_tutorial.html wordlist_firstindex_lastindex_words ./makepp_functions.html only_logs ./makeppclean.html d ./makeppinfo.html install_option_sourcefile_destdir ./makepp_builtins.html access_permissions_perms ./makepp_build_cache.html export_global_override_define ./makepp_statements.html only_comma_don_t_eat_space_around_commas_usual_for_non_filename ./makepp_extending.html install_directory_option_directory ./makepp_builtins.html list ./makepp_builtins.html load_makefile_some_directory_somewhere_Makefile ./makepp_statements.html Windows_Server_Share_on_Cygwin ./makepp_compatibility.html hours ./makepp_build_cache.html prebuild_targets ./makepp_functions.html no_builtin_rules ./makepp_command.html export_VAR ./makepp_statements.html build_cache_directory ./makepp_command.html newgrp_group ./makepp_build_cache.html $* ./makepp_variables.html templatepp ./makeppbuiltin.html find_first_upwards_file1_file2 ./makepp_functions.html no_log ./makeppreplay.html error_text ./makepp_functions.html pattern_pattern ./makepp_build_cache.html c2o ./makeppgraph.html makeppfile_Makeppfile ./makepp_command.html group_group ./makepp_builtins.html f_Makefile ./makepp_command.html html ./makeppgraph.html override_signature_method ./makepp_command.html logfile_filename ./makepp_builtins.html m_prefix_suffix_afterprefix_aftersuffix ./makepp_builtins.html m_spec ./makepp_build_cache.html suf ./makeppgraph.html new_file_filename ./makepp_command.html build_reasons ./makeppgraph.html C_suffix_regexp ./makepp_signatures.html access_time_spec ./makepp_build_cache.html suf_number ./makeppgraph.html inside_sandbox_path ./makepp_sandboxes.html size_spec ./makepp_build_cache.html foreach_var_list_text ./makepp_functions.html EL_ext_links ./makepp_build_cache.html upwards ./makeppgraph.html traverse ./makeppinfo.html multiline_prefix_suffix_afterprefix_aftersuffix ./makepp_builtins.html show_option_path_to_cache ./makepp_build_cache.html jobs_n ./makepp_command.html uninstall_option_filename ./makepp_builtins.html set_user_user ./makepp_build_cache.html notdir_filenames ./makepp_functions.html temporary ./makeppreplay.html t_perlcode ./makepp_builtins.html gullible ./makepp_command.html shared_object ./makepp_signatures.html LD ./makepp_variables.html export_MAKEPP_LN_CP_2 ./makepp_builtins.html t ./makeppreplay.html symlink_in_rep_as_file ./makepp_command.html perl_perlcode ./makepp_statements.html d_string ./makepp_builtins.html S_no_keep_going_or_stop ./makepp_incompatibilities.html cut_option_filename ./makepp_builtins.html LOAD ./makepplog.html I ./makepp_builtins.html only_meta ./makeppclean.html no_cache_scaninfos ./makepp_command.html call_variable_words ./makepp_functions.html assume_new_filename ./makepp_command.html REP ./makepplog.html mktemp ./makepp_functions.html INTERMEDIATE_SECONDARY_PRECIOUS ./makepp_incompatibilities.html keylist_list ./makepplog.html shell_shell_command ./makepp_functions.html plain ./makeppgraph.html AS ./makepp_variables.html CXX ./makepp_variables.html sandbox_warning ./makepp_sandboxes.html or_condition1_condition2_condition3 ./makepp_functions.html RM ./makepp_variables.html SILENT ./makepp_incompatibilities.html CURDIR ./makepp_variables.html n ./makeppreplay.html l_filename ./makepplog.html defer_include ./makepp_command.html atime_spec ./makepp_build_cache.html ROOT ./makepp_variables.html word_n_text ./makepp_functions.html $^ ./makepp_variables.html MAKEOVERRIDES ./makepp_incompatibilities.html symbolic ./makepp_builtins.html mppbcc_command ./makepp_build_cache.html showkey ./makepplog.html F77 ./makepp_variables.html exact_match ./makepp_build_check.html LIBTOOL ./makepp_variables.html characters_list ./makepp_builtins.html ifperl_perlcode ./makepp_statements.html xml_space ./makepp_signatures.html clean_option_path_to_cache ./makepp_build_cache.html matching ./makepp_builtins.html target ./makepp_variables.html infer_linker_file1_file2 ./makepp_functions.html g ./makeppgraph.html -? ./makeppreplay.html PWD ./makepp_variables.html l_or_load_average_or_max_load ./makepp_incompatibilities.html count ./makepp_builtins.html traditional_recursion ./makepp_command.html dry_run ./makeppreplay.html virtual_sandbox ./makepp_sandboxes.html $MAKEPP_CASE_SENSITIVE_FILENAMES ./makepp_command.html cp_option_sourcefile ./makepp_builtins.html args_file_filename ./makeppreplay.html LEX ./makepp_variables.html force_rescan ./makepp_command.html build_info ./makepp_build_cache.html resolve_symlink ./makepp_builtins.html SIZE ./makepp_build_cache.html dir_filenames ./makepp_functions.html ifmakeperl_perlcode ./makepp_statements.html resolve_symbolic_link ./makepp_builtins.html ctime_spec ./makepp_build_cache.html symlink_in_repository_as_file ./makepp_command.html files_with_matches ./makepp_builtins.html $MAKEPPFLAGS ./makepp_command.html makefile_path_to_Makefile ./makepp_faq.html BUILD ./makepplog.html SHELL ./makepp_variables.html $+ ./makepp_variables.html what_if_filename ./makepp_command.html profile ./makeppreplay.html stop_before_building ./makepp_command.html false ./makepp_builtins.html R_directory ./makepp_command.html keys_list ./makepplog.html grep_option_perlcode_filename ./makepp_builtins.html $MAKEPPGRAPHFLAGS ./makeppgraph.html dotty ./makeppgraph.html mv_option_sourcefile_destdir ./makepp_builtins.html makepp_percent_subdirs ./makepp_variables.html tail ./makepp_builtins.html revert_match ./makepp_builtins.html _MAKEPPFLAGS ./makepp_variables.html no_path_exe_dep ./makepp_command.html head ./makepp_builtins.html stop_race ./makepp_command.html incoming_modification_time_spec ./makepp_build_cache.html makepp_require_phony ./makepp_variables.html s ./makeppgraph.html find_upwards_filename ./makepp_functions.html m_mandir_path_to_man ./makepp_faq.html ? ./makepp_tutorial.html F_Makeppfile ./makepp_command.html dont_build_filename ./makepp_command.html SUFFIXES ./makepp_incompatibilities.html ;= ./makepp_variables.html inside_sandbox_directory ./makepp_command.html := ./makepp_variables.html Perl_Code ./makeppbuiltin.html p_or_print_data_base ./makepp_incompatibilities.html args ./makepp_extending.html c_list ./makepp_builtins.html V ./makeppreplay.html stats_option_path_to_cache ./makepp_build_cache.html perl_begin ./makepp_statements.html u_user ./makepp_build_cache.html @ ./makepp_rules.html usr ./makeppgraph.html sort_word1_word2_word3 ./makepp_functions.html i ./makepplog.html phony_words ./makepp_functions.html global_VAR ./makepp_statements.html dont_read_filename ./makepp_command.html AR ./makepp_variables.html template_pl ./makeppbuiltin.html because ./makeppgraph.html Pattern_dependencies_don_t_match_phony_targets ./makepp_incompatibilities.html signature_signature_method ./makepp_rules.html makeperl_perlcode ./makepp_statements.html current_working_directory_and_up_number ./makepplog.html directory_directory ./makeppreplay.html meta ./makeppclean.html sorted_inputs ./makepp_variables.html &= ./makepp_variables.html printf_option_format_argument ./makepp_builtins.html b_bindir_path_to_installation_bin ./makepp_faq.html changed_dependencies ./makepp_variables.html join_words1_words2 ./makepp_functions.html architecture_independent ./makepp_build_check.html module_module_arg ./makeppreplay.html output ./makepp_variables.html q ./makeppinfo.html EXPORT_ALL_VARIABLES ./makepp_incompatibilities.html vice_versa ./makepp_builtins.html MAKEFLAGS ./makepp_variables.html iftrue_expression ./makepp_statements.html dir_noslash_filename ./makepp_functions.html makepp ./makeppgraph.html symlinks ./makepp_build_cache.html p_format ./makepp_builtins.html out_of_sandbox_path ./makepp_sandboxes.html filter_patterns_words ./makepp_functions.html M_spec ./makepp_build_cache.html MEMBER ./makepp_build_cache.html d_datadir_path_to_installation_share_makepp ./makepp_faq.html define ./makepp_statements.html numeric ./makepp_builtins.html realpath_files ./makepp_functions.html mkdir_option_directory ./makepp_builtins.html dot ./makeppgraph.html o_filename ./makepplog.html md5_bc ./makepp_command.html signature_method_method ./makepp_command.html PERL ./makepp_variables.html warning_text ./makepp_functions.html include_makefile ./makepp_statements.html directory ./makepp_builtins.html rmdir ./makepp_builtins.html xml ./makepp_signatures.html remove_stale ./makepp_command.html just_print ./makeppreplay.html template_option_macro_definition_filename ./makepp_builtins.html m_mode ./makepp_builtins.html assignment ./makepp_builtins.html resolve_symbolic ./makepp_builtins.html Grappa ./makeppgraph.html $? ./makepp_variables.html origin_variable ./makepp_functions.html md5 ./makepp_signatures.html install_option_sourcefile_destfile ./makepp_builtins.html r ./makeppclean.html changed_inputs ./makepp_variables.html noecho ./makepp_rules.html do_build_path ./makepp_sandboxes.html cp_option_sourcefile_destfile ./makepp_builtins.html h ./makeppreplay.html Nest ./makepp_compatibility.html POSIX ./makepp_incompatibilities.html help ./makeppreplay.html != ./makepp_variables.html f ./makepplog.html silent ./makepp_command.html O ./makepp_builtins.html stop ./makepp_command.html stop_after_loading ./makepp_command.html in_sandbox_path ./makepp_sandboxes.html log_logfilename ./makeppreplay.html patsubst_pattern_substitute_words ./makepp_functions.html sub ./makepp_statements.html ln_option_sourcefile ./makepp_builtins.html makepp-2.0.98.3/pod/perl_performance.pod0000644000175000017500000002255311764731704020220 0ustar pfeifferpfeiffer=head1 NAME makepp_perl_performance -- How to make Perl faster =for vc $Id: perl_performance.pod,v 1.11 2012/06/09 20:36:20 pfeiffer Exp $ =head1 DESCRIPTION The biggest tuning gains will usually come from algorithmic improvements. But while these can be hard to find, there is also a lot you can do mechanically. Makepp is a big heavy-duty program, where speed is a must. A lot of effort has been put into optimizing it. This documents some general things we have found. Currently the concrete tests leading to these results have mostly been discarded, but I plan to gradually add them. If you are looking at how to speedup makepp (beyond the Perl code you put into your makefiles), look at L. This page is completely independent of makepp, only intended to make our results available to the Perl community. Some of these measures are common sence, but you sometimes forget them. Others need measuring to believe them, so: =head2 Measure, don't guess =over =item Profile your program Makepp comes with a module F in its cvs repository. This is first run as a program on a copy(!) of your code, which it instruments. Then you run your copy and get configurable statistics per interval and a final total on the most frequently called functions and on the most time spent in functions (minus subcalls). Both are provided absolutely and in caller-callee pairs. (Documentation within.) This tells you which functions are the most promising candidates for tuning. It also gives you a hint where your algorithm might be wrong, either within surprisingly expensive functions, or through surprisingly frequent calls. =item Time your solution Either one of perl -Mstrict -MBenchmark -we 'my ; timethis -10, sub { }' time perl -Mstrict -we 'my ; for( 0..999_999 ) { }' when run on different variants of code you can think of, can give surprising results. Even small modifications can matter a lot. Be careful not to "measure" code that can get optimized away, because you discard the result, or because it depends on constants. Depending on your system, this will tell you in kb how fat Perl got: perl -Mstrict -we '; system "ps -ovsz $$"' Below we only show the code within the C<-e> option as one liners. =back =head2 Regexps =over =item Use simple regexps Several matches combined with C<||> are faster than a big one with C<|>. =item Use precompiled regexps Instead of interpolating strings into regexps (except if the string will never change and you use the C modifier), precompile the regexp with C and interpolate that. =item Use (?:...) If you don't use what the grouping matches, don't make Perl save it with C<(...)>. =item Anchor at beginning of string Don't make Perl look through your whole string, if you want a match only at the beginning. =item Don't anchor at end after greedy If you have a C<*> or C<+> that will match till the end of string, don't put a C<$> after it. =item Use tr/// This is twice as fast as s/// when it is applicable. =back =head2 Functions =over =item Avoid object orientation Dynamic method lookup is slower in any language, and Perl, being loosely typed, can never do it at compile time. Don't use it, unless you need the benefit of polymorphism through inheritance. The following call methods are ordered from slowest to fastest: $o->method( ... ); # searched in class of $o and its @ISA Class::method( $o, ... ); # static function, new stack Class::method $o, ...; # static function, new stack, checked at compile time &Class::method; # static function, reuse stack This last form always possible if method (or normal function) takes no arguments. If it does take arguments, watch out that you don't inadvertently supply any optional ones! If you use this form a lot, it is best to keep track of the minimum and maximum number of arguments each function can take. Reusing a stack with extra arguments is no problem, they'll get ignored. =item Don't modify stack The following sin is frequently found even in the Perl doc: my $self = shift; Unless you have a pertinent reason for this, use this: my( $self, $x, $y, @z ) = @_; =item Use few functions and modules Every function (and that alas includes constants) takes up over 1kb for it's mere existence. With each module requiring other ones, most of which you never need, that can add up. Don't pull in a big module, just to replace two lines of Perl code with a single more elegant looking function call. If you have a function only called in one place, and the two combined would still be reasonably short, merge them with due comments. Don't have one function only call another with the same arguments. Alias it instead: *alias = \&function; =item Group calls to print Individual calls to print, or print with separate arguments are very expensive. Build up the string in memory and print it in one go. If you can accumulate over 3kb, syswrite is more efficient. perl -MBenchmark -we 'timethis -10, sub { print STDERR $_ for 1..5 }' 2>/dev/null perl -MBenchmark -we 'timethis -10, sub { print STDERR 1..5 }' 2>/dev/null perl -MBenchmark -we 'timethis -10, sub { my $str = ""; $str .= $_ for 1..5; print STDERR $str }' 2>/dev/null =back =head2 Miscellaneous =over =item Avoid hashes Perl becomes quite slow with many small hashes. If you don't need them, use something else. Object orientation works just as well on an array, except that the members can't be accessed by name. But you can use numeric constants to name the members. For the sake of comparability we use plain numeric keys here: my $i = 0; our %a = map +($i++, $_), "a".."j"; timethis -10, sub { $b = $a{int rand 10} } our @a = "a".."j"; timethis -10, sub { $b = $a[rand 10] } my $i = 0; my %a = map +($i++, $_), "a".."j"; timethis -10, sub { $b = $a{int rand 10} } my @a = "a".."j"; timethis -10, sub { $b = $a[rand 10] } =item Use int keys for ref sets When you need a unique reference representation, e.g. for set ops with hashes, using the integer form of refs is three times as fast as using the pretty printed default string representation. Caveat: the HP/UX 64bitall variant of Perl, at least up to 5.8.8 has a buggy C function, where this doesn't work reliably. There a hex form is still a fair bit faster than default strings. Actually this can even be faster than stringified int, depending on the version or maybe configuration of perl. As of 5.8.1 there is also the equivalent but hopefully reliable Scalar::Util::refaddr my @list = map { bless { $_ => 1 }, "someclass" } 0..9; my( %a, %b ); timethis -10, sub { $a{$_} = 1 for @list }; timethis -10, sub { $b{int()} = 1 for @list }; timethis -10, sub { $b{sprintf '%x', $_} = 1 for @list }; timethis -10, sub { $b{refaddr $_} = 1 for @list }; There is also sprintf '%p' which supposedly outputs a pointer, but depending on which expression leads to the same ref, you get different values, so it's useless. =item Beware of strings Perl is awful for always copying strings around, even if you're never going to modify them. This wastes CPU and memory. Try to avoid that wherever reasonably possible. If the string is a function parameter and the function has a modest length, don't copy the string into a C variable, access it with C<$_[0]> and document the function well. Elsewhere, the aliasing feature of C can help. Or just use references to strings, which are fast to copy. If you somehow ensure that same strings get stored only once, you can do numerical comparison for equality. =item Avoid bit operations If you have disjoint bit patterns you can add them instead of or`ing them. Shifting can be performed my multiplication or integer division. Retaining only the lowest bits can be achieved with modulo. Separate boolean hash members are faster than stuffing everything into an integer with bit operations or into a string with C. =item Use order of boolean operations If you only care whether an expression is true or false, check the cheap things, like boolean variables, first, and call functions last. =item Use undef instead of 0 It takes up a few percent less memory, at least as hash or list values. You can still query it as a boolean. my %x; $x{$_} = 0 for 0..999_999; system "ps -ovsz $$" my %x; undef $x{$_} for 0..999_999; system "ps -ovsz $$" my @x = (0) x 999_999; system "ps -ovsz $$" my @x = (undef) x 999_999; system "ps -ovsz $$" =item Choose for or map These are definitely not equivalent. Depending on your use (i.e. the list and the complexity of your code), one or the other may be faster. my @l = 0..99; for( 0..99_999 ) { map $a = " $_ ", @l } for( 0..99_999 ) { map $a = " $_ ", 0..99 } for( 0..99_999 ) { $a = " $_ " for @l } for( 0..99_999 ) { $a = " $_ " for 0..99 } =item Don't alias $_ While it is convenient, it is rather expensive, even copying reasonable strings is faster. The last example is twice as fast as the first "for". my $x = "abcdefg"; my $b = 0; for( "$x" ) { $b = 1 - $b if /g/ } # Copy needed only if modifying. for( $x ) { $b = 1 - $b if /g/ } local *_ = \$x; $b = 1 - $b if /g/; local $_ = $x; $b = 1 - $b if /g/; # Copy cheaper than alias. my $y = $x; $b = 1 - $b if $y =~ /g/; =back =head1 AUTHOR Daniel Pfeiffer makepp-2.0.98.3/pod/makeppreplay.pod0000644000175000017500000001660212067152515017357 0ustar pfeifferpfeiffer=head1 NAME makeppreplay -- Fast repeater of selected makepp actions =for vc $Id: makeppreplay.pod,v 1.11 2012/12/27 23:10:05 pfeiffer Exp $ =head1 DESCRIPTION =for genindex '[-$][-?\w]+' makeppreplay.pod BEL<-?|/_>,E BEL<-A|/a_filename>, L<--args-file|/a_filename>, L<--arguments-file|/a_filename>,E BEL<-C|/c_directory>, L<-c|/c>,E BEL<--directory|/c_directory>, L<--dry-run|/n>,E BEL<-h|/_>, L<--help|/_>,E BEL<-I|/i_directory>, L<--include|/i_directory>, L<--include-dir|/i_directory>,E BEL<--just-print|/n>,E BEL<-k|/k>, L<--keep-going|/k>,E BEL<--log|/log_logfilename>, L<--log-file|/log_logfilename>,E BEL<-M|/m_module_arg>, L<$MAKEPPREPLAYFLAGS|/_makeppreplayflags>, L<--module|/m_module_arg>,E BEL<-n|/n>, L<--no-log|/no_log>, L<--no-print-directory|/no_print_directory>, L<--no-warn|/no_warn>,E BEL<--profile|/profile>,E BEL<--recon|/n>, L<--root-dir|/c>, L<--root-directory|/c>,E BEL<-s|/s_perl_expression>, L<--sed|/s_perl_expression>,E BEL<-t|/t>, L<--temporary|/t>,E BEL<-V|/v>, L<--version|/v> B S<[ I