SRCS	:= $(wildcard *.pl *.pod OffMirror/*.pm)
SRCS	:= $(filter-out offmirror-test.pl, $(SRCS))

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

PACKAGE := offmirror
VERSION := 1.0

include constants.make
include progs.make
include dirs.make
NOPMMANS := yes
include pod-vars.make

BINS	:= $(basename $(PLS))

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

.PHONY:	all none test clean man txt html tex \
	config configclean links linksclean .cvsignore .cvsignoreclean \
	install uninstall dist distclean


.SUFFIXES:
.INTERMEDIATE: %.pod


all:	gzman

test:	links
	./offmirror-test.pl .

links:
	for i in $(BINS); do $(LN_S) $$i.pl $$i; done

linksclean:
	$(RM)  $(BINS);

install: all
	./shtool install    -d $(BINDIR)/OffMirror
	./shtool install -v -c -m 0644 $(PMS) $(BINDIR)/OffMirror
	for i in $(BINS); do ./shtool install -v -c $$i.pl $(BINDIR)/$$i; done
	./shtool install    -d $(MAN1DIR)
	./shtool install -v -c -m 0644 $(GZMAN1S) $(MAN1DIR)

uninstall:
	$(RM) $(addprefix $(MAN1DIR)/, $(GZMAN1S))
	$(RM) $(addprefix $(BINDIR)/, $(BINS))
	$(RM) -r $(BINDIR)/OffMirror

clean distclean: linksclean
	$(RM) $(GZMANS) $(MANS) $(TXTS) $(TEXS) $(HTMLS)
	$(RM) pod2html-{dir,item}cache *.gz


dist: distclean
	./shtool tarball -v -o $(PACKAGE)-$(VERSION).tar.gz -c 'gzip -9' .

none config lib .cvsignore .cvsignoreclean:

include pod-rules.make

#end
