shithub: neindaw

Download patch

ref: ae475783094a17ec828a9de3c1076d85860cf19d
parent: c787e8e5371c91b41172dc985d8e29fd9565f88f
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Fri Jan 17 15:09:09 EST 2020

fix gen.sh and print a warning when dsp file changed

--- a/dsp/mkfile
+++ b/dsp/mkfile
@@ -16,6 +16,9 @@
 
 </sys/src/cmd/mkmany
 
+$TARG.c: $TARG.dsp
+	echo Need to run gen.sh, $prereq changed
+
 $BIN/%:	$O.%
 	mkdir -p $BIN
 	cp $O.$stem $BIN/$stem
--- a/gen.sh
+++ b/gen.sh
@@ -1,11 +1,11 @@
 #!/bin/sh
 set -e
 
-for i in *.dsp; do
+for i in dsp/*.dsp; do
 	class=$(grep -o declare.*name.* $i | head -1 | sed 's/^[^"]*//g;s/[^A-Za-z0-9]//g')
 	test -z "$class" && echo "$i: name not set in metadata" && exit 1
 	out=$(echo $i | sed 's/dsp$/c/')
-	faust -lang c -a arch.c -cn $class $@ $i -o "$out"
+	faust -lang c -a dsp/arch.c -cn $class $@ $i -o "$out"
 	# in C () is not the same as (void) so fix it
 	sed 's/new\([^(]*\)() /new\1(void) /' -i "$out"
 	# mark "dsp", "sample_rate", and "inputs" args as USED