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.

57 lines
1.4KB

  1. PWD = $(shell pwd)
  2. export CPATH = $(PWD)/openssl/include
  3. export LIBRARY_PATH = $(PWD)/openssl
  4. OPENSSL_VERSION = 1.0.1m
  5. OPENSSL_DIR = openssl-$(OPENSSL_VERSION)
  6. RUBY_MAJOR_VERSION = 2.2
  7. RUBY_VERSION = $(RUBY_MAJOR_VERSION).2
  8. RUBY_DIR = ruby-$(RUBY_VERSION)
  9. RUBY_OPENSSL_EXT_DIR = $(RUBY_DIR)/ext/openssl
  10. export LIBRARY_PATH = $(PWD)/lib
  11. export C_INCLUDE_PATH = $(PWD)/$(OPENSSL_DIR)/include
  12. .SECONDARY:
  13. all: libs ext
  14. clean:
  15. rm -rf $(RUBY_DIR) $(OPENSSL_DIR)
  16. mr-proper: clean
  17. rm -rf lib/libcrypto.so* lib/libssl.so* lib/openssl.so
  18. $(OPENSSL_DIR)/:
  19. wget https://www.openssl.org/source/$(OPENSSL_DIR).tar.gz
  20. tar xf $(OPENSSL_DIR).tar.gz
  21. rm -rf $(OPENSSL_DIR).tar.gz
  22. $(OPENSSL_DIR)/Makefile: $(OPENSSL_DIR)/
  23. cd $(OPENSSL_DIR); ./config shared
  24. $(OPENSSL_DIR)/libssl.so.1.0.0 $(OPENSSL_DIR)/libcrypto.so.1.0.0: $(OPENSSL_DIR)/Makefile
  25. $(MAKE) -C $(OPENSSL_DIR) depend build_libs
  26. lib/%.so.1.0.0: $(OPENSSL_DIR)/%.so.1.0.0
  27. cp $< $@
  28. lib/%.so: lib/%.so.1.0.0
  29. ln -s $(notdir $<) $@
  30. libs: lib/libssl.so lib/libcrypto.so
  31. $(RUBY_DIR):
  32. wget http://cache.ruby-lang.org/pub/ruby/$(RUBY_MAJOR_VERSION)/$(RUBY_DIR).tar.gz
  33. tar xf $(RUBY_DIR).tar.gz
  34. rm -f $(RUBY_DIR).tar.gz
  35. $(RUBY_OPENSSL_EXT_DIR)/Makefile: libs $(RUBY_DIR)
  36. cd $(RUBY_OPENSSL_EXT_DIR); ruby extconf.rb
  37. patch $@ patch
  38. $(RUBY_OPENSSL_EXT_DIR)/openssl.so: libs $(RUBY_OPENSSL_EXT_DIR)/Makefile
  39. $(MAKE) -C $(RUBY_OPENSSL_EXT_DIR)
  40. lib/openssl.so: $(RUBY_OPENSSL_EXT_DIR)/openssl.so
  41. cp $< $@
  42. ext: lib/openssl.so