emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-25 7cd728c: Minor improvements in modules testing Ma


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-25 7cd728c: Minor improvements in modules testing Makefile
Date: Thu, 19 Nov 2015 17:50:51 +0000

branch: emacs-25
commit 7cd728c813f2c472a2f6a0cb0c3fb3ee46c9d8ad
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    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.
---
 modules/mod-test/Makefile |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/modules/mod-test/Makefile b/modules/mod-test/Makefile
index 654c22a..79a8872 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]