Verified Commit ce8d8ba0 authored by Karel Koci's avatar Karel Koci 🤘

openssl_purity: simplify makefile

This just refactors original openssl_purity.mk.

Also note that this might no longer be required. From OpenSSL 1.1.0 it
seems that problems with valgrind were fixed and this might meant that
we can drop this. We don't want to do that now because OpenSSL 1.0.0
only systems might still exists but we can do it in future.
parent f5fdb85b
......@@ -3,25 +3,21 @@
# tests.
# See: https://www.openssl.org/docs/faq.html
OPENSSL_TEST_VERSION := $(shell openssl version | awk '{print $$2}')
OPENSSL_SRC := https://www.openssl.org/source/openssl-$(OPENSSL_TEST_VERSION).tar.gz
OPENSSL_BUILD_PATH = $(O)/tests/openssl
OPENSSL_LIBS = $(OPENSSL_BUILD_PATH)/openssl-$(OPENSSL_TEST_VERSION)/libcrypto.so $(OPENSSL_BUILD_PATH)/openssl-$(OPENSSL_TEST_VERSION)/libssl.so
OPENSSL_ENV = LD_LIBRARY_PATH=$(OPENSSL_BUILD_PATH)/openssl-$(OPENSSL_TEST_VERSION):$$LD_LIBRARY_PATH
$(OPENSSL_BUILD_PATH)/openssl-$(OPENSSL_TEST_VERSION).tar.gz:
mkdir -p $(OPENSSL_BUILD_PATH)
wget https://www.openssl.org/source/openssl-$(OPENSSL_TEST_VERSION).tar.gz -O $@
OPENSSL_LIBS = $(OPENSSL_BUILD_PATH)/libcrypto.so $(OPENSSL_BUILD_PATH)/libssl.so
OPENSSL_ENV = LD_LIBRARY_PATH="$(OPENSSL_BUILD_PATH):$$LD_LIBRARY_PATH"
# Usage of pattern with multiple targets causes gmake to understand that all of
# those files are produced by this target at once. So this target is run only
# once. See: https://www.gnu.org/software/make/manual/make.html#Pattern-Examples
OPENSSL_LIBS_TARGET = $(OPENSSL_BUILD_PATH)/%/libcrypto.so $(OPENSSL_BUILD_PATH)/%/libssl.so
$(OPENSSL_LIBS_TARGET): $(OPENSSL_BUILD_PATH)/openssl-$(OPENSSL_TEST_VERSION).tar.gz
tar -xzf $< -C $(OPENSSL_BUILD_PATH)
cd $(OPENSSL_BUILD_PATH)/openssl-$(OPENSSL_TEST_VERSION) && ./config shared -DPURIFY
+$(MAKE) -C $(OPENSSL_BUILD_PATH)/openssl-$(OPENSSL_TEST_VERSION)
# Make marks these libraries as intermediate, but we need we don't want them
# compile every time so lets set them as precious.
.PRECIOUS: $(OPENSSL_LIBS_TARGET)
$(O)/tests/%/libcrypto.so $(O)/tests/%/libssl.so:
mkdir -p $(OPENSSL_BUILD_PATH)
curl -L $(OPENSSL_SRC) | tar -xzf - -C $(OPENSSL_BUILD_PATH) --strip-components=1
cd $(OPENSSL_BUILD_PATH) && ./config shared -DPURIFY
+$(MAKE) -C $(OPENSSL_BUILD_PATH)
.PHONY: clean-openssl
clean-openssl:
rm -rf $(OPENSSL_BUILD_PATH)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment