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

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

PACKAGE := offmirror
VERSION := 2.0

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

INSTALL = ./shtool install

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 . # -no-user-group -verbose -no-clean

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

linksclean:
	@$(RM)  $(BINS)

install: all
	$(INSTALL)    -d $(LIBDIR)/OffMirror
	$(INSTALL) -v -c -m 0644 $(PMS) $(LIBDIR)/OffMirror
	$(INSTALL)    -d $(BINDIR)
	cd bin && for i in $(notdir $(BINS)); do ../$(INSTALL) -v -c $$i.pl $(BINDIR)/$$i; done
	$(INSTALL)    -d $(MAN1DIR)
	$(INSTALL) -v -c -m 0644 $(GZMAN1S) $(MAN1DIR)
	$(INSTALL)    -d $(PREFIX)/share/offmirror/contrib
	$(INSTALL) -v -c contrib/mirrorer $(PREFIX)/share/offmirror/contrib

uninstall:
	$(RM) $(addprefix $(MAN1DIR)/, $(GZMAN1S))
	$(RM) $(addprefix $(BINDIR)/, $(notdir $(BINS)))
	$(RM) -r $(LIBDIR)/OffMirror
	$(RM) -r $(PREFIX)/share/offmirror

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


none config lib .cvsignore .cvsignoreclean:

include pod-rules.make
include dist-rules.make

#end
