1# 2# make file for "flex" tool 3# @(#) $Header: /usr/fsys/odin/a/vern/flex/RCS/Makefile,v 2.9 90/05/26 17:28:44 4 vern Exp $ (LBL) 5# 6# the first time around use "make f_flex" 7# 8# This makefile is specific for Microsoft's C/C++ compiler (v7), nmake and 9# lib 10# - Paul Stuart, Jan 93 (pjs@scammell.ecos.tne.oz.au) 11# 12 13 14SKELFLAGS = -DDEFAULT_SKELETON_FILE=\"c:/src/flex/flex.skl\" 15CFLAGS = -nologo -AL -W2 -F 8000 -Ox -Gt16000 -DMS_DOS -DUSG 16LDFLAGS = /nologo /NOI /BATCH /ONERROR:NOEXE /STACK:8000 17FLEX_FLAGS = -ist8 -Sflex.skl 18 19FLEX = .\flex.exe 20CC = cl 21YACC = c:\lib\byacc 22MAKE = nmake /nologo 23 24# 25# break obj-list into two because of 128 character command-line limit of 26# Microsoft's link and lib utilities. 27# 28FLEXOBJS1 = \ 29 ccl.obj \ 30 dfa.obj \ 31 ecs.obj \ 32 gen.obj \ 33 main.obj \ 34 misc.obj \ 35 nfa.obj \ 36 parse.obj 37 38FLEXOBJS2 = \ 39 scan.obj \ 40 sym.obj \ 41 tblcmp.obj \ 42 yylex.obj 43 44FLEX_C_SOURCES = \ 45 ccl.c \ 46 dfa.c \ 47 ecs.c \ 48 gen.c \ 49 main.c \ 50 misc.c \ 51 nfa.c \ 52 parse.c \ 53 scan.c \ 54 sym.c \ 55 tblcmp.c \ 56 yylex.c 57 58FLEX_LIB_OBJS = \ 59 libmain.obj 60 61 62all : flex.exe 63 64# 65# lib is used to get around the 128 character command-line limit of 'link'. 66# 67flex.exe : $(FLEXOBJS1) $(FLEXOBJS2) 68 lib /nologo tmplib $(FLEXOBJS1); 69 link $(LDFLAGS) $(FLEXOBJS2),$*.exe,,tmplib; 70 del tmplib.lib 71 72f_flex: 73 copy initscan.c scan.c 74 touch scan.c 75 @echo compiling first flex 76 $(MAKE) flex.exe 77 del scan.c 78 @echo using first flex to generate final version... 79 $(MAKE) flex.exe 80 81# 82# general inference rule 83# 84.c.obj: 85 $(CC) -c $(CFLAGS) $*.c 86 87parse.h parse.c : parse.y 88 $(YACC) -d parse.y 89 @mv y_tab.c parse.c 90 @mv y_tab.h parse.h 91 92scan.c : scan.l 93 $(FLEX) $(FLEX_FLAGS) $(COMPRESSION) scan.l >scan.c 94 95 96scan.obj : scan.c parse.h flexdef.h 97 98main.obj : main.c flexdef.h 99 $(CC) $(CFLAGS) -c $(SKELFLAGS) main.c 100 101ccl.obj : ccl.c flexdef.h 102dfa.obj : dfa.c flexdef.h 103ecs.obj : ecs.c flexdef.h 104gen.obj : gen.c flexdef.h 105misc.obj : misc.c flexdef.h 106nfa.obj : nfa.c flexdef.h 107parse.obj : parse.c flexdef.h 108sym.obj : sym.c flexdef.h 109tblcmp.obj : tblcmp.c flexdef.h 110yylex.obj : yylex.c flexdef.h 111 112 113clean : 114 del *.obj 115 del *.map 116