CC=gcc
CFLAGS=-Wall
SCMWAVEFORMS := $(wildcard waveforms/*.scm)
MIFWAVEFORMS := $(patsubst %.scm, %.mif, $(SCMWAVEFORMS))
GUILE_OPTIONS := --no-auto-compile

.PHONY: all
all: $(MIFWAVEFORMS)

processor.scm: trig_cont.vhd parse_processor.awk
	awk -f parse_processor.awk trig_cont.vhd > processor.scm

%.mif: %.scm common.scm processor.scm
	guile $(GUILE_OPTIONS) -s $< > $@

.PHONY: clean
clean:
	rm -f *.mif processor.scm *~ waveforms/*.mif waveforms/*~ || true
