PROGRAM = xtitle

all:: $(PROGRAM)

$(PROGRAM):
	$(RM) $(PROGRAM)
	cat < $(PROGRAM).sh > $(PROGRAM)
	chmod a+rx $(PROGRAM)

InstallProgram($(PROGRAM),$(BINDIR))
InstallManPage($(PROGRAM),$(MANDIR))

clean::
	$(RM) $(PROGRAM)

# -----------------------------------------------------------------------
# for maintainer use only

import:
	$(CP) $(HOME)/binp/$(PROGRAM) $(PROGRAM).sh
	$(CP) $(HOME)/manp/man1/$(PROGRAM).1 $(PROGRAM).man
	$(CP) $(HOME)/manp/man1/$(PROGRAM).html .

dist:
	VER=`sed -n 's/^version=\([^ 	]*\).*/\1/p' $(PROGRAM).sh | tail -1`;\
	BASE=$(PROGRAM)-$$VER;\
	$(RM) ../$$BASE.tgz;\
	$(CP) -r ../src ../$$BASE;\
	$(RM) ../$$BASE/Makefile*;\
	z -gz -s .tgz -m 644 ../$$BASE
