summary refs log tree commit diff
path: root/build-aux
diff options
context:
space:
mode:
authorArun Isaac2021-11-04 14:51:36 +0530
committerArun Isaac2021-11-04 15:42:49 +0530
commit88e842958168e149b1d958e1695d4ecc1256812f (patch)
tree62d6e71f699088fdfac56d71fec5b11338cc23f1 /build-aux
parent228298decc0a7add154e78213d557da6602c0e5c (diff)
downloadccwl-88e842958168e149b1d958e1695d4ecc1256812f.tar.gz
ccwl-88e842958168e149b1d958e1695d4ecc1256812f.tar.lz
ccwl-88e842958168e149b1d958e1695d4ecc1256812f.zip
build-aux: Use paths relative to top-level in generate-cwl-output.sh.
This removes the assumption that the source tree and the build tree
are the same, and is required to support VPATH builds.

* build-aux/generate-cwl-output.sh.in: Accept and write to paths
relative to the top-level directory. Do not change directory.
* Makefile.am (doc/capture-output-file.out,
doc/capture-output-file-with-parameter-reference.out,
doc/checksum.out, doc/decompress-compile-run.out, doc/pass-stdin.out):
Pass relative paths in input arguments.
Diffstat (limited to 'build-aux')
-rwxr-xr-xbuild-aux/generate-cwl-output.sh.in17
1 files changed, 11 insertions, 6 deletions
diff --git a/build-aux/generate-cwl-output.sh.in b/build-aux/generate-cwl-output.sh.in
index ca5803e..8eb36c9 100755
--- a/build-aux/generate-cwl-output.sh.in
+++ b/build-aux/generate-cwl-output.sh.in
@@ -20,18 +20,23 @@
 
 set -o pipefail
 
-cwl_file=$(basename $1)
+cwl_file=$1
 shift
 
-cd doc
 output_file=$(basename $cwl_file .cwl).out
 {
-    echo "\$ ccwl compile $(basename $cwl_file .cwl).scm > $cwl_file"
-    echo "\$ cwltool $cwl_file $@"
+    echo "\$ ccwl compile $(basename $cwl_file .cwl).scm > $(basename $cwl_file)"
+    echo -n "\$ cwltool $(basename $cwl_file) "
+    for arg in $@
+    do
+        echo -n "${arg#doc/} "
+    done
+    echo
+
     # On Guix, workflows involving gcc need to preserve the
     # LIBRARY_PATH environment variable.
-    @CWLTOOL@ --preserve-environment LIBRARY_PATH --outdir cwl-output $cwl_file "$@" 2>&1 \
+    @CWLTOOL@ --preserve-environment LIBRARY_PATH --outdir doc/cwl-output $cwl_file "$@" 2>&1 \
         | @SED@ '1,2d' \
         | @SED@ 's|\[1;30mINFO\[0m ||g' \
         | @SED@ "s|$(pwd)|/home/manimekalai|g"
-} > $output_file
+} > doc/$output_file