### dir these files live in
SRC=/usr/local/src/arTCLs
### place to install scripts invoked directly by the user
BIN=/usr/local/bin
### place to install scripts sourced by those in $(BIN)
ARTCLSLIB=/usr/local/lib/artcls
### ln on your system
LN=ln -s

###########################

B_FILES=artcls filesaver
S_FILES=defaultProfile.t filterSubject.t hdr.t listBoxHelper.t \
makeMenuBar.t menuBind.t nntp.t pagerCreate.t referencePager.t \
setProfile.t showMsg.t text.t timer.t

REL_FILES=$(B_FILES) $(S_FILES) Makefile artcls.1

TFILE=artcls.tar

usage:
	@echo ""
	@echo "	modify the top of the makefile to your liking"
	@echo "	then do a 'make install'"
	@echo ""

install: cp_install

backup: package

package:
	-mkdir ./arTCLs
	cp $(REL_FILES) arTCLs/
	tar cvf - arTCLs|compress|uuencode $(TFILE).Z>$(TFILE).Z.uu
	rm -rf ./arTCLs

set_libnames:
	cp artcls artcls.BAK
	cat artcls.BAK | sed -e \
	's,^.*#SEDMARK.*$$,set Profile(ArtclsLib) $(ARTCLSLIB);#SEDMARK,' \
	>artcls
	cp text.t text.t.BAK
	cat text.t.BAK | sed -e \
	's,^.*#SEDMARK.*$$,set Profile(ArtclsLib) $(ARTCLSLIB);#SEDMARK,' \
	>text.t

rm_bins:
	rm -f $(BIN)/artcls $(BIN)/filesaver

cp_install: rm_bins set_libnames
	cp $(B_FILES) $(BIN)
	-if [ $(ARTCLSLIB) != $(SRC) ]; then mkdir $(ARTCLSLIB) ; fi
	if [ $(ARTCLSLIB) != $(SRC) ]; then cp $(S_FILES) $(ARTCLSLIB)/ ; fi
