ifeq ($(RHIDESRC),)
error You must set the environment variable RHIDESRC
endif
#       This makefile is designed for DJGPP
SRCDIR=$(RHIDESRC)/gettext/src
programs=$(wildcard $(SRCDIR)/*.exe) $(subst .exe,,$(wildcard $(SRCDIR)/*.exe))
src_files=$(notdir $(filter-out $(programs),$(filter-out %.a,$(filter-out %.o,$(wildcard $(SRCDIR)/*)))))
# Makefile for program source directory in GNU NLS utilities package.
# Copyright (C) 1995 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

PACKAGE = gettext
VERSION = 0.10.23
PROGRAMS = gettext msgcmp msgfmt msgmerge msgunfmt xgettext
SCRIPTS = tupdate

#SHELL = /bin/sh

srcdir = $(SRCDIR)
top_srcdir = $(srcdir)/..
VPATH = $(SRCDIR)

prefix = $(DJDIR)
exec_prefix = $(DJDIR)
transform = @program_transform_name@
bindir = $(exec_prefix)/bin
datadir = $(prefix)/data
localedir = $(datadir)/locale
subdir = src

CC = gcc
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
YACC = bison -o y_tab.c

DEFS = -DLOCALEDIR=\"$(localedir)\" -DHAVE_CONFIG_H -Dpw_gecos=pw_name
CFLAGS = -O
CPPFLAGS = 
LDFLAGS = 
YFLAGS = -d
# This definition of LIBS is special for GNU gettext, because we possibly
# need two different libintl.a libraries.  One provides the functionality
# of GNU gettext.  Another provides the message handling functions we use
# in the programs for user messages.
LIBS = ../intl/libintl.a ../lib/libnlsut.a  ../lib/libnlsut.a 

COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
LINK = $(CC) $(LDFLAGS) -o $@ ../intl/intl-compat.o

HEADERS = domain.h message.h po-gram.h po-hash.h po-lex.h po.h str-list.h \
xget-lex.h
SOURCES = gettextp.c message.c msgcmp.c msgfmt.c msgmerge.c msgunfmt.c \
open-po.c po-gram.y po-hash.y po-lex.c po.c str-list.c xget-lex.c xgettext.c
GENHEADERS = po-gram_gen.h po-hash_gen.h
GENSOURCES = po-gram_gen.c po-hash_gen.c
OBJECTS = gettextp.o message.o msgcmp.o msgfmt.o msgmerge.o msgunfmt.o \
open-po.o po-gram_gen.o po-hash_gen.o po-lex.o po.o str-list.o xget-lex.o \
xgettext.o
DISTFILES = ChangeLog Makefile.in tupdate.in $(HEADERS) $(SOURCES) \
$(GENHEADERS) $(GENSOURCES)

.SUFFIXES:
.SUFFIXES: .c .o
.c.o:
	$(COMPILE) $<

INCLUDES = -I$(srcdir) -I.. -I$(top_srcdir)/lib -I../intl -I$(top_srcdir)/intl

all: $(PROGRAMS) 

$(PROGRAMS): ../intl/libintl.a ../lib/libnlsut.a


GETTEXT_OBJ = gettextp.o
gettext: $(GETTEXT_OBJ)
	$(LINK) $(GETTEXT_OBJ) $(LIBS)

MSGCMP_OBJ = message.o msgcmp.o open-po.o po-gram_gen.o po-hash_gen.o \
po-lex.o po.o str-list.o
msgcmp: $(MSGCMP_OBJ)
	$(LINK) $(MSGCMP_OBJ) $(LIBS)

MSGFMT_OBJ = msgfmt.o open-po.o po-gram_gen.o po-hash_gen.o po-lex.o po.o \
str-list.o
msgfmt: $(MSGFMT_OBJ)
	$(LINK) $(MSGFMT_OBJ) $(LIBS)

MSGMERGE_OBJ = message.o msgmerge.o open-po.o po-gram_gen.o po-hash_gen.o \
po-lex.o po.o str-list.o
msgmerge: $(MSGMERGE_OBJ)
	$(LINK) $(MSGMERGE_OBJ) $(LIBS)

MSGUNFMT_OBJ = message.o msgunfmt.o str-list.o
msgunfmt: $(MSGUNFMT_OBJ)
	$(LINK) $(MSGUNFMT_OBJ) $(LIBS)

XGETTEXT_OBJ = message.o open-po.o po-gram_gen.o po-hash_gen.o po-lex.o po.o \
str-list.o xget-lex.o xgettext.o
xgettext: $(XGETTEXT_OBJ)
	$(LINK) $(XGETTEXT_OBJ) $(LIBS)


po-gram_gen.c po-gram_gen.h: po-gram.y
	$(YACC) $(YFLAGS) $(srcdir)/po-gram.y
	rm -f $(srcdir)/po-gram_gen.c $(srcdir)/po-gram_gen.h
	sed 's/[yY][yY]/po_gram_/g' < y_tab.c > $(srcdir)/po-gram_gen.c
	sed 's/[yY][yY]/po_gram_/g' < y_tab.h > $(srcdir)/po-gram_gen.h
	rm -f y_tab.c y_tab.h

po-hash_gen.c po-hash_gen.h: po-hash.y
	$(YACC) $(YFLAGS) $(srcdir)/po-hash.y
	rm -f $(srcdir)/po-hash_gen.c $(srcdir)/po-hash_gen.h
	sed 's/[yY][yY]/po_hash_/g' < y_tab.c > $(srcdir)/po-hash_gen.c
	sed 's/[yY][yY]/po_hash_/g' < y_tab.h > $(srcdir)/po-hash_gen.h
	rm -f y_tab.c y_tab.h


gettextp.o: ../intl/libgettext.h ../config.h ../lib/error.h \
../lib/getopt.h ../lib/system.h

message.o: ../config.h ../lib/fstrcmp.h message.h po-lex.h ../lib/system.h

msgcmp.o: ../config.h ../lib/error.h ../lib/getopt.h ../lib/system.h \
message.h po-gram.h po-lex.h

msgfmt.o: ../intl/gettext.h ../intl/hash-string.h ../config.h \
../lib/error.h ../lib/getline.h ../lib/getopt.h ../lib/hash.h \
../lib/obstack.h ../lib/printf.h ../lib/system.h domain.h po-gram.h \
po-lex.h

msgmerge.o: ../config.h ../lib/error.h ../lib/getopt.h ../lib/system.h \
message.h po-lex.h po.h

msgunfmt.o: ../intl/gettext.h ../intl/hash-string.h ../config.h \
../lib/error.h ../lib/getline.h ../lib/getopt.h ../lib/hash.h \
../lib/obstack.h ../lib/printf.h ../lib/system.h domain.h message.h \
po-lex.h

open-po.o: ../config.h ../lib/error.h ../lib/system.h

po-gram_gen.o: ../config.h ../lib/error.h ../lib/system.h po-gram.h \
po-lex.h

po-hash_gen.o: ../config.h ../lib/system.h po-hash.h po-lex.h po.h

po-lex.o: ../config.h ../lib/error.h ../lib/system.h po-gram_gen.h \
po-gram.h po-lex.h

po.o: ../config.h ../lib/system.h po-hash.h po-lex.h po.h

str-list.o: ../config.h ../lib/system.h str-list.h

xget-lex.o: ../intl/libgettext.h ../config.h ../lib/error.h \
../lib/system.h str-list.h xget-lex.h

xgettext.o: ../intl/gettext.h ../config.h ../lib/error.h \
../lib/getline.h ../lib/getopt.h ../lib/hash.h ../lib/obstack.h \
../lib/system.h domain.h po-gram.h po-lex.h


install install-src: install-exec install-data
install-exec: all
	$(top_srcdir)/mkinstalldirs $(bindir)
	for name in $(PROGRAMS); do \
	  $(INSTALL_PROGRAM) $$name \
		$(bindir)/`echo $$name | sed '$(transform)'`; \
	done;
	if test -n "@PERL@"; then \
	  $(INSTALL_SCRIPT) tupdate \
		$(bindir)/`echo tupdate | sed '$(transform)'`; \
	fi
install-data:

uninstall:
	for name in $(PROGRAMS); do \
	  rm -f $(bindir)/`echo $$name | sed '$(transform)'`; \
	done

check: all

tags: TAGS

TAGS: $(HEADERS) $(SOURCES)
	here=`pwd`; \
	cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)

id: ID

ID: $(HEADERS) $(SOURCES)
	here=`pwd`; \
	cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)

mostlyclean:
	rm -f *.o core core.*

clean: mostlyclean
	rm -f $(PROGRAMS)

distclean: clean
	rm -f Makefile ID TAGS tupdate

maintainer-clean: distclean
	@echo "This command is intended for maintainers to use;"
	@echo "it deletes files that may require special tools to rebuild."

distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
dist dist-gettext: Makefile $(DISTFILES)
	for file in $(DISTFILES); do \
	  ln $(srcdir)/$$file $(distdir) 2> /dev/null \
	    || cp -p $(srcdir)/$$file $(distdir); \
	done

tupdate: tupdate.in ../config.status
	cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status

include $(RHIDESRC)/common.mak
# Tell versions [3.59,3.63) of GNU make not to export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
