# -*- Makefile -*- for gettext-tools/src

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

# Flags that can be set on the nmake command line:
#   DLL=1     for compiling a .dll with a stub .lib (default is a static .lib)
#             Note that this works only with MFLAGS=-MD.
#   MFLAGS={-ML|-MT|-MD} for defining the compilation model
#     MFLAGS=-ML (the default)  Single-threaded, statically linked - libc.lib
#     MFLAGS=-MT                Multi-threaded, statically linked  - libcmt.lib
#     MFLAGS=-MD                Multi-threaded, dynamically linked - msvcrt.lib
#   DEBUG=1   for compiling with debugging information
#   PREFIX=Some\Directory       Base directory for installation
#   IIPREFIX=Some\\Directory    Same thing with doubled backslashes
!if !defined(DLL)
DLL=0
!endif
!if !defined(DEBUG)
DEBUG=0
!endif
!if !defined(MFLAGS)
!if !$(DLL)
MFLAGS=
!else
MFLAGS=-MD
!endif
!endif
!if !defined(PREFIX)
PREFIX = c:\usr
!endif
!if !defined(IIPREFIX)
IIPREFIX = c:\\usr
!endif

# Directories used by "make install":
prefix = $(PREFIX)
exec_prefix = $(prefix)
bindir = $(exec_prefix)\bin
libdir = $(exec_prefix)\lib
includedir = $(prefix)\include
datadir = $(prefix)\share
localedir = $(datadir)\locale
aliaspath =
jardir = $(datadir)\gettext
pkgdatadir = $(datadir)\gettext
projectsdir = $(pkgdatadir)\projects
IIprefix = $(IIPREFIX)
IIexec_prefix = $(IIprefix)
IIbindir = $(IIexec_prefix)\\bin
IIlibdir = $(IIexec_prefix)\\lib
IIincludedir = $(IIprefix)\\include
IIdatadir = $(IIprefix)\\share
IIlocaledir = $(IIdatadir)\\locale
IIaliaspath =
IIjardir = $(IIdatadir)\\gettext
IIpkgdatadir = $(IIdatadir)\\gettext
IIprojectsdir = $(IIpkgdatadir)\\projects

# Programs used by "make":

CC = cl

# Set to -W3 if you want to see maximum amount of warnings, including stupid
# ones. Set to -W1 to avoid warnings about signed/unsigned combinations.
WARN_CFLAGS = -W1

!if !$(DLL)
PICFLAGS =
!else
# "-GD" (msvc5) optimizes for DLL.
# mscv4 doesn't know about this flag and ignores it.
PICFLAGS = -GD
!endif

!if $(DEBUG)
OPTIMFLAGS = -Od -Z7
DEBUGFLAGS = -Z7
!else
# Some people prefer -O2 -G6 instead of -O1, but -O2 is not reliable in MSVC5.
OPTIMFLAGS = -D_NDEBUG -O1
DEBUGFLAGS =
!endif

CFLAGS = $(MFLAGS) $(WARN_CFLAGS) $(OPTIMFLAGS) -DHAVE_CONFIG_H -DLOCALEDIR=\"$(IIlocaledir)\" -DLOCALE_ALIAS_PATH=\"$(IIaliaspath)\" -DGETTEXTJAR=\"$(IIjardir)\\gettext.jar\" -DLIBDIR=\"$(IIlibdir)\" -DGETTEXTDATADIR=\"$(IIpkgdatadir)\" -DPROJECTSDIR=\"$(IIprojectsdir)\"

INCLUDES = -I. -I.. -I..\libuniname -I..\lib -I..\intl -I..\..\gettext-runtime\intl -I..\windows -I$(includedir)

AR = lib
AR_FLAGS = /out:

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

PROGRAMS = \
msgcmp.exe msgfmt.exe msgmerge.exe msgunfmt.exe xgettext.exe \
msgattrib.exe msgcat.exe msgcomm.exe msgconv.exe msgen.exe msgexec.exe msgfilter.exe msggrep.exe msginit.exe msguniq.exe

OBJECTS = \
  message.obj \
  read-po-abstract.obj \
  po-lex.obj \
  po-gram-gen.obj \
  po-hash-gen.obj \
  po-charset.obj \
  read-properties.obj \
  read-stringtable.obj \
  open-po.obj \
  dir-list.obj \
  str-list.obj \
  read-po.obj \
  write-properties.obj \
  write-stringtable.obj \
  write-po.obj \
  msgl-ascii.obj \
  msgl-iconv.obj \
  msgl-equal.obj \
  msgl-cat.obj \
  msgl-english.obj \
  file-list.obj \
  msgl-charset.obj \
  po-time.obj \
  plural.obj \
  plural-table.obj \
  format.obj \
  format-c.obj \
  format-sh.obj \
  format-python.obj \
  format-lisp.obj \
  format-elisp.obj \
  format-librep.obj \
  format-java.obj \
  format-awk.obj \
  format-pascal.obj \
  format-ycp.obj \
  format-tcl.obj \
  format-perl.obj \
  format-perl-brace.obj \
  format-php.obj \
  format-gcc-internal.obj \
  format-qt.obj

