Add a configure script and an install target

This commit is contained in:
Steven Fackler 2014-01-20 20:20:10 -08:00
parent 37240b51f5
commit e2554ea6af
3 changed files with 23 additions and 1 deletions

2
.gitignore vendored
View File

@ -1,3 +1,3 @@
/.rust/
/doc/
/build/
/Makefile

View File

@ -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)

18
configure vendored Executable file
View File

@ -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