# Generated automatically from Makefile.in by configure.
# @(#) $Header: Makefile.in,v 1.2 94/01/04 14:33:19 vern Exp $ (LBL)

# If your version of "make" does not define $(MAKE), comment in the
# definition of "MAKE" below.  (You only need to do this if you intend
# to do "make bigcheck" or "make dist".)
# MAKE = make

# Possible values for DEFS:
#
# For flex to always generate 8-bit scanners, add "-DDEFAULT_CSIZE=256"
# to DEFS.
#
# For Vax/VMS, add "-DVMS" to DEFS.
#
# For MS-DOS, add "-DMS_DOS" to DEFS.  See the directory MISC/MSDOS for
# additional info.

DEFS=-DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DVSTADOSFS=1

# Installation targeting.  Files will be installed under the tree
# rooted at prefix.  flex will be installed in bindir, libfl.a in
# libdir, FlexLexer.h will be installed in includedir, and the manual
# pages will be installed in mandir with extension manext.
# 
# Raw, unformatted troff source will be installed if INSTALLMAN=man,
# nroff preformatted versions will be installed if INSTALLMAN=cat.

prefix = /vsta
exec_prefix = ${prefix}
bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
includedir = $(prefix)/include
manext = 1
mandir = $(prefix)/man/man$(manext)

INSTALLMAN = man

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

YACC=yacc
CC=gcc
AR=ar

# You normally do not need to modify anything below this point.
# ------------------------------------------------------------

CPPFLAGS = -I.
CFLAGS=-O $(DEFS) $(CPPFLAGS)

OBJECTS = ccl.o dfa.o ecs.o gen.o main.o misc.o nfa.o parse.o \
	scan.o skel.o sym.o tblcmp.o yylex.o 

LIBOBJS = libmain.o libyywrap.o

# which "flex" to use to generate scan.c from scan.l
FLEX=./flex
FLEX_FLAGS=-ist $(PERF_REPORT)
COMPRESSION=
PERF_REPORT=-p
FLEXLIB=libfl.a


all: flex

flex: $(OBJECTS) $(FLEXLIB)
	$(CC) -o flex $(LDFLAGS) $(OBJECTS) $(FLEXLIB) $(LIBS)

# boot.str: initscan.c
# 	rm -f scan.c
# 	cp $(srcdir)/initscan.c scan.c
# 	cp /dev/null boot.str

#parse.c: parse.y
#	$(YACC) -d $(srcdir)/parse.y
#	sed '/extern char.*malloc/d' <y_tab.c >parse.c
#	rm -f y_tab.c
#	mv y_tab.h parse.h

# parse.h: parse.c

# scan.c: scan.l
# 	$(FLEX) $(FLEX_FLAGS) $(COMPRESSION) $(srcdir)/scan.l >scan.tmp
# 	sed s,\"$(srcdir)/scan.l\",\"scan.l\", <scan.tmp >scan.c
# 	rm scan.tmp
 
#skel.c: flex.skl mkskel.sh
#	$(SHELL) $(srcdir)/mkskel.sh $(srcdir)/flex.skl >skel.c

$(FLEXLIB): $(LIBOBJS)
	rm -f $(FLEXLIB)
	$(AR) csr $(FLEXLIB) $(LIBOBJS)

install: flex $(FLEXLIB)
	strip flex
	cp flex $(bindir)
	cp $(FLEXLIB) $(libdir)

clean:
	rm -f parse.c parse.h *.o alloca.c *.lint lexyy.c lexyy.cc

clobber: clean
	rm -f flex $(FLEXLIB)
