SRC = erosion.dsp
IMGIN = letter_j.png
LINES = 150

BASENAME = output
FORMAT = csv
CSVIN = $(IMGIN:.png=.csv)
CSVOUT = $(BASENAME)1.$(FORMAT)
IMGOUT = $(SRC:.dsp=.png)

all: $(IMGOUT)

$(IMGOUT): $(CSVOUT)
	octave -qf img_write.m

$(CSVOUT): $(SRC) $(CSVIN)
	faustine -f $(SRC) -i $(CSVIN) -l $(LINES) > $@

$(CSVIN): $(IMGIN)
	octave -qf img_read.m

clean::
	rm -f gmon.out $(IMGOUT) $(BASENAME)*