diff options
-rw-r--r-- | Makefile.orig | 3 | ||||
-rw-r--r-- | README | 8 | ||||
-rw-r--r-- | Variables | 2 | ||||
-rwxr-xr-x | configure | 9 | ||||
-rw-r--r-- | 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 : @@ -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 @@ -1,4 +1,4 @@ -VER '0.6.0' +VER '0.6.1' SHELL '/usr/bin/env bash' prefix "$HOME" bindir 'bin' @@ -9,6 +9,8 @@ # # Originally written by Luke Shumaker <lukeshu@sbcglobal.net>. +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 @@ <li>one can use any lanugage to write new modules, without having to worry about bindings</li> </ol> <h3>build system</h3> -<p>The build system rvs uses is rather simple. <kbd>./configure</kbd> does 2 things, create a preprocessor in <kbd>tmp/var.sed</kbd>, and generate a <kbd>Makefile</kbd> with this preprocessor from <a href="../Makefile.orig"><kbd>Makefile.orig</kbd></a>. Then, the <kbd>Makefile</kbd> (among other things), runs each source file through the preprocessor.</p> +<p>The build system rvs uses is rather simple. <kbd>./configure</kbd> does 2 things, create a preprocessor in <kbd>tmp/var.sed</kbd>, and generate a <kbd>Makefile</kbd> with this preprocessor from <a href="../Makefile.orig"><kbd>Makefile.orig</kbd></a>. Then, the <kbd>Makefile</kbd> (among other things), runs each source file through the preprocessor.</p> <h4>preprocessor/variables</h4> -<p>You know the configuration variables described in <a href="../README"><kbd>README</kbd></a>? Part of the build process involves running all source files through a pre-processor (kept in <kbd>tmp/var.sed</kbd>). This preproccessor allows you to reference the configuration variables in any file in <kbd>source/</kbd> or <a href="../Makefile"><kbd>Makefile</kbd></a>. Any instance of <samp>$$VAR_NAME$$</samp> will be repleced by the value of the variable.</p> +<p>You know the configuration variables described in <a href="../README"><kbd>README</kbd></a>? Part of the build process involves running all source files through a pre-processor (kept in <kbd>tmp/var.sed</kbd>). This preproccessor allows you to reference the configuration variables in any file in <kbd>source/</kbd> or <a href="../Makefile"><kbd>Makefile</kbd></a>. Any instance of <samp>$$VAR_NAME$$</samp> will be repleced by the value of the variable. Note that only defined variables will be replaced.</p> <h3>known bugs</h3> <ul> - <li>borks on files with the newline character. The smart thing to do would be to escape all speacial characters. + <li>borks on files with the newline character. The smart thing to do would be to escape all speacial characters. <br />Files to be changed:<ul> <li><kbd>soruce/rvs-core/commit</kbd></li> <li><kbd>soruce/rvs-core/commit.d</kbd></li> |