#all: M8340X.PLD M8340.v script-sync
#all: M8341X.PLD M8341.v script-sync
all: BM8L.PLD BM8L.v script-sync
BDIR = ../../Mxxx/M8341/pld

%.txt: ../%.txt
	cp $< $@

%.PLD: %pins.txt %prts.txt topld.pl
	./topld.pl $(@:.PLD=)

%X.PLD: %.PLD smaller.pl
	./smaller.pl $< >vv
	./smaller.pl vv >$@

%.v: %X.PLD cupl2v.pl
	./cupl2v.pl $< >$@

script-sync:
	diff cupl2v.pl $(BDIR)
	diff rom2cupl.pl $(BDIR)
	diff rom2pld.pl $(BDIR)
	diff smaller.pl $(BDIR)
	diff topld.pl $(BDIR)