msgcmp_OBJECTS = msgcmp.obj
msgfmt_OBJECTS = msgfmt.obj write-mo.obj write-java.obj write-tcl.obj write-qt.obj plural-eval.obj
msgmerge_OBJECTS = msgmerge.obj plural-count.obj
msgunfmt_OBJECTS = msgunfmt.obj read-mo.obj read-java.obj read-tcl.obj
xgettext_OBJECTS = xgettext.obj x-c.obj x-po.obj x-sh.obj x-python.obj x-lisp.obj x-elisp.obj x-librep.obj x-smalltalk.obj x-java.obj x-awk.obj x-ycp.obj x-tcl.obj x-perl.obj x-php.obj x-rst.obj x-glade.obj
msgattrib_OBJECTS = msgattrib.obj
msgcat_OBJECTS = msgcat.obj
msgcomm_OBJECTS = msgcomm.obj
msgconv_OBJECTS = msgconv.obj
msgen_OBJECTS = msgen.obj
msgexec_OBJECTS = msgexec.obj
msgfilter_OBJECTS = msgfilter.obj
msggrep_OBJECTS = msggrep.obj
msginit_OBJECTS = msginit.obj localealias.obj
msguniq_OBJECTS = msguniq.obj
LDADD =

RESOURCES = gettextsrc.res

all : gettextsrc.lib $(PROGRAMS) gettextpo.lib

# Compilation rules for $(OBJECTS), with $(PICFLAGS).

message.obj : message.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c message.c

read-po-abstract.obj : read-po-abstract.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c read-po-abstract.c

po-lex.obj : po-lex.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c po-lex.c

po-gram-gen.obj : po-gram-gen.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c po-gram-gen.c

po-hash-gen.obj : po-hash-gen.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c po-hash-gen.c

po-charset.obj : po-charset.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c po-charset.c

read-properties.obj : read-properties.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c read-properties.c

read-stringtable.obj : read-stringtable.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c read-stringtable.c

open-po.obj : open-po.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c open-po.c

dir-list.obj : dir-list.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c dir-list.c

str-list.obj : str-list.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c str-list.c

read-po.obj : read-po.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c read-po.c

write-properties.obj : write-properties.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c write-properties.c

write-stringtable.obj : write-stringtable.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c write-stringtable.c

write-po.obj : write-po.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c write-po.c

msgl-ascii.obj : msgl-ascii.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c msgl-ascii.c

msgl-iconv.obj : msgl-iconv.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c msgl-iconv.c

msgl-equal.obj : msgl-equal.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c msgl-equal.c

msgl-cat.obj : msgl-cat.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c msgl-cat.c

msgl-english.obj : msgl-english.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c msgl-english.c

file-list.obj : file-list.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c file-list.c

msgl-charset.obj : msgl-charset.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c msgl-charset.c

po-time.obj : po-time.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c po-time.c

plural.obj : plural.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c plural.c

plural-table.obj : plural-table.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c plural-table.c

format.obj : format.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c -Tp format.c

format-c.obj : format-c.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c format-c.c

format-sh.obj : format-sh.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c format-sh.c

format-python.obj : format-python.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c format-python.c

format-lisp.obj : format-lisp.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c format-lisp.c

format-elisp.obj : format-elisp.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c format-elisp.c

format-librep.obj : format-librep.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c format-librep.c

format-java.obj : format-java.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c format-java.c

format-awk.obj : format-awk.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c format-awk.c

format-pascal.obj : format-pascal.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c format-pascal.c

format-ycp.obj : format-ycp.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c format-ycp.c

format-tcl.obj : format-tcl.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c format-tcl.c

format-perl.obj : format-perl.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c format-perl.c

format-perl-brace.obj : format-perl-brace.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c format-perl-brace.c

format-php.obj : format-php.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c format-php.c

format-gcc-internal.obj : format-gcc-internal.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c format-gcc-internal.c

format-qt.obj : format-qt.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c format-qt.c

!if !$(DLL)

gettextsrc.lib : $(OBJECTS)
	-$(RM) gettextsrc.lib
	$(AR) $(AR_FLAGS)gettextsrc.lib $(OBJECTS)

