aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorEli Zaretskii2015-11-19 19:49:29 +0200
committerEli Zaretskii2015-11-19 19:49:29 +0200
commit7cd728c813f2c472a2f6a0cb0c3fb3ee46c9d8ad (patch)
treeacb3e663b7b9b9464937d5dbe33b88b469b57d5e /modules
parentd4869dde91a0347697d1f05ac74873c7b86caebb (diff)
downloademacs-7cd728c813f2c472a2f6a0cb0c3fb3ee46c9d8ad.tar.gz
emacs-7cd728c813f2c472a2f6a0cb0c3fb3ee46c9d8ad.zip
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.
Diffstat (limited to 'modules')
-rw-r--r--modules/mod-test/Makefile20
1 files changed, 16 insertions, 4 deletions
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 @@
18# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. 18# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
19 19
20ROOT = ../.. 20ROOT = ../..
21EMACS = $(ROOT)/src/emacs
21 22
22CC = gcc 23CC = gcc
23LD = gcc 24LD = gcc
24CFLAGS = -ggdb3 -Wall
25LDFLAGS = 25LDFLAGS =
26 26
27all: mod-test.so 27# On MS-Windows, say "make SO=.dll" to build the module
28SO = so
29# -fPIC is a no-op on Windows, but causes a compiler warning
30ifeq ($(SO),dll)
31CFLAGS = -ggdb3 -Wall
32else
33CFLAGS = -ggdb3 -Wall -fPIC
34endif
35
36all: mod-test.$(SO)
28 37
29%.so: %.o 38%.$(SO): %.o
30 $(LD) -shared $(LDFLAGS) -o $@ $< 39 $(LD) -shared $(LDFLAGS) -o $@ $<
31 40
32%.o: %.c 41%.o: %.c
33 $(CC) $(CFLAGS) -I$(ROOT)/src -fPIC -c $< 42 $(CC) $(CFLAGS) -I$(ROOT)/src -c $<
43
44check:
45 $(EMACS) -batch -l ert -l test.el -f ert-run-tests-batch-and-exit