##
##	Ohio Trollius
##	Copyright 1997 The Ohio State University
##
##	Function:	- man pages
##

DEPTH   = ..

MDIR	= $(LAMHOME)/man

SUBDIR	= man1 man2 man3 man5 man7 share

##
## global configuration
##
include $(DEPTH)/config.mk

all: dirs

clean:

depend: dirs

install: dirs subdirs $(MDIR)/windex $(MDIR)/whatis

dirs:
	@if test ! -d $(MDIR); then mkdir -p $(MDIR); fi
	@for i in $(SUBDIR); do \
		if test ! -d $(MDIR)/$$i; then mkdir -p $(MDIR)/$$i; fi \
	done

subdirs:
	@for i in $(SUBDIR); do \
		(cd $$i; echo "	"$$i: ; $(MAKE) install) || exit 1; \
	done

#
# dependencies
#
$(MDIR)/windex: windex
	$(RM) $(MDIR)/windex
	$(CP) windex $(MDIR)
	chmod 444 $(MDIR)/windex

$(MDIR)/whatis: whatis
	$(RM) $(MDIR)/whatis
	$(CP) whatis $(MDIR)
	chmod 444 $(MDIR)/whatis
