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.

39 lines
1.0KB

  1. PWD = $(shell pwd)
  2. export CPATH = $(PWD)/openssl/include
  3. export LIBRARY_PATH = $(PWD)/openssl
  4. OPENSSL_VERSION = OpenSSL_1_0_1j
  5. RUBY_VERSION = 2.1.5
  6. RUBY_OPENSSL_EXT_DIR = ruby-$(RUBY_VERSION)/ext/openssl
  7. all: lib/libssl.so.1.0.0 lib/libcrypto.so.1.0.0 lib/openssl.so
  8. clean:
  9. rm -rf ruby-$(RUBY_VERSION) openssl
  10. openssl:
  11. git clone https://github.com/openssl/openssl -b $(OPENSSL_VERSION)
  12. openssl/Makefile: openssl
  13. cd openssl; ./config shared
  14. openssl/libssl.so: openssl/Makefile
  15. cd openssl; $(MAKE) depend all
  16. lib/%.so.1.0.0: openssl/%.so
  17. cp $^ $@
  18. ruby-$(RUBY_VERSION):
  19. wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-$(RUBY_VERSION).tar.gz
  20. tar xf ruby-$(RUBY_VERSION).tar.gz
  21. rm -f ruby-$(RUBY_VERSION).tar.gz
  22. $(RUBY_OPENSSL_EXT_DIR)/Makefile: ruby-$(RUBY_VERSION)
  23. cd $(RUBY_OPENSSL_EXT_DIR); ruby extconf.rb
  24. patch $@ patch
  25. $(RUBY_OPENSSL_EXT_DIR)/openssl.so: $(RUBY_OPENSSL_EXT_DIR)/Makefile
  26. cd $(RUBY_OPENSSL_EXT_DIR); $(MAKE); $(MAKE) install
  27. lib/openssl.so: $(RUBY_OPENSSL_EXT_DIR)/openssl.so
  28. cp $< $@