opt_makefile=test/Makefile
if test -f "$srcdir/$opt_makefile.in"; then
- SUBDIR_MAKEFILES="$SUBDIR_MAKEFILES $opt_makefile test/data/emacs-module/Makefile"
+ SUBDIR_MAKEFILES="$SUBDIR_MAKEFILES $opt_makefile"
dnl Again, it's best not to use a variable. Though you can add
dnl ", [], [opt_makefile='$opt_makefile']" and it should work.
- AC_CONFIG_FILES([test/Makefile test/data/emacs-module/Makefile])
+ AC_CONFIG_FILES([test/Makefile])
fi
FIND_DELETE = @FIND_DELETE@
MKDIR_P = @MKDIR_P@
+CC = @CC@
+CFLAGS = @CFLAGS@
+PROFILING_CFLAGS = @PROFILING_CFLAGS@
+WARN_CFLAGS = @WARN_CFLAGS@
+WERROR_CFLAGS = @WERROR_CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+SO = @MODULES_SUFFIX@
SEPCHAR = @SEPCHAR@
# 'make' verbosity.
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+
AM_V_ELC = $(am__v_ELC_@AM_V@)
am__v_ELC_ = $(am__v_ELC_@AM_DEFAULT_V@)
am__v_ELC_0 = @echo " ELC " $@;
EMACS_TEST_DIRECTORY=$(abspath $(srcdir)) \
$(GDB) "$(EMACS)" $(EMACSOPT)
+test_module_dir := $(srcdir)/data/emacs-module
+
.PHONY: all check
all: check
.PRECIOUS: %.log
## Stop make deleting these as intermediate files.
-.SECONDARY: ${ELFILES:.el=.elc}
+.SECONDARY: ${ELFILES:.el=.elc} $(test_module_dir)/*.o
.PHONY: ${TESTS}
$(foreach test,${TESTS},$(eval $(call test_template,${test})))
ifeq (@HAVE_MODULES@, yes)
-test_module_dir := $(srcdir)/data/emacs-module
+# -fPIC is a no-op on Windows, but causes a compiler warning
+ifeq ($(SO),.dll)
+FPIC_CFLAGS =
+else
+FPIC_CFLAGS = -fPIC
+endif
+
+MODULE_CFLAGS = -I$(srcdir)/../src $(FPIC_CFLAGS) $(PROFILING_CFLAGS) \
+ $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAGS)
+
test_module_name := mod-test@MODULES_SUFFIX@
test_module := $(test_module_dir)/$(test_module_name)
$(srcdir)/src/emacs-module-tests.log: $(test_module)
-$(test_module): $(srcdir)/../src/emacs-module.[ch] $(test_module_dir)/mod-test.c
- $(MAKE) -C $(test_module_dir) $(test_module_name)
+$(test_module): $(test_module_dir)/mod-test.c $(srcdir)/../src/emacs-module.h
+ $(AM_V_CCLD)$(CC) -shared $(CPPFLAGS) $(MODULE_CFLAGS) $(LDFLAGS) \
+ -o $@ $<
endif
## Check that there is no 'automated' subdirectory, which would
clean:
find . '(' -name '*.log' -o -name '*.log~' ')' $(FIND_DELETE)
+ rm -f $(test_module_dir)/*.o $(test_module_dir)/*.so \
+ $(test_module_dir)/*.dll
bootstrap-clean: clean
find $(srcdir) -name '*.elc' $(FIND_DELETE)
+++ /dev/null
-### @configure_input@
-
-# Test GNU Emacs modules.
-
-# Copyright 2015-2017 Free Software Foundation, Inc.
-
-# This file is part of GNU Emacs.
-
-# GNU Emacs is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# GNU Emacs is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-SHELL = @SHELL@
-
-top_srcdir = @top_srcdir@
-VPATH = $(srcdir)
-CC = @CC@
-CFLAGS = @CFLAGS@
-PROFILING_CFLAGS = @PROFILING_CFLAGS@
-WARN_CFLAGS = @WARN_CFLAGS@
-WERROR_CFLAGS = @WERROR_CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-SO = @MODULES_SUFFIX@
-
-# -fPIC is a no-op on Windows, but causes a compiler warning
-ifeq ($(SO),.dll)
-FPIC_CFLAGS =
-else
-FPIC_CFLAGS = -fPIC
-endif
-
-ALL_CFLAGS = -I$(top_srcdir)/src $(FPIC_CFLAGS) $(PROFILING_CFLAGS) \
- $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAGS)
-
-all: mod-test$(SO)
-
-%$(SO): %.o
- $(CC) -shared $(LDFLAGS) -o $@ $<
-
-%.o: %.c $(top_srcdir)/src/emacs-module.h
- $(CC) $(CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
-
-## Stop .o files being deleted.
-.SECONDARY:
-
-.PHONY: clean
-
-clean:
- rm -f *.o *.so *.dll
-