# Makefile for installing DVEDIT

SHELL = /bin/sh

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

# Install directory of DVEDIT
INSTALL_DIR = /usr/local/dvedit

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

# 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
BDF_DIR = $(INSTALL_DIR)/BDF
GSF_DIR = $(INSTALL_DIR)/gsf
STY_DIR = $(INSTALL_DIR)/sty

all:
	@echo "Nothing to be done for all"
	@echo
	@echo "Edit Makefile"
	@echo "Change INSTALL_DIR and BIN_DIR (Lines 9 and 12) if necessary"
	@echo
	@echo "Edit bin/dvedit"
	@echo "Change installdir, psfontfile and stylefile (Lines 21 - 23), if necessary"
	@echo
	@echo "Edit BDF/xdevnagadd"
	@echo "Change dnfontdir (Line 5), if you change BDF_DIR (or INSTALL_DIR) above"
	@echo
	@echo "Now type \`make install' at the command prompt"

install:
	@echo "Installing ..."
	@-mkdir $(INSTALL_DIR)
	@-mkdir $(SCRIPT_DIR) $(LIB_DIR) $(IMG_DIR) $(HELP_DIR) $(DEMO_DIR) $(BDF_DIR) $(GSF_DIR) $(STY_DIR)
	@cp bin/dvedit $(SCRIPT_DIR)
	@chmod 755 $(SCRIPT_DIR)/dvedit
	@-rm $(BIN_DIR)/dvedit
	@ln -s $(SCRIPT_DIR)/dvedit $(BIN_DIR)/dvedit
	@cp lib/* $(LIB_DIR)
	@cp images/* $(IMG_DIR)
	@cp help/* $(HELP_DIR)
	@-cp examples/* $(DEMO_DIR)
	@-rm $(BDF_DIR)/*
	@cp BDF/*.bdf $(BDF_DIR)
	@-compress $(BDF_DIR)/*.bdf
	@cp BDF/xdevnagadd $(SCRIPT_DIR)
	@chmod 755 $(SCRIPT_DIR)/xdevnagadd
	@-rm $(BIN_DIR)/xdevnagadd
	@ln -s $(SCRIPT_DIR)/xdevnagadd $(BIN_DIR)/xdevnagadd
	@$(BIN_DIR)/xdevnagadd
	@cp gsf/* $(GSF_DIR)
	@cp sty/devnagari.sty $(STY_DIR)
	@echo "... Done"

# End of Makefile for dvedit
