summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile7
-rw-r--r--ffi/Makefile25
-rw-r--r--ffi/lang/python/Makefile7
-rw-r--r--openpgp-ffi/Makefile27
-rw-r--r--sqv/Makefile6
5 files changed, 54 insertions, 18 deletions
diff --git a/Makefile b/Makefile
index ba9363f4..d895cefe 100644
--- a/Makefile
+++ b/Makefile
@@ -24,11 +24,16 @@ RSYNC_FLAGS ?=
CARGO ?= cargo
GIT ?= git
RSYNC ?= rsync
-INSTALL ?= install
TAR ?= tar
XZ ?= xz
GPG ?= gpg
+ifeq ($(shell uname -s), Darwin)
+ INSTALL ?= ginstall
+else
+ INSTALL ?= install
+endif
+
VERSION ?= $(shell grep '^version[[:space:]]*=[[:space:]]*' Cargo.toml | cut -d'"' -f2)
# Make sure subprocesses pick these up.
diff --git a/ffi/Makefile b/ffi/Makefile
index 8d2756eb..361ae0dd 100644
--- a/ffi/Makefile
+++ b/ffi/Makefile
@@ -12,8 +12,19 @@ CARGO_TARGET_DIR := $(abspath $(CARGO_TARGET_DIR))
VERSION ?= $(shell grep '^version[[:space:]]*=[[:space:]]*' Cargo.toml | cut -d'"' -f2)
VERSION_MAJOR = $(shell echo $(VERSION) | cut -d'.' -f1)
+# Build the right library
+ifeq ($(shell uname -s), Darwin)
+ _SEQ_LIB_EXT = dylib
+else
+ _SEQ_LIB_EXT = so
+endif
+
# Tools.
-INSTALL ?= install
+ifeq ($(shell uname -s), Darwin)
+ INSTALL ?= ginstall
+else
+ INSTALL ?= install
+endif
# Make sure subprocesses pick these up.
export PREFIX
@@ -60,12 +71,12 @@ install:
$(INSTALL) -t $(DESTDIR)$(PREFIX)/include/sequoia \
include/sequoia/*.h
$(INSTALL) -d $(DESTDIR)$(PREFIX)/lib
- $(INSTALL) $(CARGO_TARGET_DIR)/release/libsequoia_ffi.so \
- $(DESTDIR)$(PREFIX)/lib/libsequoia_ffi.so.$(VERSION)
- ln -fs libsequoia_ffi.so.$(VERSION) \
- $(DESTDIR)$(PREFIX)/lib/libsequoia_ffi.so.$(VERSION_MAJOR)
- ln -fs libsequoia_ffi.so.$(VERSION) \
- $(DESTDIR)$(PREFIX)/lib/libsequoia_ffi.so
+ $(INSTALL) $(CARGO_TARGET_DIR)/release/libsequoia_ffi.$(_SEQ_LIB_EXT) \
+ $(DESTDIR)$(PREFIX)/lib/libsequoia_ffi.$(_SEQ_LIB_EXT).$(VERSION)
+ ln -fs libsequoia_ffi.$(_SEQ_LIB_EXT).$(VERSION) \
+ $(DESTDIR)$(PREFIX)/lib/libsequoia_ffi.$(_SEQ_LIB_EXT).$(VERSION_MAJOR)
+ ln -fs libsequoia_ffi.$(_SEQ_LIB_EXT).$(VERSION) \
+ $(DESTDIR)$(PREFIX)/lib/libsequoia_ffi.$(_SEQ_LIB_EXT)
$(INSTALL) $(CARGO_TARGET_DIR)/release/libsequoia_ffi.a \
$(DESTDIR)$(PREFIX)/lib/libsequoia_ffi.a
# Now the bindings.
diff --git a/ffi/lang/python/Makefile b/ffi/lang/python/Makefile
index 78a9481e..f398c0c2 100644
--- a/ffi/lang/python/Makefile
+++ b/ffi/lang/python/Makefile
@@ -9,7 +9,12 @@ CFLAGS += -I../../include -I../../../openpgp-ffi/include
PYTHON ?= python3
IPYTHON ?= ipython3
PYTEST ?= pytest-3
-INSTALL ?= install
+ifeq ($(shell uname -s), Darwin)
+ INSTALL ?= ginstall
+else
+ INSTALL ?= install
+endif
+
CARGO_TARGET_DIR ?= ../../../target
diff --git a/openpgp-ffi/Makefile b/openpgp-ffi/Makefile
index d0d84bdd..bbf49329 100644
--- a/openpgp-ffi/Makefile
+++ b/openpgp-ffi/Makefile
@@ -12,8 +12,19 @@ CARGO_TARGET_DIR := $(abspath $(CARGO_TARGET_DIR))
VERSION ?= $(shell grep '^version[[:space:]]*=[[:space:]]*' Cargo.toml | cut -d'"' -f2)
VERSION_MAJOR = $(shell echo $(VERSION) | cut -d'.' -f1)
+# Build the right library
+ifeq ($(shell uname -s), Darwin)
+ _SEQ_LIB_EXT = dylib
+else
+ _SEQ_LIB_EXT = so
+endif
+
# Tools.
-INSTALL ?= install
+ifeq ($(shell uname -s), Darwin)
+ INSTALL ?= ginstall
+else
+ INSTALL ?= install
+endif
# Make sure subprocesses pick these up.
export PREFIX
@@ -46,7 +57,7 @@ test check: check-headers
.PHONY: check-headers
check-headers: force-build
nm -g --defined-only \
- $(CARGO_TARGET_DIR)/debug/libsequoia_openpgp_ffi.so \
+ $(CARGO_TARGET_DIR)/debug/libsequoia_openpgp_ffi.$(_SEQ_LIB_EXT) \
| cut -d' ' -f3 | sort -u | grep pgp_ \
| while read SYM ; \
do git grep -q "$$SYM" include || echo $$SYM ; \
@@ -71,12 +82,12 @@ install:
$(INSTALL) -t $(DESTDIR)$(PREFIX)/include/sequoia \
include/sequoia/*.h
$(INSTALL) -d $(DESTDIR)$(PREFIX)/lib
- $(INSTALL) $(CARGO_TARGET_DIR)/release/libsequoia_openpgp_ffi.so \
- $(DESTDIR)$(PREFIX)/lib/libsequoia_openpgp_ffi.so.$(VERSION)
- ln -fs libsequoia_openpgp_ffi.so.$(VERSION) \
- $(DESTDIR)$(PREFIX)/lib/libsequoia_openpgp_ffi.so.$(VERSION_MAJOR)
- ln -fs libsequoia_openpgp_ffi.so.$(VERSION) \
- $(DESTDIR)$(PREFIX)/lib/libsequoia_openpgp_ffi.so
+ $(INSTALL) $(CARGO_TARGET_DIR)/release/libsequoia_openpgp_ffi.$(_SEQ_LIB_EXT) \
+ $(DESTDIR)$(PREFIX)/lib/libsequoia_openpgp_ffi.$(_SEQ_LIB_EXT).$(VERSION)
+ ln -fs libsequoia_openpgp_ffi.$(_SEQ_LIB_EXT).$(VERSION) \
+ $(DESTDIR)$(PREFIX)/lib/libsequoia_openpgp_ffi.$(_SEQ_LIB_EXT).$(VERSION_MAJOR)
+ ln -fs libsequoia_openpgp_ffi.$(_SEQ_LIB_EXT).$(VERSION) \
+ $(DESTDIR)$(PREFIX)/lib/libsequoia_openpgp_ffi.$(_SEQ_LIB_EXT)
$(INSTALL) $(CARGO_TARGET_DIR)/release/libsequoia_openpgp_ffi.a \
$(DESTDIR)$(PREFIX)/lib/libsequoia_openpgp_ffi.a
diff --git a/sqv/Makefile b/sqv/Makefile
index 10df31b9..4f3d9524 100644
--- a/sqv/Makefile
+++ b/sqv/Makefile
@@ -6,7 +6,11 @@ SQV ?= $(CARGO_TARGET_DIR)/debug/sqv
# Tools.
CARGO ?= cargo
-INSTALL ?= install
+ifeq ($(shell uname -s), Darwin)
+ INSTALL ?= ginstall
+else
+ INSTALL ?= install
+endif
all: src/sqv-usage.rs