home *** CD-ROM | disk | FTP | other *** search
/ Mega Top 1 / os2_top1.zip / os2_top1 / APPS / TEKST / FLEX246 / MAKEFILE.OS2 < prev    next >
Encoding:
Text File  |  1994-01-10  |  1.9 KB  |  77 lines

  1. # make file for "flex" tool, emx+gcc
  2.  
  3. # Note that this makefile uses flex.skel as the skeleton file, but
  4. # the final executable has flex.skl builtin (for FAT compatibility)
  5. # and flex.skel should be installed (next to flex.exe) as flex.skl
  6.  
  7. release:
  8.     $(MAKE) -f Makefile.os2 flex.exe \
  9.     CC="gcc -Zomf -Zmtd -O -s" O=".obj" A=".lib" AR="emxomfar"
  10. debug:
  11.     $(MAKE) -f Makefile.os2 flex.exe \
  12.     CC="gcc -g" O=".o" A=".a" AR="ar"
  13.  
  14. CFLAGS = -DOS2 -DSHORT_FILE_NAMES
  15. LDFLAGS = -Zstack 1024
  16.  
  17. YACC = bison 
  18. FLEX = flex
  19. FLEX_FLAGS = -ist
  20.  
  21. .SUFFIXES: .c $O
  22.  
  23. .c$O:
  24.     $(CC) $(CFLAGS) -c $<
  25.  
  26. FLEXLIB = libfl$A
  27. FLEXOBJS = ccl$O dfa$O ecs$O gen$O main$O misc$O nfa$O parse$O \
  28.     scan$O skel$O sym$O tblcmp$O yylex$O
  29. LIBOBJS = libmain$O libyywrap$O
  30.  
  31. flex.exe : $(FLEXOBJS) $(FLEXLIB)
  32.     $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(FLEXOBJS) $(FLEXLIB)
  33.  
  34. first_flex:
  35.     cp initscan.c scan.c
  36.     $(MAKE) $(MFLAGS) flex
  37.  
  38. $(FLEXLIB): $(LIBOBJS)
  39.     $(AR) cru $(FLEXLIB) $(LIBOBJS)
  40.     $(AR) s $(FLEXLIB)
  41.  
  42. parse.h parse.c: parse.y
  43.     $(YACC) -d -o parse.c parse.y
  44.  
  45. scan.c : scan.l
  46.     $(FLEX) $(FLEX_FLAGS) $(COMPRESSION) scan.l >scan.c
  47.  
  48. scan$O : scan.c parse.h flexdef.h
  49.  
  50. main$O : main.c flexdef.h
  51. ccl$O : ccl.c flexdef.h
  52. dfa$O : dfa.c flexdef.h
  53. ecs$O : ecs.c flexdef.h
  54. gen$O : gen.c flexdef.h
  55. misc$O : misc.c flexdef.h
  56. nfa$O : nfa.c flexdef.h
  57. parse$O : parse.c flexdef.h
  58. sym$O : sym.c flexdef.h
  59. tblcmp$O : tblcmp.c flexdef.h
  60. yylex$O : yylex.c flexdef.h
  61.  
  62. skel.c: flex.skl mkskel.sh
  63.     $(SHELL) mkskel.sh flex.skl >skel.c
  64.  
  65. test : flex
  66.     flex $(FLEX_FLAGS) $(COMPRESSION) scan.l | diff scan.c -
  67.  
  68. bigtest :
  69.     rm -f scan.c ; $(MAKE) COMPRESSION="-C" test
  70.     rm -f scan.c ; $(MAKE) COMPRESSION="-Ce" test
  71.     rm -f scan.c ; $(MAKE) COMPRESSION="-Cm" test
  72.     rm -f scan.c ; $(MAKE) COMPRESSION="-Cfe" test
  73.     rm -f scan.c ; $(MAKE) COMPRESSION="-CFe" test
  74.     rm -f scan.c ; $(MAKE) COMPRESSION="-Cf" test
  75.     rm -f scan.c ; $(MAKE) COMPRESSION="-CF" test
  76.     rm -f scan.c ; $(MAKE)
  77.