aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPhilipp Stephani2017-06-13 20:46:03 +0200
committerPhilipp Stephani2017-06-13 20:48:15 +0200
commit58b9b098a4cbefbe7ae28079a96625bd450c9316 (patch)
tree06a75c54ff53a0f01e543aa58828496eda517859 /test
parenta63aeb64b70ba20cd1611bf97e435dd43a1c93f7 (diff)
downloademacs-58b9b098a4cbefbe7ae28079a96625bd450c9316.tar.gz
emacs-58b9b098a4cbefbe7ae28079a96625bd450c9316.zip
Inline test module Makefile into main test Makefile
The test/data/emacs-module/Makefile only built a single target, and inlining it into test/Makefile simplifies dependency tracking and reduces code duplication. * configure.ac: Don't build test/data/emacs-module/Makefile. * Makefile.in ($(test_module)): Inline compilation. (clean): Also clean test module outputs.
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.in34
-rw-r--r--test/data/emacs-module/Makefile.in59
2 files changed, 30 insertions, 63 deletions
diff --git a/test/Makefile.in b/test/Makefile.in
index 13c0ac13f21..4998338b920 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -35,6 +35,13 @@ VPATH = $(srcdir)
35 35
36FIND_DELETE = @FIND_DELETE@ 36FIND_DELETE = @FIND_DELETE@
37MKDIR_P = @MKDIR_P@ 37MKDIR_P = @MKDIR_P@
38CC = @CC@
39CFLAGS = @CFLAGS@
40PROFILING_CFLAGS = @PROFILING_CFLAGS@
41WARN_CFLAGS = @WARN_CFLAGS@
42WERROR_CFLAGS = @WERROR_CFLAGS@
43CPPFLAGS = @CPPFLAGS@
44SO = @MODULES_SUFFIX@
38 45
39SEPCHAR = @SEPCHAR@ 46SEPCHAR = @SEPCHAR@
40 47
@@ -42,6 +49,11 @@ SEPCHAR = @SEPCHAR@
42# 'make' verbosity. 49# 'make' verbosity.
43AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ 50AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
44 51
52AM_V_CCLD = $(am__v_CCLD_@AM_V@)
53am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
54am__v_CCLD_0 = @echo " CCLD " $@;
55am__v_CCLD_1 =
56
45AM_V_ELC = $(am__v_ELC_@AM_V@) 57AM_V_ELC = $(am__v_ELC_@AM_V@)
46am__v_ELC_ = $(am__v_ELC_@AM_DEFAULT_V@) 58am__v_ELC_ = $(am__v_ELC_@AM_DEFAULT_V@)
47am__v_ELC_0 = @echo " ELC " $@; 59am__v_ELC_0 = @echo " ELC " $@;
@@ -91,6 +103,8 @@ emacs = EMACSLOADPATH= LC_ALL=$(TEST_LOCALE) \
91 EMACS_TEST_DIRECTORY=$(abspath $(srcdir)) \ 103 EMACS_TEST_DIRECTORY=$(abspath $(srcdir)) \
92 $(GDB) "$(EMACS)" $(EMACSOPT) 104 $(GDB) "$(EMACS)" $(EMACSOPT)
93 105
106test_module_dir := $(srcdir)/data/emacs-module
107
94.PHONY: all check 108.PHONY: all check
95 109
96all: check 110all: check
@@ -151,7 +165,7 @@ TESTS := $(LOGFILES:.log=)
151.PRECIOUS: %.log 165.PRECIOUS: %.log
152 166
153## Stop make deleting these as intermediate files. 167## Stop make deleting these as intermediate files.
154.SECONDARY: ${ELFILES:.el=.elc} 168.SECONDARY: ${ELFILES:.el=.elc} $(test_module_dir)/*.o
155 169
156.PHONY: ${TESTS} 170.PHONY: ${TESTS}
157 171
@@ -178,12 +192,22 @@ endef
178$(foreach test,${TESTS},$(eval $(call test_template,${test}))) 192$(foreach test,${TESTS},$(eval $(call test_template,${test})))
179 193
180ifeq (@HAVE_MODULES@, yes) 194ifeq (@HAVE_MODULES@, yes)
181test_module_dir := $(srcdir)/data/emacs-module 195# -fPIC is a no-op on Windows, but causes a compiler warning
196ifeq ($(SO),.dll)
197FPIC_CFLAGS =
198else
199FPIC_CFLAGS = -fPIC
200endif
201
202MODULE_CFLAGS = -I$(srcdir)/../src $(FPIC_CFLAGS) $(PROFILING_CFLAGS) \
203 $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAGS)
204
182test_module_name := mod-test@MODULES_SUFFIX@ 205test_module_name := mod-test@MODULES_SUFFIX@
183test_module := $(test_module_dir)/$(test_module_name) 206test_module := $(test_module_dir)/$(test_module_name)
184$(srcdir)/src/emacs-module-tests.log: $(test_module) 207$(srcdir)/src/emacs-module-tests.log: $(test_module)
185$(test_module): $(srcdir)/../src/emacs-module.[ch] $(test_module_dir)/mod-test.c 208$(test_module): $(test_module_dir)/mod-test.c $(srcdir)/../src/emacs-module.h
186 $(MAKE) -C $(test_module_dir) $(test_module_name) 209 $(AM_V_CCLD)$(CC) -shared $(CPPFLAGS) $(MODULE_CFLAGS) $(LDFLAGS) \
210 -o $@ $<
187endif 211endif
188 212
189## Check that there is no 'automated' subdirectory, which would 213## Check that there is no 'automated' subdirectory, which would
@@ -222,6 +246,8 @@ mostlyclean:
222 246
223clean: 247clean:
224 find . '(' -name '*.log' -o -name '*.log~' ')' $(FIND_DELETE) 248 find . '(' -name '*.log' -o -name '*.log~' ')' $(FIND_DELETE)
249 rm -f $(test_module_dir)/*.o $(test_module_dir)/*.so \
250 $(test_module_dir)/*.dll
225 251
226bootstrap-clean: clean 252bootstrap-clean: clean
227 find $(srcdir) -name '*.elc' $(FIND_DELETE) 253 find $(srcdir) -name '*.elc' $(FIND_DELETE)
diff --git a/test/data/emacs-module/Makefile.in b/test/data/emacs-module/Makefile.in
deleted file mode 100644
index 2af6473c7a6..00000000000
--- a/test/data/emacs-module/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
1### @configure_input@
2
3# Test GNU Emacs modules.
4
5# Copyright 2015-2017 Free Software Foundation, Inc.
6
7# This file is part of GNU Emacs.
8
9# GNU Emacs is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version.
13
14# GNU Emacs is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18
19# You should have received a copy of the GNU General Public License
20# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22SHELL = @SHELL@
23
24top_srcdir = @top_srcdir@
25VPATH = $(srcdir)
26CC = @CC@
27CFLAGS = @CFLAGS@
28PROFILING_CFLAGS = @PROFILING_CFLAGS@
29WARN_CFLAGS = @WARN_CFLAGS@
30WERROR_CFLAGS = @WERROR_CFLAGS@
31CPPFLAGS = @CPPFLAGS@
32SO = @MODULES_SUFFIX@
33
34# -fPIC is a no-op on Windows, but causes a compiler warning
35ifeq ($(SO),.dll)
36FPIC_CFLAGS =
37else
38FPIC_CFLAGS = -fPIC
39endif
40
41ALL_CFLAGS = -I$(top_srcdir)/src $(FPIC_CFLAGS) $(PROFILING_CFLAGS) \
42 $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAGS)
43
44all: mod-test$(SO)
45
46%$(SO): %.o
47 $(CC) -shared $(LDFLAGS) -o $@ $<
48
49%.o: %.c $(top_srcdir)/src/emacs-module.h
50 $(CC) $(CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
51
52## Stop .o files being deleted.
53.SECONDARY:
54
55.PHONY: clean
56
57clean:
58 rm -f *.o *.so *.dll
59