From 1a65ae278e81946ec3a8af43b1f6f18c26e1161a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 13 Jul 2009 16:07:25 -0400 Subject: rvs-0.6.1 -- make it possible to compile from another directory --- Makefile.orig | 3 ++- README | 8 +++----- Variables | 2 +- configure | 9 ++++++--- docs/README.xhtml | 6 +++--- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Makefile.orig b/Makefile.orig index 00c3354..8bc4006 100644 --- a/Makefile.orig +++ b/Makefile.orig @@ -18,6 +18,7 @@ SHELL = $$SHELL$$ prefix = $$prefix$$ bindir = $$bindir$$ libdir = $$libdir$$ +sourcedir = @@sourcedir@@ # Targets ########################################################## rvs : wrapper core @@ -44,7 +45,7 @@ f : lib out/rvs-core/commit.f out/rvs-core/get.f lib: out/rvs-core/lib/stdio out/rvs-core/lib/rvsdb -out/% : source/% tmp/var.sed +out/% : $(sourcedir)/source/% tmp/var.sed tmp/var.sed <$< > $@ clean : diff --git a/README b/README index d208edb..790d9f6 100644 --- a/README +++ b/README @@ -31,11 +31,9 @@ does. To build rvs with default configuration, simply run: $ make # make install It's generally considered good practice to build in another directory -than the source directory, however, this is not the case fo rvs. In -fact, it must be build in the source directory. You needn't be -worried about it making the source direcotory messy, all source is -kept in `DIR/source', all finished files in `DIR/out', and all -temporary build files in `DIR/tmp'. +than the source directory. This is not nescessary in rvs , all the +created file are put in another directory anyway. If you would still +like to do this, it can be done in rvs-0.6.1 and up. === 2.1: Configuration There are several configuration variables that can be set. The default diff --git a/Variables b/Variables index dacb7a9..738e803 100644 --- a/Variables +++ b/Variables @@ -1,4 +1,4 @@ -VER '0.6.0' +VER '0.6.1' SHELL '/usr/bin/env bash' prefix "$HOME" bindir 'bin' diff --git a/configure b/configure index 35c7b76..256a15b 100755 --- a/configure +++ b/configure @@ -9,6 +9,8 @@ # # Originally written by Luke Shumaker . +sourcedir=`dirname "$0"` + while [ $# -gt 0 ]; do case "$1" in --*) var0=`echo "$1" | sed -e 's/^--//' -e 's/=.*$//'` @@ -49,11 +51,12 @@ while read line; do echo 's/$$'"${var}"'$\$/'"${val}"'/' >> tmp/var.sed #sed -i.bak 's/$$'"${var}"'$\$/'"${val}"'/' "$files" unset var val -done < Variables +done < "$sourcedir/Variables" chmod +x tmp/var.sed -tmp/var.sed < Makefile.orig > Makefile +tmp/var.sed < "$sourcedir/Makefile.orig" > Makefile n0='# DO NOT edit this file, it has been generated by configure, and will be' n1='# overwritten. Instead, edit the file `Makefile.orig'\' -sed -i -e "10 a$n0" -e "10 a$n1" Makefile +sourcedir=`echo "$sourcedir" | sed 's:/:\\\\/:g'` +sed -i -e "10 a$n0" -e "10 a$n1" -e "s/@@sourcedir@@/$sourcedir/" Makefile diff --git a/docs/README.xhtml b/docs/README.xhtml index ded2de0..e74e2b8 100644 --- a/docs/README.xhtml +++ b/docs/README.xhtml @@ -89,12 +89,12 @@
  • one can use any lanugage to write new modules, without having to worry about bindings
  • build system

    -

    The build system rvs uses is rather simple. ./configure does 2 things, create a preprocessor in tmp/var.sed, and generate a Makefile with this preprocessor from Makefile.orig. Then, the Makefile (among other things), runs each source file through the preprocessor.

    +

    The build system rvs uses is rather simple. ./configure does 2 things, create a preprocessor in tmp/var.sed, and generate a Makefile with this preprocessor from Makefile.orig. Then, the Makefile (among other things), runs each source file through the preprocessor.

    preprocessor/variables

    -

    You know the configuration variables described in README? Part of the build process involves running all source files through a pre-processor (kept in tmp/var.sed). This preproccessor allows you to reference the configuration variables in any file in source/ or Makefile. Any instance of $$VAR_NAME$$ will be repleced by the value of the variable.

    +

    You know the configuration variables described in README? Part of the build process involves running all source files through a pre-processor (kept in tmp/var.sed). This preproccessor allows you to reference the configuration variables in any file in source/ or Makefile. Any instance of $$VAR_NAME$$ will be repleced by the value of the variable. Note that only defined variables will be replaced.

    known bugs