SHELL=/bin/bash

SCRIPTS=DirectMarkUP.cgi DirectUndo.cgi MakeDirectForm.pl
MODULES=DirectMarkUP.pm DirectMarkUP.pl cgi-lib.pl HTMLParser.pm
MISC=READ.ME COPYING DirectMarkUP.html Sample.html updateform.html direct.gif
DEVL=Makefile Sample1.html DirectMarkUP_ HTMLParser_ dumpHTML.pl std

DISTFILES=$(SCRIPTS) $(MODULES) $(MISC) $(DEVL)
DEVLFILES=$(SCRIPTS) $(MODULES) $(MISC) $(DEVL)
VERSION=3.0

all: rel dist dev

rel: release
release:
	cp -R $(DISTFILES) cgi-bin

package: dist
dist: DirectMarkUP-$(VERSION).tar.gz DirectMarkUP-$(VERSION).ZIP

DirectMarkUP-$(VERSION).ZIP: $(DISTFILES)
	$(MAKE) rel
	cd cgi-bin;zip DirectMarkUP-$(VERSION).ZIP $(DISTFILES)
	mv cgi-bin/DirectMarkUP-$(VERSION).ZIP .

DirectMarkUP-$(VERSION).tar.gz: $(DISTFILES)
	$(MAKE) rel
	cd cgi-bin;tar -zcvf DirectMarkUP-$(VERSION).tar.gz $(DISTFILES)
	mv cgi-bin/DirectMarkUP-$(VERSION).tar.gz .
test:
	./DirectMarkUP_
	./HTMLParser_

dev: backup
backup: DirectMarkUP-dev-$(VERSION).tar.gz

DirectMarkUP-dev-$(VERSION).tar.gz: $(DEVLFILES)
	tar -zcvf DirectMarkUP-dev-$(VERSION).tar.gz $(DEVLFILES)
