# Makefile for ncurses manual pages.

SHELL		= /bin/sh

srcdir		= @srcdir@
VPATH		= @srcdir@
prefix		= @prefix@
exec_prefix	= @exec_prefix@
datadir		= @datadir@
mandir		= $(prefix)/man

INSTALL		= @INSTALL@
INSTALL_DATA	= @INSTALL_DATA@

all:

install install.man :
	$(srcdir)/../mkinstalldirs $(mandir) $(mandir)/man3 $(mandir)/man5 $(mandir)/man1
	@cd $(srcdir); for i in *.3x; do \
		sed 's,@TERMINFO@,$(datadir),' < $$i >/tmp/man.tmp; \
		echo installing man page $$i;\
		$(INSTALL_DATA) /tmp/man.tmp $(mandir)/man3/$$i; \
	done 
	@cd $(srcdir); for i in *.1 *.1m; do \
		sed 's,@TERMINFO@,$(datadir),' < $$i >/tmp/man.tmp; \
		echo installing man page $$i;\
		$(INSTALL_DATA) /tmp/man.tmp $(mandir)/man1/$$i; \
	done
	@cd $(srcdir); for i in *.5; do \
		sed 's,@TERMINFO@,$(datadir),' < $$i >/tmp/man.tmp; \
		echo installing man page $$i;\
		$(INSTALL_DATA) /tmp/man.tmp $(mandir)/man5/$$i; \
	done
	rm -f /tmp/man.tmp

clean mostlyclean:

distclean realclean: clean
	rm -f Makefile
