Flex-2.5.4.
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
|
||||
This file, ./MISC/Amiga/README.amiga, describes the necessary steps to get
|
||||
the FLEX 2.5.1 program up and running on the Commodore AMIGA with the
|
||||
help of SAS/C++ 6.51 and SMake 6.50. Also it describes the contents of the
|
||||
subdirectory ./MISC/Amiga, where `.' denotes the root directory of the
|
||||
standard installation of FLEX 2.5.1.
|
||||
|
||||
|
||||
FILES ADDED FOR INSTALLING FLEX 2.5.1 ON THE AMIGA
|
||||
|
||||
The standard distribution of FLEX 2.5.1 is assumed to be installed on
|
||||
your AMIGA computer. `Installed' means that all source files from the
|
||||
original archive are present in a root directory (denoted by `.' in what
|
||||
follows) and, if appropriate, one or more subdirectories, on your machine.
|
||||
|
||||
The original source files are totally left untouched, the necessary changes
|
||||
are applied in the form of `change files'. For installing FLEX 2.5.1 on
|
||||
the AMIGA, several additional files come with this patch.
|
||||
|
||||
-----rw-d 2 738 Apr 3 11:49 config.h
|
||||
-----rw-d 1 169 Apr 3 11:33 libmain.ch
|
||||
-----rw-d 1 159 Apr 3 11:33 libyywrap.ch
|
||||
-----rw-d 1 167 Apr 3 11:33 parse.ych
|
||||
-----rw-d 6 2840 Apr 3 11:34 README.amiga
|
||||
-----rw-d 11 5503 Apr 3 11:45 smakefile
|
||||
Dirs:0 Files:6 Blocks:22 Bytes:9576
|
||||
|
||||
|
||||
HOW TO INSTALL FLEX 2.5.1 ON THE AMIGA
|
||||
|
||||
Copy all files from ./MISC/Amiga to the root directory of the FLEX 2.5.1
|
||||
distribution and edit `SMakefile' as it instructs you. There shouldn't be
|
||||
too many changes necessary. Then say "make bootflex". This creates a
|
||||
preliminary version of FLEX 2.5.1 without using itself.
|
||||
|
||||
WARNING: Don't say "make flex" yet. Any pre-2.5 version of FLEX will fail
|
||||
on the file `scan.l' due to some new features only present in FLEX 2.5.
|
||||
|
||||
Then say "make flex". At least once the FLEX program created in the first
|
||||
step will be used. To make sure that everything is alright, finally say
|
||||
"make check". If you change the code, you should also say "make bigcheck"
|
||||
for some more thorough testing.
|
||||
|
||||
When you are satisfied with the results, say "make install". This will
|
||||
copy the `flex' binary, the `libfl.lib' file, and the `FlexLexer.h' header
|
||||
to the paths specified in the `SMakefile'.
|
||||
|
||||
Finally, you should say "make clean" to remove all intermediate files from
|
||||
the root directory. "make veryclean" also removes `flex' and `scan.c'.
|
||||
|
||||
|
||||
TROUBLE SHOOTING
|
||||
|
||||
FLEX 2.5.1 was ported to the AMIGA and tested with the following setup:
|
||||
|
||||
AMIGA 2000
|
||||
GVP G-Force 030/50/50/8
|
||||
SAS/C++ 6.51
|
||||
SED 2.05
|
||||
BISON 1.22
|
||||
WMERGE from the CWEB distribution
|
||||
|
||||
Should you encounter problems with this AMIGA patch for FLEX 2.5.1 or
|
||||
should you have ideas for further improvements, like using GnuMake instead
|
||||
of SMake, contact the author of this contribution
|
||||
|
||||
Andreas Scherer
|
||||
Roland-Stra{\ss}e 16
|
||||
52070 Aachen
|
||||
Germany
|
||||
|
||||
<scherer@genesis.informatik.rwth-aachen.de> (Internet)
|
||||
@@ -0,0 +1,195 @@
|
||||
# @(#) $Header$ (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 = smake
|
||||
|
||||
# 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.
|
||||
|
||||
CFLAGS = data=far ignore=85 noicons stackextend optimize
|
||||
DEFS = define=YYBISON=1 define=YY_NEVER_INTERACTIVE=1
|
||||
LDFLAGS = noicons
|
||||
LIBS =
|
||||
|
||||
# Installation targeting. Files will be installed under the tree
|
||||
# rooted at prefix. flex will be installed in bindir, libfl.lib 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 = Programmer:other # Change this for your AMIGA system.
|
||||
exec_prefix = $(prefix)
|
||||
bindir = $(exec_prefix)/bin
|
||||
libdir = $(exec_prefix)/lib
|
||||
includedir = $(prefix)/include
|
||||
manext = 1
|
||||
mandir = $(prefix)/man/man$(manext)
|
||||
|
||||
# You can define this to be "lex" if you want to replace lex at your site.
|
||||
FLEX = flex
|
||||
|
||||
INSTALLMAN = man
|
||||
|
||||
SHELL =
|
||||
srcdir = .
|
||||
VPATH =
|
||||
|
||||
LN_S =
|
||||
YACC = bison -y
|
||||
SED = sed
|
||||
CC = sc
|
||||
WMERGE = wmerge # from the CWEB distribution
|
||||
AR = oml
|
||||
RANLIB =
|
||||
INSTALL = copy clone
|
||||
INSTALL_DATA = $(INSTALL)
|
||||
INSTALL_PROGRAM = $(INSTALL)
|
||||
|
||||
# You normally do not need to modify anything below this point.
|
||||
# ------------------------------------------------------------
|
||||
|
||||
CPPFLAGS = idir=. idir=$(srcdir) $(DEFS)
|
||||
|
||||
.c.o:
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $<
|
||||
|
||||
HEADERS = flexdef.h version.h
|
||||
|
||||
SOURCES = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.y \
|
||||
scan.l skel.c sym.c tblcmp.c yylex.c
|
||||
OBJECTS = ccl.o dfa.o ecs.o gen.o main.o misc.o nfa.o parse.o \
|
||||
skel.o sym.o tblcmp.o yylex.o \
|
||||
$(libdir)/alloca.o $(libdir)/xmalloc.o
|
||||
|
||||
LIBSRCS = libmain.c libyywrap.c
|
||||
LIBOBJS = ansilibmain.o ansilibyywrap.o
|
||||
|
||||
LINTSRCS = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.c \
|
||||
scan.c skel.c sym.c tblcmp.c yylex.c
|
||||
|
||||
DISTFILES = README NEWS COPYING INSTALL FlexLexer.h \
|
||||
configure.in conf.in Makefile.in mkskel.sh skel.c flex.skl \
|
||||
$(HEADERS) $(SOURCES) $(LIBSRCS) MISC \
|
||||
flex.1 scan.c install.sh mkinstalldirs configure
|
||||
|
||||
DIST_NAME = flex
|
||||
|
||||
# which "flex" to use to generate scan.c from scan.l
|
||||
FLEX_EXEC = ./$(FLEX)
|
||||
FLEX_FLAGS = -t $(PERF_REPORT)
|
||||
COMPRESSION =
|
||||
PERF_REPORT = -p
|
||||
|
||||
FLEXLIB = libfl.lib
|
||||
|
||||
all: $(FLEX)
|
||||
|
||||
$(FLEX): $(OBJECTS) $(FLEXLIB) scan.o
|
||||
$(CC) $(CFLAGS) link to $(FLEX) $(LDFLAGS) $(OBJECTS) scan.o $(FLEXLIB) $(LIBS)
|
||||
|
||||
bootflex: $(OBJECTS) $(FLEXLIB) initscan.o
|
||||
$(CC) $(CFLAGS) link to $(FLEX) $(LDFLAGS) $(OBJECTS) initscan.o $(FLEXLIB) $(LIBS)
|
||||
|
||||
parse.c: ansiparse.y
|
||||
$(YACC) -d ansiparse.y
|
||||
$(SED) "/extern char.*malloc/d" <y.tab.c >parse.tmp
|
||||
copy parse.tmp parse.c
|
||||
copy y.tab.h parse.h
|
||||
@delete y.tab.c y.tab.h parse.tmp
|
||||
ansiparse.y: $(srcdir)/parse.y parse.ych
|
||||
$(WMERGE) $(srcdir)/parse.y parse.ych ansiparse.y
|
||||
|
||||
parse.h: parse.c
|
||||
|
||||
scan.c: scan.l
|
||||
$(FLEX_EXEC) $(FLEX_FLAGS) $(COMPRESSION) $(srcdir)/scan.l >scan.tmp
|
||||
$(SED) s,\"$(srcdir)/scan.l\",\"scan.l\", <scan.tmp >scan.c
|
||||
@delete scan.tmp
|
||||
|
||||
scan.o: scan.c parse.h flexdef.h config.h
|
||||
initscan.o: initscan.c parse.h flexdef.h config.h
|
||||
yylex.o: yylex.c parse.h flexdef.h config.h
|
||||
|
||||
skel.c: flex.skl mkskel.sh
|
||||
$(SHELL) $(srcdir)/mkskel.sh $(srcdir)/flex.skl >skel.c
|
||||
|
||||
main.o: main.c flexdef.h config.h version.h
|
||||
ccl.o: ccl.c flexdef.h config.h
|
||||
dfa.o: dfa.c flexdef.h config.h
|
||||
ecs.o: ecs.c flexdef.h config.h
|
||||
gen.o: gen.c flexdef.h config.h
|
||||
misc.o: misc.c flexdef.h config.h
|
||||
nfa.o: nfa.c flexdef.h config.h
|
||||
parse.o: parse.c flexdef.h config.h
|
||||
skel.o: skel.c flexdef.h config.h
|
||||
sym.o: sym.c flexdef.h config.h
|
||||
tblcmp.o: tblcmp.c flexdef.h config.h
|
||||
|
||||
alloca.o: alloca.c
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) define=xmalloc=yy_flex_xmalloc alloca.c
|
||||
|
||||
alloca.c: $(srcdir)/MISC/alloca.c
|
||||
@delete alloca.c
|
||||
copy $(srcdir)/MISC/alloca.c .
|
||||
|
||||
test: check
|
||||
check: flex
|
||||
$(FLEX_EXEC) $(FLEX_FLAGS) $(COMPRESSION) $(srcdir)/scan.l > temp_a
|
||||
$(SED) s,"$(srcdir)/scan.l","scan.l", < temp_a > temp_b
|
||||
-diff scan.c temp_b -l10000 -w
|
||||
@delete temp_?
|
||||
@echo "Check successful, using COMPRESSION='$(COMPRESSION)'"
|
||||
|
||||
bigcheck:
|
||||
delete scan.c
|
||||
$(MAKE) COMPRESSION=-C check
|
||||
delete scan.c
|
||||
$(MAKE) COMPRESSION=-Ce check
|
||||
delete scan.c
|
||||
$(MAKE) COMPRESSION=-Cm check
|
||||
delete scan.c
|
||||
$(MAKE) COMPRESSION=-Cfea check
|
||||
delete scan.c
|
||||
$(MAKE) COMPRESSION=-CFer check
|
||||
delete scan.c
|
||||
$(MAKE) COMPRESSION=-l PERF_REPORT= check
|
||||
delete scan.c
|
||||
$(MAKE)
|
||||
@echo "All checks successful"
|
||||
|
||||
$(FLEXLIB): $(LIBOBJS)
|
||||
$(AR) $(FLEXLIB) R $(LIBOBJS)
|
||||
|
||||
$(FLEX).man: flex.1 # SMAKE can't `cd', sorry. And, I don't have nroff.
|
||||
# cd $(srcdir), nroff -man flex.1 >$(FLEX).man
|
||||
|
||||
install: $(FLEX) $(FLEXLIB)
|
||||
$(INSTALL_PROGRAM) $(FLEX) $(bindir)/$(FLEX)
|
||||
# @delete $(bindir)/$(FLEX)++
|
||||
$(INSTALL_DATA) $(FLEXLIB) $(libdir)/libfl.lib
|
||||
$(INSTALL_DATA) $(srcdir)/FlexLexer.h $(includedir)/FlexLexer.h
|
||||
|
||||
ansilibmain.o: ansilibmain.c
|
||||
ansilibmain.c: libmain.c libmain.ch
|
||||
$(WMERGE) libmain.c libmain.ch ansilibmain.c
|
||||
ansilibyywrap.o: ansilibyywrap.c
|
||||
ansilibyywrap.c: libyywrap.c libyywrap.ch
|
||||
$(WMERGE) libyywrap.c libyywrap.ch ansilibyywrap.c
|
||||
|
||||
clean:
|
||||
-delete parse.(c|h) ansi\#? \#?.(bak|o|lnk) \
|
||||
alloca.c lex.yy.(c|cc) $(FLEXLIB)
|
||||
|
||||
veryclean: clean
|
||||
-delete $(FLEX) scan.c
|
||||
@@ -0,0 +1,25 @@
|
||||
/* $Header$ */
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
#undef const
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
#undef size_t
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define if you have the <malloc.h> header file. */
|
||||
#undef HAVE_MALLOC_H
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
#undef HAVE_ALLOCA_H
|
||||
|
||||
/* Define if platform-specific command line handling is necessary. */
|
||||
#undef NEED_ARGV_FIXUP
|
||||
@@ -0,0 +1,8 @@
|
||||
Changes for LIBMAIN.C 2.4.7 by Andreas Scherer, January 19, 1995.
|
||||
Modified for LIBMAIN.C 2.5.1, April 3, 1995.
|
||||
|
||||
@x l.5
|
||||
extern int yylex();
|
||||
@y
|
||||
extern int yylex(void);
|
||||
@z
|
||||
@@ -0,0 +1,8 @@
|
||||
Changes for LIBYYWRAP.C 2.4.7 by Andreas Scherer, January 19, 1995.
|
||||
Modified for LIBYYWRAP.C 2.5.1, April 3, 1995.
|
||||
|
||||
@x l.5
|
||||
int yywrap()
|
||||
@y
|
||||
int yywrap(void)
|
||||
@z
|
||||
@@ -0,0 +1,8 @@
|
||||
Changes for PARSE.Y 2.4.7 by Andreas Scherer, January 20, 1995.
|
||||
Modified for PARSE.Y 2.5.1, April 3, 1995.
|
||||
|
||||
@x l.60
|
||||
char *alloca ();
|
||||
@y
|
||||
char *alloca(unsigned int);
|
||||
@z
|
||||
Reference in New Issue
Block a user