VERSION = 0.9.1

TCLFILES = main.tcl parse.tcl regexp.tcl buffer.tcl command.tcl nonstd-cmds.tcl

xed: $(TCLFILES)
	perl -ne 'if (/source \"(.*)\"/) { \
			open IN, $$1; print while <IN>; close IN; \
		} else { \
			print; \
		}' main.tcl > xed
	chmod a+x xed

dist: xed
	cp -r . /tmp/xed-$(VERSION)
	rm -rf /tmp/xed-$(VERSION)/CVS \
		/tmp/xed-$(VERSION)/xed-*.tar.gz \
		/tmp/xed-$(VERSION)/*~
	(cd /tmp ; tar cvf xed-$(VERSION).tar xed-$(VERSION) )
	gzip /tmp/xed-$(VERSION).tar
	mv /tmp/xed-$(VERSION).tar.gz .
	rm -rf /tmp/xed-$(VERSION)
