makepp-2.0.98.3/ 0000755 0001750 0001750 00000000000 12115460733 013370 5 ustar pfeiffer pfeiffer makepp-2.0.98.3/t/ 0000755 0001750 0001750 00000000000 12115460733 013633 5 ustar pfeiffer pfeiffer makepp-2.0.98.3/t/wildcard_repository.test 0000644 0001750 0001750 00000005347 12002461416 020627 0 ustar pfeiffer pfeiffer ### 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.pl 0000644 0001750 0001750 00000002642 11144124453 017220 0 ustar pfeiffer pfeiffer # 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.test 0000644 0001750 0001750 00000002057 11714051522 016203 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000002070 11440263613 020547 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000031066 11721213707 020412 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000004131 10674045032 017665 0 ustar pfeiffer pfeiffer ### 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/ 0000755 0001750 0001750 00000000000 12115460733 016400 5 ustar pfeiffer pfeiffer makepp-2.0.98.3/t/stress_tests/build_cache_concurrent.test 0000644 0001750 0001750 00000010242 12047172050 023760 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000001735 10674045032 017565 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000001250 10674045032 020374 0 ustar pfeiffer pfeiffer ### 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/spar 0000755 0001750 0001750 00000030762 11714051522 014532 0 ustar pfeiffer pfeiffer #! /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.test 0000644 0001750 0001750 00000001152 10674045032 016533 0 ustar pfeiffer pfeiffer ### 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.pl 0000755 0001750 0001750 00000057320 12107132064 016222 0 ustar pfeiffer pfeiffer #!/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.t 0000755 0001750 0001750 00000007657 12107012037 015465 0 ustar pfeiffer pfeiffer #!/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.test 0000644 0001750 0001750 00000004217 11753741324 017217 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000002537 11144124453 016757 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000003302 11514621761 020452 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000000764 10674045031 017762 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000004305 11505120162 017531 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000004110 12002471673 015472 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000007013 10674045031 017237 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000004215 11011262642 016323 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000003231 10674045031 017243 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000010104 12067357153 015224 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000010011 12016413572 017216 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000001625 11500522551 017304 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000002671 12111364465 015514 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000142036 12016712620 016477 0 ustar pfeiffer pfeiffer ### 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
### 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.test 0000644 0001750 0001750 00000002572 10674045030 017313 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000003304 11715724623 017006 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000002723 12067151157 016166 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000003456 10674045030 017352 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000001320 10674045030 020356 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000003411 12000307537 015472 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000006644 12041175702 017726 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000001446 11144656675 017072 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000014006 11001221432 017203 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000002331 12000307540 017513 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000002010 12000311123 017322 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000032663 11757513750 016410 0 ustar pfeiffer pfeiffer ### 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 bb cc dd ee
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.test 0000644 0001750 0001750 00000014144 12000307541 016750 0 ustar pfeiffer pfeiffer ### 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/ 0000755 0001750 0001750 00000000000 12115460733 017165 5 ustar pfeiffer pfeiffer makepp-2.0.98.3/t/additional_tests/xml.test 0000644 0001750 0001750 00000002516 12003073623 020664 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000020474 11045674123 022106 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000001066 10674045033 022535 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000001553 11715735765 024441 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000003517 12003073105 023030 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000003252 12073103766 023020 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000000767 10662424312 024216 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000001370 11016104513 025244 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000002155 11144402767 023166 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000000626 12003072465 023476 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000001024 10674045033 025056 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000002011 12000311115 026445 0 ustar pfeiffer pfeiffer ### 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.test 0000755 0001750 0001750 00000003152 12003072007 023455 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000003460 11144124454 024610 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000000605 11144402767 024040 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000013177 11754004066 024224 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000003366 11144402767 026235 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000002006 11144124454 025233 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000001533 11144124454 024735 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000001500 11144124454 025272 0 ustar pfeiffer pfeiffer ### 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.test 0000644 0001750 0001750 00000002725 12002500145 024241 0 ustar pfeiffer pfeiffer ### 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+