emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/sweeprolog 5dcdec144d 052/166: PORT: use swipl --dump-runt


From: ELPA Syncer
Subject: [nongnu] elpa/sweeprolog 5dcdec144d 052/166: PORT: use swipl --dump-runtime-variables to locate SWI-Prolog.h
Date: Fri, 30 Sep 2022 04:59:25 -0400 (EDT)

branch: elpa/sweeprolog
commit 5dcdec144de1464fd21eef14bf0cec06118064bd
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>

    PORT: use swipl --dump-runtime-variables to locate SWI-Prolog.h
---
 Makefile | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 687b1f51ca..c8470be2a2 100644
--- a/Makefile
+++ b/Makefile
@@ -10,20 +10,25 @@ ifeq ($(UNAME_S),Darwin)
     SOEXT = dylib
 endif
 
+SWIPL      ?= swipl
+SWIPLBASE   = $(shell $(SWIPL) --dump-runtime-variables | grep PLBASE   | cut 
-f 2 -d = | cut -f 1 -d ';')
+SWIPLLIBDIR = $(shell $(SWIPL) --dump-runtime-variables | grep PLLIBDIR | cut 
-f 2 -d = | cut -f 1 -d ';')
+
 TARGET   = $(BASENAME)-module.$(SOEXT)
 OBJECT   = $(BASENAME).o
 SOURCE   = $(BASENAME).c
 
 LDFLAGS += -shared
+LDFLAGS += -L$(SWIPLLIBDIR)
 LDFLAGS += -lswipl
 
 CFLAGS  += -fPIC
 CFLAGS  += -Wall
 CFLAGS  += -Wextra
 CFLAGS  += -O2
-CFLAGS  += -I/usr/local/lib/swipl/include
+CFLAGS  += -I$(SWIPLBASE)/include
 
-.PHONY: clean all swipl check
+.PHONY: clean all check
 
 all: $(TARGET)
 
@@ -34,10 +39,12 @@ $(TARGET): $(OBJECT)
        $(CC) -o $@ $(OBJECT) $(LDFLAGS)
 
 clean:
-       rm -f $(TARGET) $(OBJECT) $(BASENAME).info
+       rm -f $(TARGET) $(OBJECT) $(BASENAME).info $(BASENAME).texi 
$(BASENAME).html
 
 $(BASENAME).info:: README.org
-       emacs -Q --batch --eval '(require (quote ox-texinfo))' --eval 
"(with-current-buffer (find-file \"README.org\") (org-export-to-file (quote 
texinfo) \"$@\" nil nil nil nil nil (quote org-texinfo-compile)))"
+       emacs -Q --batch --eval "(require 'ox-texinfo)" \
+               --eval "(with-current-buffer (find-file \"README.org\") 
(org-export-to-file (quote texinfo) \"$@\" nil nil nil nil nil (quote 
org-texinfo-compile)))"
 
 check: $(TARGET)
-       emacs -batch --eval '(add-to-list (quote load-path) (expand-file-name 
"."))' -l ert -l sweep -l sweep-tests.el -f ert-run-tests-batch-and-exit
+       emacs -batch --eval '(add-to-list (quote load-path) (expand-file-name 
"."))' \
+               -l ert -l sweep -l sweep-tests.el -f 
ert-run-tests-batch-and-exit



reply via email to

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