summaryrefslogtreecommitdiff
path: root/modules/mod-test/Makefile
diff options
context:
space:
mode:
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