# Generated automatically from Makefile.in by configure.
# This file makes BibTeX.

SHELL = /bin/sh

srcdir = .
VPATH = .

# Routines used everywhere.
commondefines=../$(srcdir)/lib/common.defines ../$(srcdir)/lib/texmf.defines
commonh=../$(srcdir)/lib/common.h
commono=../lib/lib.a

# Routines used in TeX, Metafont, and BibTeX.
fileioc=../lib/openinout.c
fileioo=openinout.o


CC = gcc
CFLAGS = -g
CPPFLAGS = -DBibTeX -I../$(srcdir)/lib

CCLD = $(CC)
LDFLAGS = $(CFLAGS) $(XLDFLAGS)
LIBS =  $(extralibs)
libs = $(fileioo) $(commono) $(LIBS)

INSTALL = cp
INSTALL_PROGRAM = $(INSTALL)

LN = ln -s


.SUFFIXES:
.SUFFIXES: .o .c .p .ch
.p.c:
	$(SHELL) ../$(srcdir)/bibtex/convert $*.p $*.c
.ch.p:
	../web/tangle $*.web c$*.ch
.c.o:
	$(CC) $(CPPFLAGS) $(CFLAGS) -c $*.c


default: all
all: bibtex


bibtex: bibtex.o $(commono) $(fileioo)
	$(CCLD) -o bibtex $(LDFLAGS) bibtex.o $(libs)
bibtex.o: bibtex.c $(commonh)
bibtex.c: bibtex.p $(commondefines) convert
bibtex.p: bibtex.web cbibtex.ch

cbibtex.ch: bibtex.ch
	rm -f $@
	cp ../$(srcdir)/bibtex/bibtex.ch cbibtex.ch
	chmod 444 cbibtex.ch

openinout.c: $(fileioc)
	$(LN) $(fileioc) openinout.c


Makefile: Makefile.in ../config.status
	(cd ..; sh config.status)

# Prevent GNU make 3 from overflowing arg limit on system V.
.NOEXPORT:


c-sources: bibtex.c openinout.c
.PHONY: c-sources

install install-exec: all
	$(INSTALL_PROGRAM) bibtex $(bindir)/bibtex
install-data:

mostlyclean:
	rm -f *.pool *.o bibtex

clean: mostlyclean
	rm -f bibtex.p bibtex.c bibtex.h coerce.h openinout.c

distclean: clean
	rm -f cbibtex.ch Makefile

extraclean: distclean
	rm -f *~ *\#* patch* *.orig *.rej *.bak *.ckp
	rm -f *.dvi *.log *.aux *gf *pk *.tfm core a.out
	rm -f *.blg *.bbl

realclean: distclean
