aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-07-02 16:59:45 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-07-02 16:59:45 -0700
commitda98d5314731206cd03038d589d10c5c32a0ce8c (patch)
tree4b7dd002a5edda8f2e6561c29bf6aee80a3e9303
parent94ed05fe4df6a657884596bdabd03c7666a63de7 (diff)
downloadcppawk-da98d5314731206cd03038d589d10c5c32a0ce8c.tar.gz
cppawk-da98d5314731206cd03038d589d10c5c32a0ce8c.tar.bz2
cppawk-da98d5314731206cd03038d589d10c5c32a0ce8c.zip
Restructure cppawk installation.
cppawk now expects to be installed in some directory (typically "bin"), such that the include files are in a "share/cppawk/include" directory where "share" is a sibling of "bin". The git repository is restructured to match this shape; cppawk is moved into "bin", and the include files into "share/cppawk/include".
-rw-r--r--INSTALL25
-rwxr-xr-xbin/cppawk (renamed from cppawk)5
-rwxr-xr-xruntests30
-rw-r--r--share/cppawk/include/array.h (renamed from cppawk-include/array.h)0
-rw-r--r--share/cppawk/include/base.h (renamed from cppawk-include/base.h)0
-rw-r--r--share/cppawk/include/case-priv.h (renamed from cppawk-include/case-priv.h)0
-rw-r--r--share/cppawk/include/case.h (renamed from cppawk-include/case.h)0
-rw-r--r--share/cppawk/include/cons-priv.h (renamed from cppawk-include/cons-priv.h)0
-rw-r--r--share/cppawk/include/cons.h (renamed from cppawk-include/cons.h)0
-rw-r--r--share/cppawk/include/field.h (renamed from cppawk-include/field.h)0
-rw-r--r--share/cppawk/include/fun-priv.h (renamed from cppawk-include/fun-priv.h)0
-rw-r--r--share/cppawk/include/fun.h (renamed from cppawk-include/fun.h)0
-rw-r--r--share/cppawk/include/iter-priv.h (renamed from cppawk-include/iter-priv.h)0
-rw-r--r--share/cppawk/include/iter.h (renamed from cppawk-include/iter.h)0
-rw-r--r--share/cppawk/include/narg-priv.h (renamed from cppawk-include/narg-priv.h)0
-rw-r--r--share/cppawk/include/narg.h (renamed from cppawk-include/narg.h)0
-rw-r--r--share/cppawk/include/varg-priv.h (renamed from cppawk-include/varg-priv.h)0
-rw-r--r--share/cppawk/include/varg.h (renamed from cppawk-include/varg.h)0
18 files changed, 35 insertions, 25 deletions
diff --git a/INSTALL b/INSTALL
index fa6bd43..6d10143 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,14 +1,23 @@
Installing cppawk
-----------------
-A cppawk installation consists of the cppawk script accompanied by
-the cppawk-include directory containing the cppawk headers.
-This directory is placed in the same directory as cppawk, side by side.
+A cppawk installation consists of the cppawk script accompanied by the
+an include directory containing the cppawk headers.
-For instance, /usr/local/bin/cppawk and /usr/local/bin/cppawk-include/.
+cppawk determines the directory in which it is located, calling that
+directory selfdir. Then it instructs the preprocessor to look for
+headers in $selfdir/../share/cppawk/include. For instance, if cppawk is
+installed as /usr/local/bin/cppawk, it expects its header library to be
+in the /usr/local/share/cppawk/include directory.
+
+Steps to install cppawk as /path/to/installation/cppawk/bin might be:
# root=/path/to/installation
-# install -d ${root}
-# install cppawk ${root}
-# cp -r cppawk-include ${root}
-# chmod -R a+rX,go-w ${root}
+# install -d ${root}/bin
+# install -d ${root}/share/cppawk/include
+# install cppawk ${root}/bin
+# install share/cppawk/include/*.h ${root}/share/cppawk/include
+
+Historic note: originally, cppawk expected the include direcgtory
+to be called cppawk-include, and to be located in the same directory
+as itself.
diff --git a/cppawk b/bin/cppawk
index b965dad..e5c95dc 100755
--- a/cppawk
+++ b/bin/cppawk
@@ -46,7 +46,8 @@ awk_file=
awk_opts=
tmp_file=
prepro_only=
-selfdir=$(dirname "$0")
+
+selfdir="$(dirname "$0")"
# functions
@@ -115,7 +116,7 @@ collapse()
printf("%s\n", line); }'
}
-prepro_opts="$prepro_opts -I$selfdir/cppawk-include"
+prepro_opts="$prepro_opts -I$selfdir/../share/cppawk/include"
while [ $# -gt 0 ] ; do
case $1 in
diff --git a/runtests b/runtests
index 339dcd2..f060349 100755
--- a/runtests
+++ b/runtests
@@ -4,40 +4,40 @@ trap 'rm -f output script.sh' EXIT INT TERM
suite=$1
if [ -z "$suite" ] ; then
- cppawk=./cppawk ./testsuite.awk testcases
- cppawk="./cppawk --nobash" ./testsuite.awk testcases
+ cppawk=./bin/cppawk ./testsuite.awk testcases
+ cppawk="./bin/cppawk --nobash" ./testsuite.awk testcases
fi
if [ -z "$suite" -o "$suite" = "case" ] ; then
- cppawk=./cppawk ./testsuite.awk testcases-case
- cppawk="./cppawk --awk=mawk" ./testsuite.awk testcases-case
+ cppawk=./bin/cppawk ./testsuite.awk testcases-case
+ cppawk="./bin/cppawk --awk=mawk" ./testsuite.awk testcases-case
fi
if [ -z "$suite" -o "$suite" = "narg" ] ; then
- cppawk=./cppawk ./testsuite.awk testcases-narg
+ cppawk=./bin/cppawk ./testsuite.awk testcases-narg
fi
if [ -z "$suite" -o "$suite" = "iter" ] ; then
- cppawk=./cppawk ./testsuite.awk testcases-iter
- cppawk="./cppawk --awk=mawk" ./testsuite.awk testcases-iter
+ cppawk=./bin/cppawk ./testsuite.awk testcases-iter
+ cppawk="./bin/cppawk --awk=mawk" ./testsuite.awk testcases-iter
fi
if [ -z "$suite" -o "$suite" = "varg" ] ; then
- cppawk=./cppawk ./testsuite.awk testcases-varg
- cppawk="./cppawk --awk=mawk" ./testsuite.awk testcases-varg
+ cppawk=./bin/cppawk ./testsuite.awk testcases-varg
+ cppawk="./bin/cppawk --awk=mawk" ./testsuite.awk testcases-varg
fi
if [ -z "$suite" -o "$suite" = "cons" ] ; then
- cppawk=./cppawk ./testsuite.awk testcases-cons
- cppawk="./cppawk --awk=mawk" ./testsuite.awk -v skip=37,38 testcases-cons
+ cppawk=./bin/cppawk ./testsuite.awk testcases-cons
+ cppawk="./bin/cppawk --awk=mawk" ./testsuite.awk -v skip=37,38 testcases-cons
fi
if [ -z "$suite" -o "$suite" = "field" ] ; then
- cppawk=./cppawk ./testsuite.awk testcases-field
- cppawk="./cppawk --awk=mawk" ./testsuite.awk testcases-field
+ cppawk=./bin/cppawk ./testsuite.awk testcases-field
+ cppawk="./bin/cppawk --awk=mawk" ./testsuite.awk testcases-field
fi
if [ -z "$suite" -o "$suite" = "array" ] ; then
- cppawk=./cppawk ./testsuite.awk testcases-array
- cppawk="./cppawk --awk=mawk" ./testsuite.awk -v skip=5,6 testcases-array
+ cppawk=./bin/cppawk ./testsuite.awk testcases-array
+ cppawk="./bin/cppawk --awk=mawk" ./testsuite.awk -v skip=5,6 testcases-array
fi
diff --git a/cppawk-include/array.h b/share/cppawk/include/array.h
index f3b7a22..f3b7a22 100644
--- a/cppawk-include/array.h
+++ b/share/cppawk/include/array.h
diff --git a/cppawk-include/base.h b/share/cppawk/include/base.h
index 4012d95..4012d95 100644
--- a/cppawk-include/base.h
+++ b/share/cppawk/include/base.h
diff --git a/cppawk-include/case-priv.h b/share/cppawk/include/case-priv.h
index 825ed1b..825ed1b 100644
--- a/cppawk-include/case-priv.h
+++ b/share/cppawk/include/case-priv.h
diff --git a/cppawk-include/case.h b/share/cppawk/include/case.h
index d5ed331..d5ed331 100644
--- a/cppawk-include/case.h
+++ b/share/cppawk/include/case.h
diff --git a/cppawk-include/cons-priv.h b/share/cppawk/include/cons-priv.h
index 172f20f..172f20f 100644
--- a/cppawk-include/cons-priv.h
+++ b/share/cppawk/include/cons-priv.h
diff --git a/cppawk-include/cons.h b/share/cppawk/include/cons.h
index f120c0c..f120c0c 100644
--- a/cppawk-include/cons.h
+++ b/share/cppawk/include/cons.h
diff --git a/cppawk-include/field.h b/share/cppawk/include/field.h
index a18000d..a18000d 100644
--- a/cppawk-include/field.h
+++ b/share/cppawk/include/field.h
diff --git a/cppawk-include/fun-priv.h b/share/cppawk/include/fun-priv.h
index 0f92a44..0f92a44 100644
--- a/cppawk-include/fun-priv.h
+++ b/share/cppawk/include/fun-priv.h
diff --git a/cppawk-include/fun.h b/share/cppawk/include/fun.h
index 6600609..6600609 100644
--- a/cppawk-include/fun.h
+++ b/share/cppawk/include/fun.h
diff --git a/cppawk-include/iter-priv.h b/share/cppawk/include/iter-priv.h
index 946c874..946c874 100644
--- a/cppawk-include/iter-priv.h
+++ b/share/cppawk/include/iter-priv.h
diff --git a/cppawk-include/iter.h b/share/cppawk/include/iter.h
index 53bb43f..53bb43f 100644
--- a/cppawk-include/iter.h
+++ b/share/cppawk/include/iter.h
diff --git a/cppawk-include/narg-priv.h b/share/cppawk/include/narg-priv.h
index bee5300..bee5300 100644
--- a/cppawk-include/narg-priv.h
+++ b/share/cppawk/include/narg-priv.h
diff --git a/cppawk-include/narg.h b/share/cppawk/include/narg.h
index b757f41..b757f41 100644
--- a/cppawk-include/narg.h
+++ b/share/cppawk/include/narg.h
diff --git a/cppawk-include/varg-priv.h b/share/cppawk/include/varg-priv.h
index d71b500..d71b500 100644
--- a/cppawk-include/varg-priv.h
+++ b/share/cppawk/include/varg-priv.h
diff --git a/cppawk-include/varg.h b/share/cppawk/include/varg.h
index c0ff036..c0ff036 100644
--- a/cppawk-include/varg.h
+++ b/share/cppawk/include/varg.h