You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cryptcheck/Makefile

73 lines
2.1 KiB

PWD = $(shell pwd)
export CPATH = $(PWD)/openssl/include
export LIBRARY_PATH = $(PWD)/openssl
OPENSSL_VERSION = 1.0.2g
OPENSSL_NAME = openssl-$(OPENSSL_VERSION)
OPENSSL_DIR = build/$(OPENSSL_NAME)
#OPENSSL_DIR = openssl
RUBY_MAJOR_VERSION = 2.3
RUBY_VERSION = $(RUBY_MAJOR_VERSION).0
RUBY_NAME = ruby-$(RUBY_VERSION)
RUBY_DIR = build/$(RUBY_NAME)
8 years ago
RUBY_OPENSSL_EXT_DIR = $(RUBY_DIR)/ext/openssl
export LIBRARY_PATH = $(PWD)/lib
export C_INCLUDE_PATH = $(PWD)/$(OPENSSL_DIR)/include
8 years ago
.SECONDARY:
all: libs ext
clean: clean-libs clean-ext
clean-libs:
[ -d $(OPENSSL_DIR) ] \
&& find $(OPENSSL_DIR) \( -name "*.o" -o -name "*.so" \) -delete \
|| true
rm -f lib/libcrypto.so* lib/libssl.so* $(OPENSSL_DIR)/Makefile
clean-ext:
[ -d $(RUBY_OPENSSL_EXT_DIR) ] \
&& find $(RUBY_OPENSSL_EXT_DIR) \( -name "*.o" -o -name "*.so" \) -delete \
|| true
rm -f lib/openssl.so
mr-proper:
rm -rf lib/libcrypto.so* lib/libssl.so* lib/openssl.so build
8 years ago
build/:
mkdir $@
8 years ago
build/$(OPENSSL_NAME).tar.gz: | build/
wget https://www.openssl.org/source/$(OPENSSL_NAME).tar.gz -O $@
$(OPENSSL_DIR)/: build/$(OPENSSL_NAME).tar.gz
tar -C build -xf build/$(OPENSSL_NAME).tar.gz
$(OPENSSL_DIR)/Makefile: | $(OPENSSL_DIR)/
cd $(OPENSSL_DIR); ./Configure enable-ssl3 enable-ssl2 enable-shared linux-x86_64
$(OPENSSL_DIR)/libssl.so \
$(OPENSSL_DIR)/libcrypto.so: $(OPENSSL_DIR)/Makefile
8 years ago
$(MAKE) -C $(OPENSSL_DIR) depend build_libs
7 years ago
lib/%.so: $(OPENSSL_DIR)/%.so
cp $< $@
lib/%.so.1.0.0:
ln -fs $(notdir $(subst .1.0.0,, $@)) $@
7 years ago
libs: lib/libssl.so lib/libcrypto.so lib/libssl.so.1.0.0 lib/libcrypto.so.1.0.0
build/$(RUBY_NAME).tar.gz: | build/
wget http://cache.ruby-lang.org/pub/ruby/$(RUBY_MAJOR_VERSION)/$(RUBY_NAME).tar.gz -O $@
$(RUBY_DIR)/: build/$(RUBY_NAME).tar.gz
tar -C build -xf $<
$(RUBY_OPENSSL_EXT_DIR)/Makefile: libs | $(RUBY_DIR)/
patch -d $(RUBY_DIR)/ -p1 < patch
cd $(RUBY_OPENSSL_EXT_DIR); ruby extconf.rb
8 years ago
$(RUBY_OPENSSL_EXT_DIR)/openssl.so: libs $(RUBY_OPENSSL_EXT_DIR)/Makefile
top_srcdir=../.. $(MAKE) -C $(RUBY_OPENSSL_EXT_DIR)
lib/openssl.so: $(RUBY_OPENSSL_EXT_DIR)/openssl.so
cp $< $@
8 years ago
ext: lib/openssl.so