diff options
| author | Philipp Stephani | 2017-06-13 20:46:03 +0200 |
|---|---|---|
| committer | Philipp Stephani | 2017-06-13 20:48:15 +0200 |
| commit | 58b9b098a4cbefbe7ae28079a96625bd450c9316 (patch) | |
| tree | 06a75c54ff53a0f01e543aa58828496eda517859 /test | |
| parent | a63aeb64b70ba20cd1611bf97e435dd43a1c93f7 (diff) | |
| download | emacs-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.in | 34 | ||||
| -rw-r--r-- | test/data/emacs-module/Makefile.in | 59 |
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 | ||
| 36 | FIND_DELETE = @FIND_DELETE@ | 36 | FIND_DELETE = @FIND_DELETE@ |
| 37 | MKDIR_P = @MKDIR_P@ | 37 | MKDIR_P = @MKDIR_P@ |
| 38 | CC = @CC@ | ||
| 39 | CFLAGS = @CFLAGS@ | ||
| 40 | PROFILING_CFLAGS = @PROFILING_CFLAGS@ | ||
| 41 | WARN_CFLAGS = @WARN_CFLAGS@ | ||
| 42 | WERROR_CFLAGS = @WERROR_CFLAGS@ | ||
| 43 | CPPFLAGS = @CPPFLAGS@ | ||
| 44 | SO = @MODULES_SUFFIX@ | ||
| 38 | 45 | ||
| 39 | SEPCHAR = @SEPCHAR@ | 46 | SEPCHAR = @SEPCHAR@ |
| 40 | 47 | ||
| @@ -42,6 +49,11 @@ SEPCHAR = @SEPCHAR@ | |||
| 42 | # 'make' verbosity. | 49 | # 'make' verbosity. |
| 43 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ | 50 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ |
| 44 | 51 | ||
| 52 | AM_V_CCLD = $(am__v_CCLD_@AM_V@) | ||
| 53 | am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) | ||
| 54 | am__v_CCLD_0 = @echo " CCLD " $@; | ||
| 55 | am__v_CCLD_1 = | ||
| 56 | |||
| 45 | AM_V_ELC = $(am__v_ELC_@AM_V@) | 57 | AM_V_ELC = $(am__v_ELC_@AM_V@) |
| 46 | am__v_ELC_ = $(am__v_ELC_@AM_DEFAULT_V@) | 58 | am__v_ELC_ = $(am__v_ELC_@AM_DEFAULT_V@) |
| 47 | am__v_ELC_0 = @echo " ELC " $@; | 59 | am__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 | ||
| 106 | test_module_dir := $(srcdir)/data/emacs-module | ||
| 107 | |||
| 94 | .PHONY: all check | 108 | .PHONY: all check |
| 95 | 109 | ||
| 96 | all: check | 110 | all: 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 | ||
| 180 | ifeq (@HAVE_MODULES@, yes) | 194 | ifeq (@HAVE_MODULES@, yes) |
| 181 | test_module_dir := $(srcdir)/data/emacs-module | 195 | # -fPIC is a no-op on Windows, but causes a compiler warning |
| 196 | ifeq ($(SO),.dll) | ||
| 197 | FPIC_CFLAGS = | ||
| 198 | else | ||
| 199 | FPIC_CFLAGS = -fPIC | ||
| 200 | endif | ||
| 201 | |||
| 202 | MODULE_CFLAGS = -I$(srcdir)/../src $(FPIC_CFLAGS) $(PROFILING_CFLAGS) \ | ||
| 203 | $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAGS) | ||
| 204 | |||
| 182 | test_module_name := mod-test@MODULES_SUFFIX@ | 205 | test_module_name := mod-test@MODULES_SUFFIX@ |
| 183 | test_module := $(test_module_dir)/$(test_module_name) | 206 | test_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 $@ $< | ||
| 187 | endif | 211 | endif |
| 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 | ||
| 223 | clean: | 247 | clean: |
| 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 | ||
| 226 | bootstrap-clean: clean | 252 | bootstrap-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 | |||
| 22 | SHELL = @SHELL@ | ||
| 23 | |||
| 24 | top_srcdir = @top_srcdir@ | ||
| 25 | VPATH = $(srcdir) | ||
| 26 | CC = @CC@ | ||
| 27 | CFLAGS = @CFLAGS@ | ||
| 28 | PROFILING_CFLAGS = @PROFILING_CFLAGS@ | ||
| 29 | WARN_CFLAGS = @WARN_CFLAGS@ | ||
| 30 | WERROR_CFLAGS = @WERROR_CFLAGS@ | ||
| 31 | CPPFLAGS = @CPPFLAGS@ | ||
| 32 | SO = @MODULES_SUFFIX@ | ||
| 33 | |||
| 34 | # -fPIC is a no-op on Windows, but causes a compiler warning | ||
| 35 | ifeq ($(SO),.dll) | ||
| 36 | FPIC_CFLAGS = | ||
| 37 | else | ||
| 38 | FPIC_CFLAGS = -fPIC | ||
| 39 | endif | ||
| 40 | |||
| 41 | ALL_CFLAGS = -I$(top_srcdir)/src $(FPIC_CFLAGS) $(PROFILING_CFLAGS) \ | ||
| 42 | $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAGS) | ||
| 43 | |||
| 44 | all: 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 | |||
| 57 | clean: | ||
| 58 | rm -f *.o *.so *.dll | ||
| 59 | |||