# Makefile for GNU makeinfo.  -*- Indented-Text -*-
# Copyright (C) 1993 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 = .
common = ../libtxi
VPATH = $(srcdir);$(common)
DEFS = -imacros ../config.h

CPPFLAGS = -DREMOVE_OUTPUT_EXTENSIONS

# SHELL = /bin/sh

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

SRCS =  makeinfo.c
OBJS =  makeinfo.o

PROGS = makeinfo

all: $(PROGS) makeinfo.info
sub-all: all

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

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

../libtxi/libtxi.a:
	cd ..\libtxi
	$(MAKE) $(MFLAGS) libtxi.a

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

makeinfo.info: ./makeinfo makeinfo.texi macro.texi
	./makeinfo --no-split -I$(srcdir) makeinfo.texi

# makeinfo.texi: ./makeinfo makeinfo.mki
# 	./makeinfo -E makeinfo.texi -I$(srcdir) makeinfo.mki

TAGS: $(SRCS)
	etags $(SRCS)

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

mostlyclean: clean

distclean: clean
	$(RM) TAGS Makefile *.info */*.info

realclean: distclean

Makefile: Makefile.djg
	cp $< $@

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

# eof
