summaryrefslogtreecommitdiff
path: root/modules/mod-test/Makefile
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2015-11-19 19:49:29 +0200
committerEli Zaretskii <eliz@gnu.org>2015-11-19 19:49:29 +0200
commit7cd728c813f2c472a2f6a0cb0c3fb3ee46c9d8ad (patch)
treeacb3e663b7b9b9464937d5dbe33b88b469b57d5e /modules/mod-test/Makefile
parentd4869dde91a0347697d1f05ac74873c7b86caebb (diff)
downloademacs-7cd728c813f2c472a2f6a0cb0c3fb3ee46c9d8ad.tar.gz
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/mod-test/Makefile')
-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 @@
# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
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