]> code.delx.au - gnu-emacs/blob - test/automated/Makefile.in
* test/automated/Makefile.in: Tweak previous change
[gnu-emacs] / test / automated / Makefile.in
1 ### @configure_input@
2
3 # Copyright (C) 2010-2013 Free Software Foundation, Inc.
4
5 # This file is part of GNU Emacs.
6
7 # GNU Emacs is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11
12 # GNU Emacs is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16
17 # You should have received a copy of the GNU General Public License
18 # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
19
20 SHELL = @SHELL@
21
22 srcdir = @srcdir@
23 VPATH = $(srcdir)
24
25 PATH_SEPARATOR = @PATH_SEPARATOR@
26
27 # Empty for all systems except MinGW, where xargs needs an explicit
28 # limitation.
29 XARGS_LIMIT = @XARGS_LIMIT@
30
31 # We never change directory before running Emacs, so a relative file
32 # name is fine, and makes life easier. If we need to change
33 # directory, we can use emacs --chdir.
34 EMACS = ../../src/emacs
35
36 # Command line flags for Emacs.
37 # Apparently MSYS bash would convert "-L :" to "-L ;" anyway,
38 # but we might as well be explicit.
39 EMACSOPT = -batch --no-site-file --no-site-lisp -L "$(PATH_SEPARATOR)$(srcdir)"
40
41 # Extra flags to pass to the byte compiler.
42 BYTE_COMPILE_EXTRA_FLAGS =
43
44 # The actual Emacs command run in the targets below.
45 # Prevent any setting of EMACSLOADPATH in user environment causing problems.
46 emacs = unset EMACSLOADPATH; \
47 LC_ALL=C EMACS_TEST_DIRECTORY=$(srcdir) "$(EMACS)" $(EMACSOPT)
48
49 # Common command to find subdirectories
50 setwins=for file in `find $(srcdir) -type d -print`; do \
51 case $$file in $(srcdir)*/data* | $(srcdir)*/flymake* ) ;; \
52 *) wins="$$wins$${wins:+ }$$file" ;; \
53 esac; \
54 done
55
56 .PHONY: all check
57
58 all: check
59
60 # The compilation stuff is copied from lisp/Makefile - see comments there.
61
62 .SUFFIXES: .elc .el
63
64 .el.elc:
65 @echo Compiling $<
66 @$(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $<
67
68
69 .PHONY: compile-targets compile-main compile-clean
70
71 # TARGETS is set dynamically in the recursive call from `compile-main'.
72 compile-targets: $(TARGETS)
73
74 # Compile all the Elisp files that need it. Beware: it approximates
75 # `no-byte-compile', so watch out for false-positives!
76 compile-main: compile-clean
77 @$(setwins); \
78 els=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \
79 for el in $$els; do \
80 test -f $$el || continue; \
81 test ! -f $${el}c && GREP_OPTIONS= grep '^;.*no-byte-compile: t' $$el > /dev/null && continue; \
82 echo "$${el}c"; \
83 done | xargs $(XARGS_LIMIT) echo | \
84 while read chunk; do \
85 $(MAKE) $(MFLAGS) compile-targets EMACS="$(EMACS)" TARGETS="$$chunk"; \
86 done
87
88 # Erase left-over .elc files that do not have a corresponding .el file.
89 compile-clean:
90 @$(setwins); \
91 elcs=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.elc |g'`; \
92 for el in $$(echo $$elcs | sed -e 's/\.elc/\.el/g'); do \
93 if test -f "$$el" -o \! -f "$${el}c"; then :; else \
94 echo rm "$${el}c"; \
95 rm "$${el}c"; \
96 fi \
97 done
98
99
100 .PHONY: bootstrap-clean distclean maintainer-clean
101
102 bootstrap-clean:
103 -cd $(srcdir) && rm -f *.elc */*.elc */*/*.elc */*/*/*.elc
104
105 distclean:
106 rm -f Makefile
107
108 maintainer-clean: distclean bootstrap-clean
109
110
111 check: compile-main
112 @$(setwins); \
113 pattern=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \
114 for el in $$pattern; do \
115 test -f $$el || continue; \
116 args="$$args -l $$el"; \
117 els="$$els $$el"; \
118 done; \
119 echo Testing $$els; \
120 $(emacs) $$args -f ert-run-tests-batch-and-exit
121
122 # Makefile ends here.