INSTALL=install
install:
	$(INSTALL) -m 0644 ./config.default $(HOME)/.htmleditor
	echo -n "path: " >> $(HOME)/.htmleditor
	echo $(DIR) >> $(HOME)/.htmleditor
	echo -n "project_dir: " >> $(HOME)/.htmleditor
	echo $(PROJECTS) >> $(HOME)/.htmleditor
	echo -n "image_companion: gqview " >> $(HOME)/.htmleditor
	echo -n $(DIR) >> $(HOME)/.htmleditor
	echo "/graphics/" >> $(HOME)/.htmleditor
	$(INSTALL) -m 0755 -d $(DIR)
	cp $(HOME)/.htmleditor $(DIR)/user.cfg
	$(INSTALL) -m 0700 -d $(PROJECTS)
	$(INSTALL) -m 0711 -d $(PROJECTS)/template
	$(INSTALL) -m 0711 -d $(PROJECTS)/bookmarks
	$(INSTALL) -m 0755 Coffee $(DIR)/Coffee
	$(INSTALL) -m 0644 ./template/README $(PROJECTS)/template/README
	$(INSTALL) -m 0644 ./template/test.html $(PROJECTS)/template/test.html
	$(INSTALL) -m 0644 javascript.dat $(DIR)/javascript.dat
	$(INSTALL) -m 0644 dhtml.dat $(DIR)/dhtml.dat
	$(INSTALL) -m 0644 cgi.dat $(DIR)/cgi.dat
	cp -R ./graphics $(DIR)/graphics
	$(INSTALL) -m 0755 -d $(DIR)/hot
	$(INSTALL) -m 0644 ./hot/* $(DIR)/hot/
	$(INSTALL) -m 0755 -d $(DIR)/sounds
	$(INSTALL) -m 0644 ./sounds/* $(DIR)/sounds/
	$(INSTALL) -m 0755 -d $(DIR)/iface
	$(INSTALL) -m 0644 ./iface/* $(DIR)/iface/
	@echo "To run HTML Editor++  type:  $(DIR)/Coffee &"

uninstall:
	@echo "Configuration file and projects directories will be left"
	@echo "To delete them, then run the following commandes:"
	@echo ">> rm -rf $(PROJECTS)"
	@echo ">> rm -f $(HOME)/.htmleditor"
	@echo ""
	rm -rf $(DIR)
