Makefile 930 B

1234567891011121314151617181920212223242526272829
  1. .phony: clean
  2. OPENSSL_VER ?= 1.0.2j
  3. WEBUI_VER ?= 0.1.3
  4. BUILD_DIR = /tmp/openssl-static-build
  5. OPENSSL_PKG = openssl-$(OPENSSL_VER).tar.gz
  6. OPENSSL_SRC = $(BUILD_DIR)/openssl-$(OPENSSL_VER)
  7. cloudflare-webui-$(WEBUI_VER).tar.gz: target/release/cloudflare-webui
  8. tar -C target/release -czf cloudflare-webui-$(WEBUI_VER).tar.gz cloudflare-webui
  9. $(BUILD_DIR):
  10. mkdir -p $(BUILD_DIR)
  11. $(BUILD_DIR)/$(OPENSSL_PKG): $(BUILD_DIR)
  12. cd $(BUILD_DIR) && curl -LO https://www.openssl.org/source/$(OPENSSL_PKG)
  13. $(OPENSSL_SRC): $(BUILD_DIR)/$(OPENSSL_PKG)
  14. cd $(BUILD_DIR) && tar xf $(OPENSSL_PKG)
  15. $(BUILD_DIR)/lib/libssl.a: $(OPENSSL_SRC)
  16. cd $(OPENSSL_SRC) && ./config -fPIC no-shared no-zlib --prefix=$(BUILD_DIR) && make && make install
  17. target/release/cloudflare-webui: $(BUILD_DIR)/lib/libssl.a
  18. env OPENSSL_LIB_DIR=$(BUILD_DIR)/lib OPENSSL_INCLUDE_DIR=$(BUILD_DIR)/include OPENSSL_STATIC=yes cargo build --release
  19. clean:
  20. cargo clean