Commit 7cd728c8 authored by Eli Zaretskii's avatar Eli Zaretskii

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.
parent d4869dde
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment