
.PHONY: test-parser test-ast compare-ast clean

all :

%.suif : %.strl
	strl2suif $<

%.ast : %.strl
	strl2suif -ast $*.ast $<

STRL_SRCS = abcd.strl \
atds-100.strl \
dacexample.strl \
mca200.strl \
nothing.strl \
runner.strl \
tcint.strl \
testall.strl \
ww.strl

test-parser : $(STRL_SRCS:%.strl=%.suif)

test-ast : $(STRL_SRCS:%.strl=%.ast) compare-ast

compare-ast : $(STRL_SRCS:%.strl=%.ast)
	for file in $(STRL_SRCS:%.strl=%); do \
		diff $$file.ast-golden $$file.ast && echo $$file PASSED || echo $$file FAILED; \
	done

CLEAN_RULE = defined
clean :
	rm -f *.suif *.ast

include $(NCIHOME)/Makefile.std
