# Generated automatically from Makefile.in by configure.
# Makefile for TeX to C conversion programs.

SHELL = /bin/sh

srcdir = .
VPATH = .

# Routines used everywhere.
commono=../lib/lib.a

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

LEX = flex
LEXLIB = -lfl
YACC = bison -y

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


.SUFFIXES:
.SUFFIXES: .o .c
.c.o:
	$(CC) $(CPPFLAGS) $(CFLAGS) -c $*.c


all: web2c fixwrites splitup regfix

# Don't bother to link with the flex library, since people might not
# have installed, and it only has a stub main program.
web2c: web2c.o y.tab.o lex.yy.o
	case $(LEXLIB) in *fl*) lexlib="" ;; *) lexlib=$(LEXLIB); esac; \
	$(CCLD) -o web2c $(LDFLAGS) web2c.o y.tab.o lex.yy.o $$lexlib $(libs)

web2c.o: web2c.c y.tab.h

lex.yy.o: lex.yy.c y.tab.h
lex.yy.c: web2c.lex
	$(LEX) web2c.lex

y.tab.o: y.tab.c
y.tab.c y.tab.h: web2c.yacc
	@echo Expect 3 shift/reduce conflicts.
	$(YACC) -d -v web2c.yacc

fixwrites: fixwrites.o
	$(CCLD) -o fixwrites $(LDFLAGS) fixwrites.o $(libs)

splitup: splitup.o
	$(CCLD) -o splitup $(LDFLAGS) splitup.o $(libs)

regfix: regfix.o
	$(CCLD) -o regfix $(LDFLAGS) regfix.o $(libs)


Makefile: Makefile.in ../config.status
	(cd ..; $(SHELL) config.status)

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


install install-exec install-data:

mostlyclean:
	rm -f *.o regfix splitup fixwrites web2c

clean: mostlyclean

distclean realclean: clean
	rm -f y.tab.c y.tab.h y.output yacc.* lex.yy.c Makefile

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