# Generated automatically from Makefile.os2 by configure.
# Makefile for BibTeX.

O = .obj
A = .lib
X = .exe
S = .dll

xlibs = bibtex.def

SHELL = /bin/sh
srcdir = .
VPATH = .

# This is so kpathsea will get remade automatically if you change
# something in it and recompile from the package directory.
kpathsea_parent = ../..
kpathsea_dir = $(kpathsea_parent)/kpathsea
kpathsea = $(kpathsea_dir)/kpathsea$A

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

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

program = bibtex

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

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

INSTALL = install -c
INSTALL_PROGRAM = $(INSTALL) -m 755

LN = cp -p


.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: $(program)


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

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

openinout.c: $(fileioc)
	-rm -f openinout.c
	$(LN) $(fileioc) openinout.c


Makefile: Makefile.os2 ../config.status
	(cd ..; $(SH) config.status)


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

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


TAGS: *.c *.h
	etags -t *.c *.h


mostlyclean::
	-rm -f *$O *$X $(program) $(lib) $(programs)

clean:: mostlyclean
	-rm -f *.dvi *.pool

distclean:: clean
	-rm -f Makefile config.status c-auto.h

# Although we can remake configure and c-auto.h.in, we don't remove
# them, since many people may lack Autoconf.  Use configclean for that.
realclean:: distclean
	-rm -f TAGS *.info*

extraclean::
	-rm -f *.aux *.bak *.bbl *.blg *.dvi *.log *.orig *.pl *.rej
	-rm -f *.i *.s *.tfm *.vf *.vpl *\#* *gf *pk *~
	-rm -f CONTENTS.tex a.out core mfput.* patch* texput.*

configclean:
	-rm -f configure c-auto.h.in c-auto.h


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

clean::
	-rm -f *.p *.c *.h

distclean:: clean
	-rm -f cbibtex.ch
