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 /openpgp-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 'openpgp-ffi/Makefile')
-rw-r--r-- | openpgp-ffi/Makefile | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/openpgp-ffi/Makefile b/openpgp-ffi/Makefile index ba4e1d0f..4ece1db2 100644 --- a/openpgp-ffi/Makefile +++ b/openpgp-ffi/Makefile @@ -19,11 +19,20 @@ INSTALL ?= install export PREFIX export DESTDIR +# $(1) = install dir +# $(2) = whether to set libdir to $(1) (empty string = false) +sequoia_openpgp_pc = \ + sed -e 's|VERSION|$(VERSION)|g' \ + -e 's|PREFIX|$(shell pwd)|g' \ + $(if $(2),-e 's|libdir=.*|libdir=$(1)|g') \ + sequoia-openpgp.pc.in \ + > $(1)/sequoia-openpgp.pc + all: build .PHONY: build build: - : + $(call sequoia_openpgp_pc,$(CARGO_TARGET_DIR)/debug,true) # Testing and examples. .PHONY: test check @@ -37,15 +46,12 @@ examples: # Installation. .PHONY: build-release build-release: - : + $(call sequoia_openpgp_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-openpgp.pc.in \ - > $(DESTDIR)$(PREFIX)/share/pkgconfig/sequoia-openpgp.pc + $(call sequoia_openpgp_pc,$(DESTDIR)$(PREFIX)/share/pkgconfig,) $(INSTALL) -d $(DESTDIR)$(PREFIX)/include $(INSTALL) -d $(DESTDIR)$(PREFIX)/include/sequoia $(INSTALL) -t $(DESTDIR)$(PREFIX)/include/sequoia \ |