# Don't even THINK about changing this file. 8^)
include Make.config

VERSION		= 1.0.2

SOURCE_DIR	= $(LIB_DIR)/src
HELP_FILE	= $(LIB_DIR)/help
LEGEND_FILE	= $(LIB_DIR)/legend
LOAD_FILE	= $(SOURCE_DIR)/load.tcl"

install: uninstall tksquare
	- mkdir -p $(LIB_DIR)
	- mkdir -p $(BIN_DIR)
	cp -p tksquare $(BIN_DIR)
	cp -rp src $(LIB_DIR)/src
	cp -rp help $(LIB_DIR)/help
	cp -rp legend $(LIB_DIR)/legend
	@echo tksquare is now installed.

tksquare:
	@echo >  $@ "#! $(WISH) -f"
	@echo >> $@ "set version $(VERSION)"
	@echo >> $@ "set libDir "$(LIB_DIR)"
	@echo >> $@ "set sourceDir $(SOURCE_DIR)"
	@echo >> $@ "set helpFile $(HELP_FILE)"
	@echo >> $@ "set legendFile $(LEGEND_FILE)"
	@echo >> $@ "source $(LOAD_FILE)"
	chmod +x $@

uninstall:
	rm -rf $(LIB_DIR) tksquare $(BIN_DIR)/tksquare

clean: uninstall

tidy:
	rm -rf *~ */*~ tksquare

tar: tidy
	tar -cvf ../tksquare.$(VERSION).tar .
tar.gz: tidy
	tar -cvf ../tksquare.$(VERSION).tar .
	gzip ../tksquare.$(VERSION).tar
