# -*- Makefile -*- for gettext-runtime/intl on VMS using the MMS utility

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

# Directories used by "make":
srcdir =

# Directories used by "make install":
prefix = SYS$DATA:[
exec_prefix = $(prefix)
bindir = $(exec_prefix).bin
libdir = $(exec_prefix).lib
includedir = $(prefix).include
datadir = $(prefix).share
localedir = $(datadir).locale
aliaspath = $(localedir)]

# Programs used by "make":

CC = cc

# These flags affect binary compatibility. GNU gettext does not need them,
# but other packages do, and we need to be binary compatible with them.
ABIFLAGS = /name=(as_is,short) /float=ieee

WARN_CFLAGS = /warning

OPTIMFLAGS = /optimize

CFLAGS = $(ABIFLAGS) $(WARN_CFLAGS) $(OPTIMFLAGS)
DEFS = "VMS=1","HAVE_CONFIG_H=1","LOCALEDIR=""$(localedir)]""","LOCALE_ALIAS_PATH=""$(aliaspath)""","LIBDIR=""$(libdir)]""","IN_LIBINTL=1"

INCLUDES = /include=([],[-])

AR = library
AR_FLAGS = /create

LN = copy
RM = delete

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

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

OBJECTS = bindtextdom.obj,dcgettext.obj,dgettext.obj,gettext.obj,finddomain.obj,loadmsgcat.obj,localealias.obj,textdomain.obj,l10nflist.obj,explodename.obj,dcigettext.obj,dcngettext.obj,dngettext.obj,ngettext.obj,plural-parse.obj,plural-exp.obj,localcharset.obj,relocatable.obj,localename.obj,log.obj,osdep.obj,intl-compat.obj

all : intl.olb,libintl.h
	write sys$output "Nothing else to be done for 'all'."

libgnuintl.h :
	if f$search("$(srcdir)libgnuintl.h_in") .nes. "" then $(LN) $(srcdir)libgnuintl.h_in libgnuintl.h
	if f$search("$(srcdir)libgnuintl.h_in") .eqs. "" then $(LN) $(srcdir)libgnuintl.h.in libgnuintl.h

bindtextdom.obj : $(srcdir)bindtextdom.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h
	$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)bindtextdom.c

dcgettext.obj : $(srcdir)dcgettext.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h
	$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)dcgettext.c

dgettext.obj : $(srcdir)dgettext.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h
	$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)dgettext.c

gettext.obj : $(srcdir)gettext.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h
	$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)gettext.c

finddomain.obj : $(srcdir)finddomain.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h
	$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)finddomain.c

loadmsgcat.obj : $(srcdir)loadmsgcat.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h,$(srcdir)hash-string.h,$(srcdir)plural-exp.h
	$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)loadmsgcat.c

localealias.obj : $(srcdir)localealias.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h,$(srcdir)relocatable.h
	$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)localealias.c

textdomain.obj : $(srcdir)textdomain.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h
	$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)textdomain.c

l10nflist.obj : $(srcdir)l10nflist.c,libgnuintl.h,$(srcdir)loadinfo.h
	$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)l10nflist.c

explodename.obj : $(srcdir)explodename.c,libgnuintl.h,$(srcdir)loadinfo.h
	$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)explodename.c

dcigettext.obj : $(srcdir)dcigettext.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h,$(srcdir)hash-string.h,$(srcdir)plural-exp.h,$(srcdir)eval-plural.h
	$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)dcigettext.c

dcngettext.obj : $(srcdir)dcngettext.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h
	$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)dcngettext.c

dngettext.obj : $(srcdir)dngettext.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h
	$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)dngettext.c

ngettext.obj : $(srcdir)ngettext.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h
	$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)ngettext.c

plural-parse.obj : $(srcdir)plural.c,libgnuintl.h,$(srcdir)plural-exp.h
	$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) /obj=plural-parse.obj $(srcdir)plural.c

plural-exp.obj : $(srcdir)plural-exp.c,libgnuintl.h,$(srcdir)plural-exp.h
	$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)plural-exp.c

localcharset.obj : $(srcdir)localcharset.c,libgnuintl.h,$(srcdir)localcharset.h,$(srcdir)relocatable.h
	$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)localcharset.c

relocatable.obj : $(srcdir)relocatable.c,libgnuintl.h,$(srcdir)relocatable.h
	$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)relocatable.c

localename.obj : $(srcdir)localename.c,libgnuintl.h
	$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)localename.c

log.obj : $(srcdir)log.c,libgnuintl.h
	$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)log.c

osdep.obj : $(srcdir)osdep.c,libgnuintl.h
	$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)osdep.c

intl-compat.obj : $(srcdir)intl-compat.c,libgnuintl.h,$(srcdir)gettextP.h,$(srcdir)gmo.h,$(srcdir)loadinfo.h
	$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) $(srcdir)intl-compat.c

intl.olb : $(OBJECTS)
	$(AR) $(AR_FLAGS) intl.olb $(OBJECTS)

libintl.h : libgnuintl.h
	$(LN) libgnuintl.h libintl.h

install : all
	create /directory $(prefix)]
	create /directory $(includedir)]
	$(INSTALL_DATA) libintl.h $(includedir)]libintl.h
	create /directory $(exec_prefix)]
	create /directory $(libdir)]
	$(INSTALL_DATA) intl.olb $(libdir)]intl.olb

installdirs :
	create /directory $(prefix)]
	create /directory $(includedir)]
	create /directory $(exec_prefix)]
	create /directory $(libdir)]

uninstall :
	$(RM) $(includedir)]libintl.h;
	$(RM) $(libdir)]intl.lib;

check : all
	write sys$output "Nothing else to be done for 'check'."

mostlyclean : clean
	write sys$output "Nothing else to be done for 'mostlyclean'."

clean :
	$(RM) libgnuintl.h;*
	$(RM) libintl.h;*
	$(RM) *.obj;*
	$(RM) *.olb;*

distclean : clean
	write sys$output "Nothing else to be done for 'distclean'."

maintainer-clean : distclean
	write sys$output "Nothing else to be done for 'maintainer-clean'."
