# Makefile for GNU Texindex and other utilities.
# $Id: Makefile.in,v 1.5 1996/09/29 20:07:06 karl Exp $
# 
# Copyright (C) 1990, 91, 92, 96 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.

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

srcdir = .
vpath %.c %.h $(srcdir);$(common)
EMACS = emacs

common = $(srcdir)/../libtxi

CC = gcc
INSTALL = ginstall
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL) -m 644

LN	= ln
RM	= rm -f
MKDIR	= mkdir

DEFS = -imacros ../config.h
LIBS = -L../libtxi -ltxi 
LOADLIBES = $(LIBS)

SHELL = /bin/sh

CFLAGS = -O2 -g
LDFLAGS = 

prefix = $(DJDIR)
exec_prefix = $(DJDIR)
bindir = $(exec_prefix)/bin
# Prefix for each installed program, normally empty or `g'.
binprefix = 
# Prefix for each installed man page, normally empty or `g'.
manprefix = 
mandir = $(prefix)/man/man1
manext = 1
infodir = $(prefix)/info

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

all: texindex install-info
sub-all: all

.c.o:
	$(CC) -c $(CPPFLAGS) $(DEFS) -I. -I$(srcdir) -I$(common) $(CFLAGS) $<


install: all
	$(INSTALL_PROGRAM) texindex $(bindir)/texindex
	$(INSTALL_PROGRAM) $(srcdir)/texi2dvi $(bindir)/texi2dvi
	$(INSTALL_PROGRAM) install-info $(bindir)/install-info
	$(INSTALL_PROGRAM) instinfo.exe $(bindir)/instinfo.exe

uninstall:
	rm -f $(bindir)/texindex.exe $(bindir)/texi2dvi $(bindir)/install-info.exe

Makefile: Makefile.in ../config.status
	sed -f ../confsub.sed $< > $@


TAGS:
	etags *.c *.h $(common)/getopt*.c $(common)/getopt.h

clean:
	$(RM) *.exe
	rm -f *.o a.out core core.* texindex install-info

mostlyclean: clean

distclean: clean
	rm -f Makefile config.status

realclean: distclean
	rm -f TAGS

texindex: texindex.o ../libtxi/libtxi.a
	$(CC) $(LDFLAGS) -o texindex texindex.o $(LOADLIBES)

texindex.o: texindex.c $(common)/getopt.h

install-info: install-info.o
	$(CC) $(LDFLAGS) -o install-info install-info.o $(LOADLIBES)
	stubify -g instinfo.exe
	stubedit instinfo.exe runfile=install-

install-info.o: install-info.c $(common)/getopt.h

# Prevent GNU make v3 from overflowing arg limit on SysV.
.NOEXPORT:
