all: nusmerge test-write

nusmerge: main.rb Makefile
	which ruby | sed 's/^/#!/' > tmp
	cat	../libexec/nusdas/nusrecstream.rb >> tmp
	grep -v 'require .nu'	main.rb >> tmp
	mv tmp $@
	chmod 755 $@

test-write: test-write.c ../src/libnusdas.a
	cc -g -o test-write -I../src test-write.c -L../src -lnusdas

test: NUSDAS10/nusdas_def/test.def test-main.sh
	sh test-main.sh
	sh test-verify.sh

NUSDAS10/nusdas_def/test.def: test-write test-creat.sh
	sh test-creat.sh

clean:
	rm -rf NUSDAS* TIMECARD test-write nusmerge merge.nus *.dump
