Home | History | Annotate | Download | only in Amiga
      1 # @(#) $Header: Makefile.in,v 1.2 94/01/04 14:33:19 vern Exp $ (LBL)
      2 
      3 # If your version of "make" does not define $(MAKE), comment in the
      4 # definition of "MAKE" below.  (You only need to do this if you intend
      5 # to do "make bigcheck" or "make dist".)
      6 MAKE = smake
      7 
      8 # Possible values for DEFS:
      9 #
     10 # For flex to always generate 8-bit scanners, add "-DDEFAULT_CSIZE=256"
     11 # to DEFS.
     12 #
     13 # For Vax/VMS, add "-DVMS" to DEFS.
     14 #
     15 # For MS-DOS, add "-DMS_DOS" to DEFS.  See the directory MISC/MSDOS for
     16 # additional info.
     17 
     18 CFLAGS = data=far ignore=85 noicons stackextend optimize
     19 DEFS = define=YYBISON=1 define=YY_NEVER_INTERACTIVE=1
     20 LDFLAGS = noicons
     21 LIBS =
     22 
     23 # Installation targeting.  Files will be installed under the tree
     24 # rooted at prefix.  flex will be installed in bindir, libfl.lib in
     25 # libdir, FlexLexer.h will be installed in includedir, and the manual
     26 # pages will be installed in mandir with extension manext.
     27 # 
     28 # Raw, unformatted troff source will be installed if INSTALLMAN=man,
     29 # nroff preformatted versions will be installed if INSTALLMAN=cat.
     30 
     31 prefix = Programmer:other # Change this for your AMIGA system.
     32 exec_prefix = $(prefix)
     33 bindir = $(exec_prefix)/bin
     34 libdir = $(exec_prefix)/lib
     35 includedir = $(prefix)/include
     36 manext = 1
     37 mandir = $(prefix)/man/man$(manext)
     38 
     39 # You can define this to be "lex" if you want to replace lex at your site.
     40 FLEX = flex
     41 
     42 INSTALLMAN = man
     43 
     44 SHELL =
     45 srcdir = .
     46 VPATH =
     47 
     48 LN_S =
     49 YACC = bison -y
     50 SED = sed
     51 CC = sc
     52 WMERGE = wmerge # from the CWEB distribution
     53 AR = oml
     54 RANLIB =
     55 INSTALL = copy clone
     56 INSTALL_DATA = $(INSTALL)
     57 INSTALL_PROGRAM = $(INSTALL)
     58 
     59 # You normally do not need to modify anything below this point.
     60 # ------------------------------------------------------------
     61 
     62 CPPFLAGS = idir=. idir=$(srcdir) $(DEFS)
     63 
     64 .c.o:
     65 	$(CC) $(CPPFLAGS) $(CFLAGS) $<
     66 
     67 HEADERS = flexdef.h version.h
     68 
     69 SOURCES = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.y \
     70 	scan.l skel.c sym.c tblcmp.c yylex.c
     71 OBJECTS = ccl.o dfa.o ecs.o gen.o main.o misc.o nfa.o parse.o \
     72 	skel.o sym.o tblcmp.o yylex.o \
     73 	$(libdir)/alloca.o $(libdir)/xmalloc.o
     74 
     75 LIBSRCS = libmain.c libyywrap.c
     76 LIBOBJS = ansilibmain.o ansilibyywrap.o
     77 
     78 LINTSRCS = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.c \
     79 	scan.c skel.c sym.c tblcmp.c yylex.c
     80 
     81 DISTFILES = README NEWS COPYING INSTALL FlexLexer.h \
     82 	configure.in conf.in Makefile.in mkskel.sh skel.c flex.skl \
     83 	$(HEADERS) $(SOURCES) $(LIBSRCS) MISC \
     84 	flex.1 scan.c install.sh mkinstalldirs configure
     85 
     86 DIST_NAME = flex
     87 
     88 # which "flex" to use to generate scan.c from scan.l
     89 FLEX_EXEC = ./$(FLEX)
     90 FLEX_FLAGS = -t $(PERF_REPORT)
     91 COMPRESSION =
     92 PERF_REPORT = -p
     93 
     94 FLEXLIB = libfl.lib
     95 
     96 all: $(FLEX)
     97 
     98 $(FLEX): $(OBJECTS) $(FLEXLIB) scan.o
     99 	$(CC) $(CFLAGS) link to $(FLEX) $(LDFLAGS) $(OBJECTS) scan.o $(FLEXLIB) $(LIBS)
    100 
    101 bootflex: $(OBJECTS) $(FLEXLIB) initscan.o
    102 	$(CC) $(CFLAGS) link to $(FLEX) $(LDFLAGS) $(OBJECTS) initscan.o $(FLEXLIB) $(LIBS)
    103 
    104 parse.c: ansiparse.y
    105 	$(YACC) -d ansiparse.y
    106 	$(SED) "/extern char.*malloc/d" <y.tab.c >parse.tmp
    107 	copy parse.tmp parse.c
    108 	copy y.tab.h parse.h
    109 	@delete y.tab.c y.tab.h parse.tmp
    110 ansiparse.y: $(srcdir)/parse.y parse.ych
    111 	$(WMERGE) $(srcdir)/parse.y parse.ych ansiparse.y
    112 
    113 parse.h: parse.c
    114 
    115 scan.c: scan.l
    116 	$(FLEX_EXEC) $(FLEX_FLAGS) $(COMPRESSION) $(srcdir)/scan.l >scan.tmp
    117 	$(SED) s,\"$(srcdir)/scan.l\",\"scan.l\", <scan.tmp >scan.c
    118 	@delete scan.tmp
    119 
    120 scan.o: scan.c parse.h flexdef.h config.h
    121 initscan.o: initscan.c parse.h flexdef.h config.h
    122 yylex.o: yylex.c parse.h flexdef.h config.h
    123 
    124 skel.c: flex.skl mkskel.sh
    125 	$(SHELL) $(srcdir)/mkskel.sh $(srcdir)/flex.skl >skel.c
    126 
    127 main.o: main.c flexdef.h config.h version.h
    128 ccl.o: ccl.c flexdef.h config.h
    129 dfa.o: dfa.c flexdef.h config.h
    130 ecs.o: ecs.c flexdef.h config.h
    131 gen.o: gen.c flexdef.h config.h
    132 misc.o: misc.c flexdef.h config.h
    133 nfa.o: nfa.c flexdef.h config.h
    134 parse.o: parse.c flexdef.h config.h
    135 skel.o: skel.c flexdef.h config.h
    136 sym.o: sym.c flexdef.h config.h
    137 tblcmp.o: tblcmp.c flexdef.h config.h
    138 
    139 alloca.o: alloca.c
    140 	$(CC) $(CPPFLAGS) $(CFLAGS) define=xmalloc=yy_flex_xmalloc alloca.c
    141 
    142 alloca.c: $(srcdir)/MISC/alloca.c
    143 	@delete alloca.c
    144 	copy $(srcdir)/MISC/alloca.c .
    145 
    146 test: check
    147 check: flex
    148 	$(FLEX_EXEC) $(FLEX_FLAGS) $(COMPRESSION) $(srcdir)/scan.l > temp_a
    149 	$(SED) s,"$(srcdir)/scan.l","scan.l", < temp_a > temp_b
    150 	-diff scan.c temp_b -l10000 -w
    151 	@delete temp_?
    152 	@echo "Check successful, using COMPRESSION='$(COMPRESSION)'"
    153 
    154 bigcheck:
    155 	delete scan.c
    156 	$(MAKE) COMPRESSION=-C check
    157 	delete scan.c
    158 	$(MAKE) COMPRESSION=-Ce check
    159 	delete scan.c
    160 	$(MAKE) COMPRESSION=-Cm check
    161 	delete scan.c
    162 	$(MAKE) COMPRESSION=-Cfea check
    163 	delete scan.c
    164 	$(MAKE) COMPRESSION=-CFer check
    165 	delete scan.c
    166 	$(MAKE) COMPRESSION=-l PERF_REPORT= check
    167 	delete scan.c
    168 	$(MAKE)
    169 	@echo "All checks successful"
    170 
    171 $(FLEXLIB): $(LIBOBJS)
    172 	$(AR) $(FLEXLIB) R $(LIBOBJS)
    173 
    174 $(FLEX).man: flex.1 # SMAKE can't `cd', sorry.  And, I don't have nroff.
    175 #	cd $(srcdir), nroff -man flex.1 >$(FLEX).man
    176 
    177 install: $(FLEX) $(FLEXLIB)
    178 	$(INSTALL_PROGRAM) $(FLEX) $(bindir)/$(FLEX)
    179 #	@delete $(bindir)/$(FLEX)++
    180 	$(INSTALL_DATA) $(FLEXLIB) $(libdir)/libfl.lib
    181 	$(INSTALL_DATA) $(srcdir)/FlexLexer.h $(includedir)/FlexLexer.h
    182 
    183 ansilibmain.o: ansilibmain.c
    184 ansilibmain.c: libmain.c libmain.ch
    185 	$(WMERGE) libmain.c libmain.ch ansilibmain.c
    186 ansilibyywrap.o: ansilibyywrap.c
    187 ansilibyywrap.c: libyywrap.c libyywrap.ch
    188 	$(WMERGE) libyywrap.c libyywrap.ch ansilibyywrap.c
    189 
    190 clean:
    191 	-delete parse.(c|h) ansi\#? \#?.(bak|o|lnk) \
    192 	alloca.c lex.yy.(c|cc) $(FLEXLIB)
    193 
    194 veryclean: clean
    195 	-delete $(FLEX) scan.c
    196