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

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

PACKAGE := offmirror
VERSION := 1.2

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
	./bin/offmirror-test.pl .

links:	linksclean
	cd bin && for i in $(notdir $(BINS)); do $(LN_S) $$i.pl $$i; done

linksclean:
	$(RM)  $(BINS)

install: all
	./shtool install    -d $(LIBDIR)/OffMirror
	./shtool install -v -c -m 0644 $(PMS) $(LIBDIR)/OffMirror
	cd bin && for i in $(notdir $(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)/, $(notdir $(BINS)))
	$(RM) -r $(LIBDIR)/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
