# Makefile for installing BWEDIT

SHELL = /bin/sh

# Edit the following two variable settings if you want to
# install the library and the executible elsewhere

# Install directory of BWEDIT
INSTALL_DIR = /usr/local/bwedit

# Directory for installing symbolic link to bwedit
BIN_DIR = /usr/local/bin

# Directory for installing bwedit manpage
MAN_DIR = /usr/local/man/man1

# Don't edit after this line

SCRIPT_DIR = $(INSTALL_DIR)/bin
LIB_DIR = $(INSTALL_DIR)/lib
IMG_DIR = $(INSTALL_DIR)/images
HELP_DIR = $(INSTALL_DIR)/help
DEMO_DIR = $(INSTALL_DIR)/examples

all:
	@echo "Nothing to be done for all"
	@echo
	@echo "Edit Makefile"
	@echo "Change INSTALL_DIR, BIN_DIR and MAN_DIR (Lines 9, 12 and 15) if necessary"
	@echo
	@echo "Edit bin/bwedit"
	@echo "Change installdir and psfontfile (Lines 21 and 22), again if necessary"
	@echo
	@echo "Now type \`make install' at the command prompt"
	@echo "\`make installman' installs the manpage of bwedit"

install:
	@echo "Installing ..."
	@-mkdir $(INSTALL_DIR)
	@-mkdir $(SCRIPT_DIR) $(LIB_DIR) $(IMG_DIR) $(HELP_DIR) $(DEMO_DIR)
	@cp bin/bwedit $(SCRIPT_DIR)
	@chmod 755 $(SCRIPT_DIR)/bwedit
	@-rm $(BIN_DIR)/bwedit
	@ln -s $(SCRIPT_DIR)/bwedit $(BIN_DIR)/bwedit
	@cp lib/* $(LIB_DIR)
	@cp images/* $(IMG_DIR)
	@cp help/* $(HELP_DIR)
	@cp examples/* $(DEMO_DIR)
	@echo "... Done"

installman:
	@cp bwedit.1 $(MAN_DIR)
