diff --git a/.cargo/config b/.cargo/config new file mode 100644 index 0000000..b086373 --- /dev/null +++ b/.cargo/config @@ -0,0 +1,3 @@ +# vim: ft=toml +[build] +target-dir = "out/target" diff --git a/.gitignore b/.gitignore index 4d7b925..e79787c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ # Generated by Cargo # will have compiled files and executables debug/ -target/ +out/ # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b70edac --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +PQ_VER ?= 11.12 +SSL_VER ?= 1.1.1k + +OUT_DIR ?= out/deps + +export CC = musl-gcc -fPIC -pie -static + +# TODO check for header files (openssl-dev, libpq-dev) both for Arch & Ubuntu + + +all: openssl +.PHONY: all + + +# =====OPENSSL===== +# Download the source code +$(OUT_DIR)/openssl-$(SSL_VER)/Configure: + mkdir -p '$(OUT_DIR)' + curl -sSL "https://www.openssl.org/source/openssl-$(SSL_VER).tar.gz" | \ + tar -C "$(OUT_DIR)" -xz + +# Build OpenSSL +openssl: $(OUT_DIR)/openssl-$(SSL_VER)/Configure +.PHONY: openssl