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

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

[nongnu] elpa/sqlite3 108521be02 59/62: Merge pull request #5 from yasuh


From: ELPA Syncer
Subject: [nongnu] elpa/sqlite3 108521be02 59/62: Merge pull request #5 from yasuhirokimura/fix_build_with_cygwin_and_msys2
Date: Tue, 14 Mar 2023 11:01:49 -0400 (EDT)

branch: elpa/sqlite3
commit 108521be0242bedf232775a28728588da9699336
Merge: 2f6095201b bcb3b0163b
Author: Peking Duck <pekingduck@users.noreply.github.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #5 from yasuhirokimura/fix_build_with_cygwin_and_msys2
    
    Fix build with Cygwin and MSYS2
---
 Makefile | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 3e615726c2..0c09fa8944 100644
--- a/Makefile
+++ b/Makefile
@@ -11,6 +11,15 @@ CFLAGS ?= -g3 -Wall -std=c99 $(INC)
 
 EMACS ?= /Applications/Emacs.app/Contents/MacOS/Emacs-x86_64-10_14
 
+UNAME_O=$(shell uname -o)
+ifeq ($(UNAME_O),Cygwin)
+SHLIB_EXTENSION=dll
+else ifeq ($(UNAME_O),Msys)
+SHLIB_EXTENSION=dll
+else
+SHLIB_EXTENSION=so
+endif
+
 # Melpa package
 PKG=sqlite3
 
@@ -21,23 +30,23 @@ MODULE_BASENAME=$(MODULE)-$(MODULE_VERSION)
 MODULE_PKG_EL=$(MODULE_BASENAME)/$(MODULE)-pkg.el
 MODULE_TAR=$(MODULE_BASENAME).tar
 
-all: $(MODULE)-api.so 
+all: $(MODULE)-api.$(SHLIB_EXTENSION)
 
 clean:
-       rm -rf *.so *.o *.tar $(MODULE_BASENAME)
+       rm -rf *.$(SHLIB_EXTENSION) *.o *.tar $(MODULE_BASENAME)
 
 # File "MODULE" is read by (sqlite3-api-install-dynamic-module)
 # during installation
-module: $(MODULE)-api.so
+module: $(MODULE)-api.$(SHLIB_EXTENSION)
        mkdir -p $(MODULE_BASENAME)
-       cp $(MODULE).el $(MODULE)-api.so $(MODULE_BASENAME)
+       cp $(MODULE).el $(MODULE)-api.$(SHLIB_EXTENSION) $(MODULE_BASENAME)
        echo "(define-package \"$(MODULE)\" \"$(MODULE_VERSION)\" \"SQLite3 API 
dynamic module\")" > $(MODULE_PKG_EL)
        tar cvf $(MODULE_TAR) $(MODULE_BASENAME)
 
 install: module
        emacsclient -e '(package-install-file "$(MODULE_TAR)")'
 
-%.so: %.o
+%.$(SHLIB_EXTENSION): %.o
        $(CC) -shared -o $@ $< $(LIB)
 
 %.o: %.c



reply via email to

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