I just started reading about literate programming and noweb
- and I find it quite interesting. As far as I understand it, the 'notangle
' step is the one that extracts (machine) source code (file), from the literal programming (source) file.
Here, I'm interested in one specific aspect: I would like to be able to extract multiple source files in one pass (in the notangle
step) , including an execution script - and run the execution script in the same step!
An example in bash would look something like this:
#!/usr/bin/env bash
# file: test.c.gdb.sh
# generate C source file
cat > test.c <<"EOF"
#include "stdio.h"
int main(void) {
return 0;
}
EOF
# generate gdb script file
cat > test.gdb <<"EOF"
break main
run
EOF
# run the 'execution script'
gcc -g -Wall test.c -o test.exe
chmod +x test.exe
gdb -x test.gdb -se test.exe
The point in this, is that I can just call './test.c.gdb.sh
' from the shell, and I'll have the source files generated, then compiled, and then have the debugger started automatically.
Is there a literate programming tool, that would allow something like this in the notangle
step?
Thanks in advance for any answers,
Cheers!