Debian Codegraph @

examples/Makefile.template

raw
1 # $Id: Makefile.template 2156 2008-01-25 13:25:12Z schimans $
2 # The generic part of all the test Makefiles, based on ideas of
3 # Robert Staerk
4 # but calling structure heavily modified
5
6
7 # The init file for Minlog:
8 MINLOGSRC = $(TOP)/init.scm
9
10 # How should Minlog be called?
11 SCHEME ?= petite
12 MINLOG = $(SCHEME) -- $(MINLOGSRC)
13
14
15 # theoretically it would also depend on %.save, but make allows only
16 # one % in the dependency file; so I assume that %.scm is more important
17 .%.test-passed: %.scm $(TOP)/init.scm
18 cat $*.scm | $(MINLOG) | sed "1d;2d" > $*.out
19 cat $*.out | sed "s/[0-9]//g" > $*.out.nodigits
20 cat $*.save | sed "s/[0-9]//g" > $*.save.nodigits
21 if diff -u $*.out.nodigits $*.save.nodigits > $*.diff; then \
22 rm $*.out.nodigits $*.save.nodigits $*.out $*.diff; \
23 touch .$*.test-passed; echo '$* is OK'; else \
24 if [ -n "$(FIXTEST)" ]; then \
25 cat $*.diff; \
26 echo -n "Accept new output for `pwd`/$*.scm? [n|y] "; \
27 read input; \
28 if [ "$$input" = "y" -o "$$input" = "yes" ]; then \
29 cp $*.out $*.save; \
30 fi; \
31 else \
32 cat $(TOP)/examples/warning.txt; echo "$*"; echo " ";pwd; echo " "; \
33 cat $*.diff; \
34 false;\
35 fi; \
36 fi
37 # If failing we do not touch the .test-passed file to make sure a new call to
38 # make test processes this target again. Then we signal that we haven't
39 # been successful by false.
40
41 $(TOP)/init.scm:
42 (cd $(TOP); make init.scm)
43
44 genericclean:
45 rm -f *~ core *.diff *.out .TEST *.nodigits .*.test-passed
46
47 .always:
48
49
50 #Local Variables:
51 #mode: makefile
52 #End: