# Makefile for GNU Texindex.
# Copyright (C) 1990, 1991, 1992 Free Software Foundation, Inc.

# This Makefile is for DJGPP v2.x

# 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  = $(srcdir);$(common)

common = $(srcdir)/../libtxi

CC = gcc

LN	= ln
RM	= -rm -f
TAR	= tar
MKDIR	= mkdir

# The following is necessary to avoid the loooong list of -DSOMETHING
# in $DEFS where we already have everything set up in the system-wide
# <config.h> (#include'd by ../config.h)
DEFS = -imacros ../config.h

LIBS = -L../libtxi -ltxi
LOADLIBES = $(LIBS)

# SHELL = /bin/sh

CFLAGS = -O2 -g
LDFLAGS = -g

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

all: texindex
sub-all: all

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

Makefile: Makefile.djg
	cp $< $@

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

clean:
	$(RM) *.o a.out *.exe texindex

mostlyclean: clean

distclean: clean
	$(RM) Makefile

realclean: distclean
	$(RM) TAGS

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

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

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