diff --git a/.gitignore b/.gitignore index 0c3fa56c..ff7df192 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -/.rust/ /doc/ /build/ +/Makefile diff --git a/Makefile b/Makefile.in similarity index 90% rename from Makefile rename to Makefile.in index 7a1d064b..fc694754 100644 --- a/Makefile +++ b/Makefile.in @@ -1,6 +1,7 @@ RUSTC = rustc BUILDDIR = build RUSTFLAGS = -O -Z debug-info +INSTALL_DIR = %PREFIX% OPENSSL_LIB = lib.rs OPENSSL = $(BUILDDIR)/$(shell $(RUSTC) --crate-file-name $(OPENSSL_LIB)) @@ -30,6 +31,9 @@ clean: doc: $(OPENSSL) rustdoc $(OPENSSL_LIB) +install: $(OPENSSL) + install $(OPENSSL) $(INSTALL_DIR) + print-target: @echo $(OPENSSL) diff --git a/configure b/configure new file mode 100755 index 00000000..55cf6a0b --- /dev/null +++ b/configure @@ -0,0 +1,18 @@ +#!/bin/bash + +TEMP=`getopt -o "" --long prefix: -n "$0" -- "$@"` + +if [ $? != 0 ]; then exit 1; fi + +eval set -- "$TEMP" + +PREFIX=/usr/lib + +while true ; do + case "$1" in + --prefix) PREFIX=$2; shift 2;; + --) shift; break;; + esac +done + +sed -e "s|%PREFIX%|$PREFIX|" < Makefile.in > Makefile