1 # 2 # make file for "flex" tool 3 # @(#) $Header: /usr/fsys/odin/a/vern/flex/RCS/Makefile,v 2.9 4 # 90/05/26 17:28:44 vern Exp $ (LBL) 5 # 6 # the first time around use "nmake f_flex" 7 # 8 # This makefile is specific for Microsoft's Visual C 2.0, & nmake 9 # 10 # - Stan Adermann <stana (at] leonardo.lmt.com> 11 # 12 13 14 SKELFLAGS = -DDEFAULT_SKELETON_FILE=\"c:/src/flex/flex.skl\" 15 CFLAGS = -nologo -W2 -F 8000 -Ox -DUSG 16 LDFLAGS = /nologo /BATCH /STACK:8000 17 FLEX_FLAGS = -ist8 -Sflex.skl 18 19 FLEX = .\flex.exe 20 CC = cl 21 YACC = c:\lib\byacc 22 MAKE = nmake /nologo 23 24 FLEXOBJS = \ 25 ccl.obj \ 26 dfa.obj \ 27 ecs.obj \ 28 gen.obj \ 29 main.obj \ 30 misc.obj \ 31 nfa.obj \ 32 parse.obj \ 33 scan.obj \ 34 skel.obj \ 35 sym.obj \ 36 tblcmp.obj \ 37 yylex.obj 38 39 FLEX_C_SOURCES = \ 40 ccl.c \ 41 dfa.c \ 42 ecs.c \ 43 gen.c \ 44 main.c \ 45 misc.c \ 46 nfa.c \ 47 parse.c \ 48 scan.c \ 49 skel.c \ 50 sym.c \ 51 tblcmp.c \ 52 yylex.c 53 54 all : flex.exe 55 56 flex.exe : $(FLEXOBJS) 57 link $(LDFLAGS) $(FLEXOBJS) -out:$*.exe 58 59 f_flex: 60 copy initscan.c scan.c 61 touch scan.c 62 @echo compiling first flex 63 $(MAKE) flex.exe 64 del scan.c 65 @echo using first flex to generate final version... 66 $(MAKE) flex.exe 67 68 # 69 # general inference rule 70 # 71 .c.obj: 72 $(CC) -c $(CFLAGS) $*.c 73 74 parse.h parse.c : parse.y 75 $(YACC) -d parse.y 76 @move y_tab.c parse.c 77 @move y_tab.h parse.h 78 79 scan.c : scan.l 80 $(FLEX) $(FLEX_FLAGS) $(COMPRESSION) scan.l >scan.c 81 82 83 scan.obj : scan.c parse.h flexdef.h 84 85 main.obj : main.c flexdef.h 86 $(CC) $(CFLAGS) -c $(SKELFLAGS) main.c 87 88 ccl.obj : ccl.c flexdef.h 89 dfa.obj : dfa.c flexdef.h 90 ecs.obj : ecs.c flexdef.h 91 gen.obj : gen.c flexdef.h 92 misc.obj : misc.c flexdef.h 93 nfa.obj : nfa.c flexdef.h 94 parse.obj : parse.c flexdef.h 95 sym.obj : sym.c flexdef.h 96 tblcmp.obj : tblcmp.c flexdef.h 97 yylex.obj : yylex.c flexdef.h 98 skel.obj : skel.c flexdef.h 99 100 101 clean : 102 del *.obj 103 del *.map 104