!else

# gettextsrc.dll and gettextsrc.lib are created together.
gettextsrc.lib : ..\windows\gettextsrc.def $(OBJECTS) $(RESOURCES)
	$(CC) $(MFLAGS) $(DEBUGFLAGS) -LD ..\windows\gettextsrc.def $(OBJECTS) ..\lib\gettextlib.lib ..\intl\intl.lib $(libdir)\iconv.lib $(RESOURCES) -Fegettextsrc.dll

gettextsrc.res : ../windows/gettextsrc.rc
	rc -Fo gettextsrc.res ../windows/gettextsrc.rc

!endif

# Compilation rules for $(program_OBJECTS), without $(PICFLAGS).

msgcmp.obj : msgcmp.c
	$(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c msgcmp.c

msgfmt.obj : msgfmt.c
	$(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c msgfmt.c

write-mo.obj : write-mo.c
	$(CC) $(INCLUDES) $(CFLAGS) -c write-mo.c

write-java.obj : write-java.c
	$(CC) $(INCLUDES) $(CFLAGS) -c write-java.c

write-tcl.obj : write-tcl.c
	$(CC) $(INCLUDES) $(CFLAGS) -c write-tcl.c

write-qt.obj : write-qt.c
	$(CC) $(INCLUDES) $(CFLAGS) -c write-qt.c

plural-eval.obj : plural-eval.c
	$(CC) $(INCLUDES) $(CFLAGS) -c plural-eval.c

msgmerge.obj : msgmerge.c
	$(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c -Tp msgmerge.c

plural-count.obj : plural-count.c
	$(CC) $(INCLUDES) $(CFLAGS) -c plural-count.c

msgunfmt.obj : msgunfmt.c
	$(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c msgunfmt.c

read-mo.obj : read-mo.c
	$(CC) $(INCLUDES) $(CFLAGS) -c read-mo.c

read-java.obj : read-java.c
	$(CC) $(INCLUDES) $(CFLAGS) -c read-java.c

read-tcl.obj : read-tcl.c
	$(CC) $(INCLUDES) $(CFLAGS) -c read-tcl.c

xgettext.obj : xgettext.c
	$(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c -Tp xgettext.c

x-c.obj : x-c.c
	$(CC) $(INCLUDES) $(CFLAGS) -c x-c.c

x-po.obj : x-po.c
	$(CC) $(INCLUDES) $(CFLAGS) -c x-po.c

x-sh.obj : x-sh.c
	$(CC) $(INCLUDES) $(CFLAGS) -c x-sh.c

x-python.obj : x-python.c
	$(CC) $(INCLUDES) $(CFLAGS) -c x-python.c

x-lisp.obj : x-lisp.c
	$(CC) $(INCLUDES) $(CFLAGS) -c x-lisp.c

x-elisp.obj : x-elisp.c
	$(CC) $(INCLUDES) $(CFLAGS) -c x-elisp.c

x-librep.obj : x-librep.c
	$(CC) $(INCLUDES) $(CFLAGS) -c x-librep.c

x-smalltalk.obj : x-smalltalk.c
	$(CC) $(INCLUDES) $(CFLAGS) -c x-smalltalk.c

x-java.obj : x-java.c
	$(CC) $(INCLUDES) $(CFLAGS) -c x-java.c

x-awk.obj : x-awk.c
	$(CC) $(INCLUDES) $(CFLAGS) -c x-awk.c

x-ycp.obj : x-ycp.c
	$(CC) $(INCLUDES) $(CFLAGS) -c x-ycp.c

x-tcl.obj : x-tcl.c
	$(CC) $(INCLUDES) $(CFLAGS) -c x-tcl.c

x-perl.obj : x-perl.c
	$(CC) $(INCLUDES) $(CFLAGS) -c x-perl.c

x-php.obj : x-php.c
	$(CC) $(INCLUDES) $(CFLAGS) -c x-php.c

x-rst.obj : x-rst.c
	$(CC) $(INCLUDES) $(CFLAGS) -c x-rst.c

x-glade.obj : x-glade.c
	$(CC) $(INCLUDES) $(CFLAGS) -c x-glade.c

msgattrib.obj : msgattrib.c
	$(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c -Tp msgattrib.c

msgcat.obj : msgcat.c
	$(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c -Tp msgcat.c

msgcomm.obj : msgcomm.c
	$(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c -Tp msgcomm.c

msgconv.obj : msgconv.c
	$(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c -Tp msgconv.c

msgen.obj : msgen.c
	$(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c -Tp msgen.c

msgexec.obj : msgexec.c
	$(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c msgexec.c

msgfilter.obj : msgfilter.c
	$(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c -Tp msgfilter.c

msggrep.obj : msggrep.c
	$(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c -Tp msggrep.c

msginit.obj : msginit.c
	$(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c msginit.c

localealias.obj : ..\..\gettext-runtime\intl\localealias.c
	$(CC) $(INCLUDES) $(CFLAGS) -DLOCALE_ALIAS_PATH=\"$(IIaliaspath)\" -c ..\..\gettext-runtime\intl\localealias.c

msguniq.obj : msguniq.c
	$(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c -Tp msguniq.c

msgcmp.exe : $(msgcmp_OBJECTS)
	$(CC) $(MFLAGS) $(DEBUGFLAGS) $(msgcmp_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(libdir)\iconv.lib $(LDADD) -Femsgcmp.exe

msgfmt.exe : $(msgfmt_OBJECTS)
	$(CC) $(MFLAGS) $(DEBUGFLAGS) $(msgfmt_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(libdir)\iconv.lib $(LDADD) -Femsgfmt.exe

msgmerge.exe : $(msgmerge_OBJECTS)
	$(CC) $(MFLAGS) $(DEBUGFLAGS) $(msgmerge_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(libdir)\iconv.lib $(LDADD) -Femsgmerge.exe

msgunfmt.exe : $(msgunfmt_OBJECTS)
	$(CC) $(MFLAGS) $(DEBUGFLAGS) $(msgunfmt_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(libdir)\iconv.lib $(LDADD) -Femsgunfmt.exe

xgettext.exe : $(xgettext_OBJECTS)
	$(CC) $(MFLAGS) $(DEBUGFLAGS) $(xgettext_OBJECTS) ..\libuniname\uniname.lib gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(libdir)\iconv.lib $(LDADD) -Fexgettext.exe

msgattrib.exe : $(msgattrib_OBJECTS)
	$(CC) $(MFLAGS) $(DEBUGFLAGS) $(msgattrib_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(libdir)\iconv.lib $(LDADD) -Femsgattrib.exe

msgcat.exe : $(msgcat_OBJECTS)
	$(CC) $(MFLAGS) $(DEBUGFLAGS) $(msgcat_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(libdir)\iconv.lib $(LDADD) -Femsgcat.exe

msgcomm.exe : $(msgcomm_OBJECTS)
	$(CC) $(MFLAGS) $(DEBUGFLAGS) $(msgcomm_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(libdir)\iconv.lib $(LDADD) -Femsgcomm.exe

msgconv.exe : $(msgconv_OBJECTS)
	$(CC) $(MFLAGS) $(DEBUGFLAGS) $(msgconv_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(libdir)\iconv.lib $(LDADD) -Femsgconv.exe

msgen.exe : $(msgen_OBJECTS)
	$(CC) $(MFLAGS) $(DEBUGFLAGS) $(msgen_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(libdir)\iconv.lib $(LDADD) -Femsgen.exe

msgexec.exe : $(msgexec_OBJECTS)
	$(CC) $(MFLAGS) $(DEBUGFLAGS) $(msgexec_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(libdir)\iconv.lib $(LDADD) -Femsgexec.exe

msgfilter.exe : $(msgfilter_OBJECTS)
	$(CC) $(MFLAGS) $(DEBUGFLAGS) $(msgfilter_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(libdir)\iconv.lib $(LDADD) -Femsgfilter.exe

msggrep.exe : $(msggrep_OBJECTS)
	$(CC) $(MFLAGS) $(DEBUGFLAGS) $(msggrep_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(libdir)\iconv.lib $(LDADD) -Femsggrep.exe

msginit.exe : $(msginit_OBJECTS)
	$(CC) $(MFLAGS) $(DEBUGFLAGS) $(msginit_OBJECTS) ..\intl\localename.obj gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(libdir)\iconv.lib $(LDADD) -Femsginit.exe

msguniq.exe : $(msguniq_OBJECTS)
	$(CC) $(MFLAGS) $(DEBUGFLAGS) $(msguniq_OBJECTS) gettextsrc.lib ..\lib\gettextlib.lib ..\intl\intl.lib $(libdir)\iconv.lib $(LDADD) -Femsguniq.exe

# Compilation rules for gettextpo.lib objects, with $(PICFLAGS).

gettext-po.obj : gettext-po.c
	$(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c gettext-po.c

!if !$(DLL)

gettextpo.lib : gettext-po.obj
	-$(RM) gettextpo.lib
	$(AR) $(AR_FLAGS)gettextpo.lib gettext-po.obj

!else

# gettextpo.dll and gettextpo.lib are created together.
gettextpo.lib : ..\windows\gettextpo.def gettext-po.obj gettextpo.res gettextsrc.lib
	$(CC) $(MFLAGS) $(DEBUGFLAGS) -LD ..\windows\gettextpo.def gettext-po.obj gettextsrc.lib ..\lib\gettextlib.lib gettextpo.res -Fegettextpo.dll

gettextpo.res : ../windows/gettextpo.rc
	rc -Fo gettextpo.res ../windows/gettextpo.rc

!endif

install : all force
	-mkdir $(prefix)
	-mkdir $(exec_prefix)
!if $(DLL)
	-mkdir $(bindir)
	$(INSTALL_DATA) gettextsrc.dll $(bindir)\gettextsrc.dll
!endif
	$(INSTALL_PROGRAM) msgcmp.exe $(bindir)\msgcmp.exe
	$(INSTALL_PROGRAM) msgfmt.exe $(bindir)\msgfmt.exe
	$(INSTALL_PROGRAM) msgmerge.exe $(bindir)\msgmerge.exe
	$(INSTALL_PROGRAM) msgunfmt.exe $(bindir)\msgunfmt.exe
	$(INSTALL_PROGRAM) xgettext.exe $(bindir)\xgettext.exe
	$(INSTALL_PROGRAM) msgattrib.exe $(bindir)\msgattrib.exe
	$(INSTALL_PROGRAM) msgcat.exe $(bindir)\msgcat.exe
	$(INSTALL_PROGRAM) msgcomm.exe $(bindir)\msgcomm.exe
	$(INSTALL_PROGRAM) msgconv.exe $(bindir)\msgconv.exe
	$(INSTALL_PROGRAM) msgen.exe $(bindir)\msgen.exe
	$(INSTALL_PROGRAM) msgexec.exe $(bindir)\msgexec.exe
	$(INSTALL_PROGRAM) msgfilter.exe $(bindir)\msgfilter.exe
	$(INSTALL_PROGRAM) msggrep.exe $(bindir)\msggrep.exe
	$(INSTALL_PROGRAM) msginit.exe $(bindir)\msginit.exe
	$(INSTALL_PROGRAM) msguniq.exe $(bindir)\msguniq.exe
	-mkdir $(datadir)
	-mkdir $(pkgdatadir)
	$(INSTALL_DATA) msgunfmt.tcl $(pkgdatadir)\msgunfmt.tcl
	-mkdir $(includedir)
	$(INSTALL_DATA) gettext-po.h $(includedir)\gettext-po.h
!if $(DLL)
	$(INSTALL_DATA) gettextpo.dll $(bindir)\gettextpo.dll
!endif
	-mkdir $(libdir)
	$(INSTALL_DATA) gettextpo.lib $(libdir)\gettextpo.lib

installdirs : force
	-mkdir $(prefix)
	-mkdir $(exec_prefix)
!if $(DLL)
	-mkdir $(bindir)
!endif
	-mkdir $(datadir)
	-mkdir $(pkgdatadir)
	-mkdir $(includedir)
	-mkdir $(libdir)

uninstall : force
!if $(DLL)
	$(RM) $(bindir)\gettextsrc.dll
!endif
	$(RM) $(bindir)\msgcmp.exe
	$(RM) $(bindir)\msgfmt.exe
	$(RM) $(bindir)\msgmerge.exe
	$(RM) $(bindir)\msgunfmt.exe
	$(RM) $(bindir)\xgettext.exe
	$(RM) $(bindir)\msgattrib.exe
	$(RM) $(bindir)\msgcat.exe
	$(RM) $(bindir)\msgcomm.exe
	$(RM) $(bindir)\msgconv.exe
	$(RM) $(bindir)\msgen.exe
	$(RM) $(bindir)\msgexec.exe
	$(RM) $(bindir)\msgfilter.exe
	$(RM) $(bindir)\msggrep.exe
	$(RM) $(bindir)\msginit.exe
	$(RM) $(bindir)\msguniq.exe
	$(RM) $(pkgdatadir)\msgunfmt.tcl
	$(RM) $(includedir)\gettext-po.h
!if $(DLL)
	$(RM) $(bindir)\gettextpo.dll
!endif
	$(RM) $(libdir)\gettextpo.lib

check : all

mostlyclean : clean

clean : force
	$(RM) *.obj
	$(RM) *.lib
	$(RM) *.exp
	$(RM) *.dll
	$(RM) gettextsrc.res
	$(RM) $(PROGRAMS)
	$(RM) core

distclean : clean

maintainer-clean : distclean

force :
