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

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

[nongnu] elpa/sweeprolog 72cc4d516b 014/166: PORT: detect linux vs macOS


From: ELPA Syncer
Subject: [nongnu] elpa/sweeprolog 72cc4d516b 014/166: PORT: detect linux vs macOS shared object extension in Makefile
Date: Fri, 30 Sep 2022 04:59:22 -0400 (EDT)

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

    PORT: detect linux vs macOS shared object extension in Makefile
---
 .build.yml | 38 ++++++++++++++++++++++++++++++++++++++
 .gitignore |  1 +
 Makefile   | 23 ++++++++++++++++++-----
 3 files changed, 57 insertions(+), 5 deletions(-)

diff --git a/.build.yml b/.build.yml
new file mode 100644
index 0000000000..c52b2d355b
--- /dev/null
+++ b/.build.yml
@@ -0,0 +1,38 @@
+image: debian/stable
+packages:
+  - build-essential
+  - cmake
+  - ninja-build
+  - pkg-config
+  - ncurses-dev
+  - libreadline-dev
+  - libedit-dev
+  - libgoogle-perftools-dev
+  - libgmp-dev
+  - libssl-dev
+  - unixodbc-dev
+  - zlib1g-dev
+  - libarchive-dev
+  - libossp-uuid-dev
+  - libxext-dev
+  - libice-dev
+  - libjpeg-dev
+  - libxinerama-dev
+  - libxft-dev
+  - libxpm-dev
+  - libxt-dev
+  - libdb-dev
+  - libpcre2-dev
+  - libyaml-dev
+  - zip
+  - git
+secrets:
+  - 750079bb-9735-473b-bebf-db897c9f0c6b
+  - 72d5c3dc-f83f-4cc2-96e3-b2b08f6ee8a0
+sources:
+  - git@git.sr.ht:~eshel/sweep
+tasks:
+  - build: |
+      cd sweep
+      make
+      make info
diff --git a/.gitignore b/.gitignore
index 4cd36b432c..9f56ac134b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,4 @@
 /sweep.info
 /sweep.info~
 /sweep.texi
+/sweep.o
diff --git a/Makefile b/Makefile
index e8d61133e0..6704c7d357 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,19 @@
 CURRENT_DIR := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
 
 BASENAME = sweep
+
+UNAME_S := $(shell uname -s)
+ifeq ($(UNAME_S),Linux)
+    SOEXT = so
+endif
+ifeq ($(UNAME_S),Darwin)
+    SOEXT = dylib
+endif
+
 SOEXT    = dylib
 
 TARGET   = $(BASENAME)-module.$(SOEXT)
+OBJECT   = $(BASENAME).o
 SOURCE   = $(BASENAME).c
 
 LDFLAGS += -shared
@@ -28,14 +38,17 @@ CMAKE_OPTIONS += -DSWIPL_INSTALL_IN_LIB=ON
 
 all: $(TARGET)
 
-$(TARGET): $(SOURCE) swipl
-       $(CC) $(CFLAGS) -o $@ $(SOURCE) $(LDFLAGS)
+$(OBJECT): $(SOURCE) lib/libswipl.$(SOEXT)
+       $(CC) $(CFLAGS) -o $@ -c $(SOURCE)
+
+$(TARGET): $(OBJECT)
+       $(CC) -o $@ $(OBJECT) $(LDFLAGS)
 
 clean:
        rm -rf bin lib share swipl/build
-       rm -f $(TARGET) $(BASENAME).info
+       rm -f $(TARGET) $(OBJECT) $(BASENAME).info
 
-swipl:
+lib/libswipl.$(SOEXT):
        cd swipl; \
        rm -rf build; \
        mkdir build; \
@@ -44,5 +57,5 @@ swipl:
        ninja; \
        ninja install
 
-$(BASENAME).info:
+$(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)))"



reply via email to

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