diff options
author | Neal H. Walfield <neal@pep.foundation> | 2019-01-29 12:05:13 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2019-01-29 12:22:49 +0100 |
commit | 1ab35113634a15927ca87254a6769bc1e2decdf3 (patch) | |
tree | c8636b1fff9af0977f9739131e51e50b22f6922f /ffi/Makefile | |
parent | bff390b189ac92012a3c25e8c361013c78698fd3 (diff) |
ffi,openpgp-ffi: Install .pc files in target directory.
- Install the .pc files in the target directory when building so
that it is easier to link against built, but uninstalled
libraries.
- 177835be9dba392ab10994254b67aa676be66331 accidentally removed this
functionality for debug builds. Restore it, and also add it for
release builds.
- Avoid code duplication by using a macro.
Diffstat (limited to 'ffi/Makefile')
-rw-r--r-- | ffi/Makefile | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/ffi/Makefile b/ffi/Makefile index 49420f21..8d2756eb 100644 --- a/ffi/Makefile +++ b/ffi/Makefile @@ -19,11 +19,21 @@ INSTALL ?= install export PREFIX export DESTDIR +# $(1) = install dir +# $(2) = whether to set libdir to $(1) (empty string = false) +sequoia_pc = \ + sed -e 's|VERSION|$(VERSION)|g' \ + -e 's|PREFIX|$(shell pwd)|g' \ + $(if $(2),-e 's|libdir=.*|libdir=$(1)|g') \ + sequoia.pc.in \ + >$(1)/sequoia.pc + all: build .PHONY: build build: $(MAKE) -Clang/python build + $(call sequoia_pc,$(CARGO_TARGET_DIR)/debug,true) # Testing and examples. .PHONY: test check @@ -38,14 +48,12 @@ examples: .PHONY: build-release build-release: $(MAKE) -Clang/python build-release + $(call sequoia_pc,$(CARGO_TARGET_DIR)/release,true) .PHONY: install install: $(INSTALL) -d $(DESTDIR)$(PREFIX)/share/pkgconfig - sed -e 's|VERSION|$(VERSION)|g' \ - -e 's|PREFIX|$(PREFIX)|g' \ - sequoia.pc.in \ - > $(DESTDIR)$(PREFIX)/share/pkgconfig/sequoia.pc + $(call sequoia_pc,$(DESTDIR)$(PREFIX)/share/pkgconfig,) $(INSTALL) -d $(DESTDIR)$(PREFIX)/include $(INSTALL) -t $(DESTDIR)$(PREFIX)/include include/sequoia.h $(INSTALL) -d $(DESTDIR)$(PREFIX)/include/sequoia |