From: Eli Zaretskii Date: Thu, 19 Nov 2015 17:49:29 +0000 (+0200) Subject: Minor improvements in modules testing Makefile X-Git-Tag: emacs-25.0.90~734 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7cd728c813f2c472a2f6a0cb0c3fb3ee46c9d8ad;p=emacs.git Minor improvements in modules testing Makefile * modules/mod-test/Makefile (EMACS, SO): New variables. (CFLAGS): When SO = dll, don't use -fPIC. (check): New target, runs the test. --- diff --git a/modules/mod-test/Makefile b/modules/mod-test/Makefile index 654c22a7e33..79a88725d08 100644 --- a/modules/mod-test/Makefile +++ b/modules/mod-test/Makefile @@ -18,16 +18,28 @@ # along with GNU Emacs. If not, see . ROOT = ../.. +EMACS = $(ROOT)/src/emacs CC = gcc LD = gcc -CFLAGS = -ggdb3 -Wall LDFLAGS = -all: mod-test.so +# On MS-Windows, say "make SO=.dll" to build the module +SO = so +# -fPIC is a no-op on Windows, but causes a compiler warning +ifeq ($(SO),dll) +CFLAGS = -ggdb3 -Wall +else +CFLAGS = -ggdb3 -Wall -fPIC +endif + +all: mod-test.$(SO) -%.so: %.o +%.$(SO): %.o $(LD) -shared $(LDFLAGS) -o $@ $< %.o: %.c - $(CC) $(CFLAGS) -I$(ROOT)/src -fPIC -c $< + $(CC) $(CFLAGS) -I$(ROOT)/src -c $< + +check: + $(EMACS) -batch -l ert -l test.el -f ert-run-tests-batch-and-exit