diff options
| author | Philipp Stephani | 2017-06-12 16:09:37 +0200 |
|---|---|---|
| committer | Philipp Stephani | 2017-06-12 16:09:37 +0200 |
| commit | c90a97adc49e844d884a4422e99570526fd92485 (patch) | |
| tree | 8587d28765a009f2c049931181e9dd4ff026efde /test/data | |
| parent | 909dfaf3257e5e2de48a0a51bf9d42517a393fb0 (diff) | |
| download | emacs-c90a97adc49e844d884a4422e99570526fd92485.tar.gz emacs-c90a97adc49e844d884a4422e99570526fd92485.zip | |
Use Autoconf to generate the test module Makefile
This makes it easier to pass compilation flags around.
* configure.ac: Also build test module Makefile.
* test/data/emacs-module/Makefile.in: New makefile template.
* test/Makefile.in ($(test_module)): No longer necessary to pass
@MODULES_SUFFIX@ around.
* .gitignore: Test module Makefile can now be ignored.
Diffstat (limited to 'test/data')
| -rw-r--r-- | test/data/emacs-module/Makefile.in (renamed from test/data/emacs-module/Makefile) | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/test/data/emacs-module/Makefile b/test/data/emacs-module/Makefile.in index bfeddb0472f..427d1aaa07c 100644 --- a/test/data/emacs-module/Makefile +++ b/test/data/emacs-module/Makefile.in | |||
| @@ -1,3 +1,5 @@ | |||
| 1 | ### @configure_input@ | ||
| 2 | |||
| 1 | # Test GNU Emacs modules. | 3 | # Test GNU Emacs modules. |
| 2 | 4 | ||
| 3 | # Copyright 2015-2017 Free Software Foundation, Inc. | 5 | # Copyright 2015-2017 Free Software Foundation, Inc. |
| @@ -17,25 +19,28 @@ | |||
| 17 | # You should have received a copy of the GNU General Public License | 19 | # 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/>. | 20 | # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
| 19 | 21 | ||
| 20 | ROOT = ../../.. | 22 | SHELL = @SHELL@ |
| 21 | 23 | ||
| 22 | CC = gcc | 24 | top_srcdir = @top_srcdir@ |
| 23 | LD = gcc | 25 | VPATH = $(srcdir) |
| 24 | LDFLAGS = | 26 | CC = @CC@ |
| 27 | CFLAGS = @CFLAGS@ | ||
| 28 | CPPFLAGS = @CPPFLAGS@ | ||
| 29 | SO = @MODULES_SUFFIX@ | ||
| 25 | 30 | ||
| 26 | # On MS-Windows, say "make SO=.dll" to build the module | ||
| 27 | SO = .so | ||
| 28 | # -fPIC is a no-op on Windows, but causes a compiler warning | 31 | # -fPIC is a no-op on Windows, but causes a compiler warning |
| 29 | ifeq ($(SO),.dll) | 32 | ifeq ($(SO),.dll) |
| 30 | CFLAGS = -std=c11 -ggdb3 -Wall | 33 | FPIC_CFLAGS = |
| 31 | else | 34 | else |
| 32 | CFLAGS = -std=c11 -ggdb3 -Wall -fPIC | 35 | FPIC_CFLAGS = -fPIC |
| 33 | endif | 36 | endif |
| 34 | 37 | ||
| 35 | all: mod-test$(SO) | 38 | all: mod-test$(SO) |
| 36 | 39 | ||
| 37 | %$(SO): %.o | 40 | %$(SO): %.o |
| 38 | $(LD) -shared $(LDFLAGS) -o $@ $< | 41 | $(CC) -shared $(LDFLAGS) -o $@ $< |
| 39 | 42 | ||
| 40 | %.o: %.c | 43 | %.o: %.c |
| 41 | $(CC) $(CFLAGS) -I$(ROOT)/src -c $< | 44 | $(CC) $(CPPFLAGS) $(CFLAGS) $(FPIC_CFLAGS) -I$(top_srcdir)/src -c -o $@ $< |
| 45 | |||
| 46 | %.o: $(srcdir)/emacs-module.[ch] | ||