# -*- Makefile -*- for gettext-runtime/man

#### Start of system configuration section. ####

# Flags that can be set on the nmake command line:
#   PREFIX=Some\Directory   Base directory for installation
!if !defined(PREFIX)
PREFIX = c:\usr
!endif

# Directories used by "make install":
prefix = $(PREFIX)
datadir = $(prefix)\share
mandir = $(datadir)\man
man1dir = $(mandir)\man1
man3dir = $(mandir)\man3
docdir = $(datadir)\doc\gettext

LN = copy
RM = -del

# Programs used by "make install":
INSTALL = copy
INSTALL_PROGRAM = copy
INSTALL_DATA = copy

#### End of system configuration section. ####

SHELL = /bin/sh

all :

install : all force
	-mkdir $(prefix)
	-mkdir $(datadir)
	-mkdir $(mandir)
	-mkdir $(man1dir)
	$(INSTALL_DATA) gettext.1.in $(man1dir)\gettext.1
	$(INSTALL_DATA) ngettext.1.in $(man1dir)\ngettext.1
	$(INSTALL_DATA) envsubst.1 $(man1dir)\envsubst.1
	-mkdir $(man3dir)
	$(INSTALL_DATA) gettext.3 $(man3dir)\gettext.3
	$(INSTALL_DATA) ngettext.3 $(man3dir)\ngettext.3
	$(INSTALL_DATA) textdomain.3 $(man3dir)\textdomain.3
	$(INSTALL_DATA) bindtextdomain.3 $(man3dir)\bindtextdomain.3
	$(INSTALL_DATA) bind_textdomain_codeset.3 $(man3dir)\bind_textdomain_codeset.3
	$(INSTALL_DATA) dgettext.3 $(man3dir)\dgettext.3
	$(INSTALL_DATA) dcgettext.3 $(man3dir)\dcgettext.3
	$(INSTALL_DATA) dngettext.3 $(man3dir)\dngettext.3
	$(INSTALL_DATA) dcngettext.3 $(man3dir)\dcngettext.3
	-mkdir $(datadir)\doc
	-mkdir $(docdir)
	$(INSTALL_DATA) gettext.1.html.in $(docdir)\gettext.1.html
	$(INSTALL_DATA) ngettext.1.html.in $(docdir)\ngettext.1.html
	$(INSTALL_DATA) envsubst.1.html $(docdir)\envsubst.1.html
	$(INSTALL_DATA) gettext.3.html $(docdir)\gettext.3.html
	$(INSTALL_DATA) ngettext.3.html $(docdir)\ngettext.3.html
	$(INSTALL_DATA) textdomain.3.html $(docdir)\textdomain.3.html
	$(INSTALL_DATA) bindtextdomain.3.html $(docdir)\bindtextdomain.3.html
	$(INSTALL_DATA) bind_textdomain_codeset.3.html $(docdir)\bind_textdomain_codeset.3.html

installdirs : force
	-mkdir $(prefix)
	-mkdir $(datadir)
	-mkdir $(mandir)
	-mkdir $(man1dir)
	-mkdir $(man3dir)
	-mkdir $(datadir)\doc
	-mkdir $(docdir)

uninstall : force
	$(RM) $(man1dir)\gettext.1
	$(RM) $(man1dir)\ngettext.1
	$(RM) $(man1dir)\envsubst.1
	$(RM) $(man3dir)\gettext.3
	$(RM) $(man3dir)\ngettext.3
	$(RM) $(man3dir)\textdomain.3
	$(RM) $(man3dir)\bindtextdomain.3
	$(RM) $(man3dir)\bind_textdomain_codeset.3
	$(RM) $(man3dir)\dgettext.3
	$(RM) $(man3dir)\dcgettext.3
	$(RM) $(man3dir)\dngettext.3
	$(RM) $(man3dir)\dcngettext.3
	$(RM) $(docdir)\gettext.1.html
	$(RM) $(docdir)\ngettext.1.html
	$(RM) $(docdir)\envsubst.1.html
	$(RM) $(docdir)\gettext.3.html
	$(RM) $(docdir)\ngettext.3.html
	$(RM) $(docdir)\textdomain.3.html
	$(RM) $(docdir)\bindtextdomain.3.html
	$(RM) $(docdir)\bind_textdomain_codeset.3.html

check : all

mostlyclean : clean

clean : force
	$(RM) core

distclean : clean
	$(RM) Makefile

maintainer-clean : distclean

force :
