## Makefile for performing launcher 0.85 installation
## Ethan Gold <etgold@cs.columbia.edu>	1/19/99
##					3/24/99
##					4/9/99
##					5/31/99

INSTALLROOT=/usr/local
HOMEDIR=$(HOME)
#ETCDIR=/etc
ETCDIR=/usr/local/etc
DOCDIR=$(INSTALLROOT)/man/man1

RM=rm -f
## GNU cp - autobackup of existing files to *.old
CP=cp -b -S ".old"
MKDIR=mkdir -p
CHMOD=chmod
MV=mv

##################################################
## do not modify below this line
## unless you know what you're doing
##################################################
CONFIG=./config.tcl
L1=launcher
L2=launcherchoice
L3=emacsw
L4=launcherconfig

MAGIC=magic.mime
TYPES=mime.types
MAP=launcher.map
MAN=launcher.1

ALLFILES=$(L1).tcl $(L2).tcl $(L3) $(L4).tcl $(MAGIC) $(TYPES) $(MAN)



default:
	@echo ""
	@echo "Please read the INSTALL file before running make."
	@echo "Available targets are:"
	@echo "	install"
	@echo "	installfilesglobal"
	@echo "	installfileslocal"
	@echo ""

all: install installfileslocal


install:
	$(CONFIG) $(L1).tcl $(L1).new $(ETCDIR)
	$(CONFIG) $(L4).tcl $(L4).new $(ETCDIR)
	$(MKDIR) $(INSTALLROOT)/bin
	$(RM) $(INSTALLROOT)/bin/$(L1) $(INSTALLROOT)/bin/$(L2)
	$(CP) $(L1).new $(INSTALLROOT)/bin/$(L1)
	$(CP) $(L2).tcl $(INSTALLROOT)/bin/$(L2)
	$(CP) $(L3) $(INSTALLROOT)/bin/$(L3)
	$(CP) $(L4).new $(INSTALLROOT)/bin/$(L4)
	$(CHMOD) 755 $(INSTALLROOT)/bin/$(L1) $(INSTALLROOT)/bin/$(L2) \
		$(INSTALLROOT)/bin/$(L4)
	$(CP) $(MAN) $(DOCDIR)


installfilesglobal:
	$(CP) $(MAGIC) $(TYPES) $(MAP) $(ETCDIR)


installfileslocal:
	$(CP) $(MAGIC) $(HOMEDIR)/.$(MAGIC)
	$(CP) $(TYPES) $(HOMEDIR)/.$(TYPES)
	$(CP) $(MAP) $(HOMEDIR)/.$(MAP)

