test/automated/Makefile.in remove stuff unnecessarily copied from lisp
[bpt/emacs.git] / 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 abs_srcdir = @abs_srcdir@
24 abs_top_builddir = @abs_top_builddir@
25 VPATH = $(srcdir)
26
27 # You can specify a different executable on the make command line,
28 # e.g. "make EMACS=../src/emacs ...".
29
30 # We sometimes change directory before running Emacs (typically when
31 # building out-of-tree, we chdir to the source directory), so we need
32 # to use an absolute file name.
33 EMACS = ${abs_top_builddir}/src/emacs
34
35 # Command line flags for Emacs.
36 EMACSOPT = -batch --no-site-file --no-site-lisp
37
38 # Extra flags to pass to the byte compiler.
39 BYTE_COMPILE_EXTRA_FLAGS =
40
41 # The actual Emacs command run in the targets below.
42 emacs = EMACSLOADPATH="$(abs_srcdir)/../../lisp:$(abs_srcdir)" LC_ALL=C "$(EMACS)" $(EMACSOPT)
43
44 # Common command to find subdirectories
45 setwins=subdirs=`find . -type d -print`; \
46 for file in $$subdirs; do \
47 case $$file in */.* | */.*/* | */=* | ./data* ) ;; \
48 *) wins="$$wins$${wins:+ }$$file" ;; \
49 esac; \
50 done
51
52 .PHONY: all check
53
54 all: check
55
56 # The compilation stuff is copied from lisp/Makefile - see comments there.
57
58 .SUFFIXES: .elc .el
59
60 .el.elc:
61 @echo Compiling $<
62 @$(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $<
63
64
65 .PHONY: lisp-compile compile-targets compile-main compile-clean
66
67 lisp-compile:
68 cd ../../lisp && $(MAKE) $(MFLAGS) compile EMACS="$(EMACS)"
69
70 # TARGETS is set dynamically in the recursive call from `compile-main'.
71 compile-targets: $(TARGETS)
72
73 # Compile all the Elisp files that need it. Beware: it approximates
74 # `no-byte-compile', so watch out for false-positives!
75 compile-main: compile-clean lisp-compile
76 @(cd $(srcdir) && $(setwins); \
77 els=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \
78 for el in $$els; do \
79 test -f $$el || continue; \
80 test ! -f $${el}c && GREP_OPTIONS= grep '^;.*no-byte-compile: t' $$el > /dev/null && continue; \
81 echo "$${el}c"; \
82 done | xargs echo) | \
83 while read chunk; do \
84 $(MAKE) $(MFLAGS) compile-targets EMACS="$(EMACS)" TARGETS="$$chunk"; \
85 done
86
87 # Erase left-over .elc files that do not have a corresponding .el file.
88 compile-clean:
89 @cd $(srcdir) && $(setwins); \
90 elcs=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.elc |g'`; \
91 for el in $$(echo $$elcs | sed -e 's/\.elc/\.el/g'); do \
92 if test -f "$$el" -o \! -f "$${el}c"; then :; else \
93 echo rm "$${el}c"; \
94 rm "$${el}c"; \
95 fi \
96 done
97
98
99 .PHONY: bootstrap-clean distclean maintainer-clean
100
101 bootstrap-clean:
102 -cd $(srcdir) && rm -f *.elc */*.elc */*/*.elc */*/*/*.elc
103
104 distclean:
105 rm -f Makefile
106
107 maintainer-clean: distclean bootstrap-clean
108
109
110 check: compile-main
111 @(cd $(srcdir) && $(setwins); \
112 pattern=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \
113 for el in $$pattern; do \
114 test -f $$el || continue; \
115 args="$$args -l $$el"; \
116 els="$$els $$el"; \
117 done; \
118 echo Testing $$els; \
119 $(emacs) $$args -f ert-run-tests-batch-and-exit)
120
121 # Makefile ends here.