home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / vile-src.zip / vile-8.1 / makefile.wnt < prev    next >
Makefile  |  1998-10-01  |  7KB  |  231 lines

  1. #
  2. # makefile for vile on WIN32 using Microsoft Visual C++
  3. #
  4. # $Header: /usr/build/vile/vile/RCS/makefile.wnt,v 1.32 1998/10/01 10:14:08 cmorgan Exp $
  5. #
  6. #
  7. !include <ntwin32.mak>
  8.  
  9. !IF "$(CFG)" == ""
  10. CFG=vile
  11. !MESSAGE No configuration (CFG) specified.  Defaulting to vile (console)
  12. !ENDIF
  13.  
  14. !IF ("$(CFG)" != "vile" && "$(CFG)" != "winvile"  &&                     \
  15.      "$(CFG)" != "vile-with-perl" && "$(CFG)" != "winvile-with-perl") || \
  16.     ("$(OPT)" != "" && "$(OPT)" != "ole-auto") ||                        \
  17.         ("$(OPT)" == "ole-auto" &&                                       \
  18.         ("$(CFG)" == "vile" || "$(CFG)" == "vile-with-perl"))
  19. !MESSAGE Invalid configuration specified!
  20. !MESSAGE
  21. !MESSAGE You can specify a configuration when running NMAKE on this makefile
  22. !MESSAGE by defining a CFG and/or OPT macro on the command line.  Possible
  23. !MESSAGE configuration choices are:
  24. !MESSAGE
  25. !MESSAGE vile              - console
  26. !MESSAGE vile-with-perl    - console and embedded perl
  27. !MESSAGE winvile           - gui
  28. !MESSAGE winvile-with-perl - gui and embedded perl
  29. !MESSAGE
  30. !MESSAGE The 'with-perl' configurations have two preconditions which must be
  31. !MESSAGE met prior to initiating the build.  Refer to the file "mkprlenv.wnt"
  32. !MESSAGE for more details.
  33. !MESSAGE
  34. !MESSAGE The only supported OPT value is:
  35. !MESSAGE
  36. !MESSAGE ole-auto          - add basic ole automation to winvile
  37. !MESSAGE
  38. !MESSAGE Examples:
  39. !MESSAGE
  40. !MESSAGE /* build console editor */
  41. !MESSAGE nmake -f makefile.wnt
  42. !MESSAGE
  43. !MESSAGE /* build gui editor with embedded perl and basic ole automation */
  44. !MESSAGE nmake -f makefile.wnt CFG=winvile-with-perl OPT=ole-auto
  45. !MESSAGE
  46. !ERROR An invalid configuration is specified.
  47. !ENDIF
  48.  
  49. # remove the "#" to get debugging info (and a larger executable)
  50. CC_DEBUG     = #$(cdebug)
  51. LD_DEBUG     = #$(ldebug)
  52.  
  53. # Other vars
  54. CON_LDFLAGS  = -nologo -pdb:none
  55. DEVNULL      = nul
  56. PERLCFG      = $(DEVNULL)
  57. THE_PERLCFG  = perl_env.inc
  58.  
  59. !IF EXIST("$(THE_PERLCFG)")
  60. !INCLUDE "$(THE_PERLCFG)"
  61. !ENDIF
  62.  
  63. !IF  "$(CFG)" == "vile" || "$(CFG)" == "vile-with-perl"
  64. DISP_DEF = -DDISP_NTCONS
  65. TARGET   = vile.exe
  66. UTILS    = vile-c-filt.exe
  67. CFLAGS   = $(cvarsmt) $(CC_DEBUG) -nologo -DWIN32_LEAN_AND_MEAN -G4 \
  68.            -Dscrn_chosen $(DISP_DEF) $(PERLOPTS)
  69. LDFLAGS  = -nologo -pdb:none
  70. SCREEN   = ntconio
  71. LIBS     = $(LD_DEBUG) $(conlflags) $(conlibsmt) user32.lib $(VILE_PERL_LIB)
  72. !endif
  73.  
  74. !IF  "$(CFG)" == "winvile" || "$(CFG)" == "winvile-with-perl"
  75. DISP_DEF = -DDISP_NTWIN
  76. TARGET   = winvile.exe
  77. UTILS    = vile-c-filt.exe
  78. CFLAGS   = $(cvarsmt) $(CC_DEBUG) -nologo -DWIN32_LEAN_AND_MEAN -G4 \
  79.            -Dscrn_chosen $(DISP_DEF) $(PERLOPTS)
  80. LDFLAGS  = -nologo /nologo /subsystem:windows /incremental:no -pdb:none
  81. SCREEN   = ntwinio
  82. LIBS     = $(LD_DEBUG) $(guilflags) $(guilibsmt) $(VILE_PERL_LIB) $(OLELIBS)
  83. !endif
  84.  
  85. !IF "$(OPT)" == "ole-auto"
  86. CFLAGS   = $(CFLAGS) -DVILE_OLE
  87. OLEOBJS  = w32ole.obj w32reg.obj w32ole.res
  88. OLESRCS  = w32ole.cpp w32reg.c
  89. OLELIBS  = ole32.lib uuid.lib oleaut32.lib
  90. !endif
  91.  
  92. !IF "$(CFG)" == "winvile-with-perl" || "$(CFG)" == "vile-with-perl"
  93. #
  94. # CPAN's most recent X86 binary perl distribution, dated 12-Nov-97, does
  95. # not export perl's record separator symbol ($/).  Consequently, the
  96. # preprocessor macro HAVE_BROKEN_PERL_RS must be defined to permit
  97. # successful linking of perl-embedded versions of the editor.  When this
  98. # macro is defined, READLINE performance in perl.xs may be adversely
  99. # affected.  Comment out the makefile macro "PERLFIX" if your version of
  100. # perl properly exports $/ .
  101. #
  102. PERLFIX  = -DHAVE_BROKEN_PERL_RS
  103. PERLOPTS = -DOPT_PERL=1 -I$(VILE_PERL_INC) $(PERLFIX)
  104. PERLOBJS = api.obj perl.obj watch.obj
  105. PERLSRCS = api.c perl.c watch.c
  106. PERLCFG  = $(THE_PERLCFG)
  107. #
  108. # The following perl scripts, stored in the subdirectory .\perl, are
  109. # known to work under win32:
  110. #
  111. PERL_SCRIPTS = glob2re.pl visit.pl hgrep.pl search.pl syntax.pl hilite.pl
  112. !ENDIF
  113.  
  114. # these are normal editable headers
  115. HDRS = estruct.h edef.h proto.h dirstuff.h
  116.  
  117. # these headers are built by the mktbls program from the information in cmdtbl
  118. # and in modetbl
  119. BUILTHDRS = nebind.h neproto.h neexec.h nefunc.h nemode.h nename.h nevars.h \
  120.             nefkeys.h nefsms.h
  121.  
  122. SRC =     main.c $(SCREEN).c \
  123.     basic.c bind.c btree.c buffer.c crypt.c \
  124.     csrch.c display.c eval.c exec.c externs.c \
  125.     fences.c file.c filec.c \
  126.     fileio.c finderr.c glob.c globals.c history.c \
  127.     input.c insert.c itbuff.c isearch.c \
  128.     line.c modes.c msgs.c npopen.c oneliner.c opers.c \
  129.     path.c random.c regexp.c \
  130.     region.c search.c select.c spawn.c \
  131.     tags.c tbuff.c termio.c undo.c \
  132.     version.c window.c word.c wordmov.c map.c \
  133.     w32cbrd.c w32misc.c w32pipe.c $(PERLSRCS) \
  134.     $(OLESRCS)
  135.  
  136. OBJ =     main.obj $(SCREEN).obj \
  137.     basic.obj bind.obj btree.obj buffer.obj crypt.obj \
  138.     csrch.obj display.obj eval.obj exec.obj externs.obj \
  139.     fences.obj file.obj filec.obj \
  140.     fileio.obj finderr.obj glob.obj globals.obj history.obj \
  141.     input.obj insert.obj itbuff.obj isearch.obj \
  142.     line.obj modes.obj msgs.obj npopen.obj oneliner.obj opers.obj \
  143.     path.obj random.obj regexp.obj \
  144.     region.obj search.obj select.obj spawn.obj \
  145.     tags.obj tbuff.obj termio.obj undo.obj \
  146.     version.obj window.obj word.obj wordmov.obj map.obj \
  147.     w32cbrd.obj w32misc.obj w32pipe.obj $(PERLOBJS) \
  148.     $(OLEOBJS)
  149.  
  150. .c.obj:
  151.     $(cc) $(CFLAGS) -c $< -Fo$@
  152.  
  153. .cpp.obj:
  154.     $(cc) $(CFLAGS) $(CFLAGS) -c $< -Fo$@
  155.  
  156. all: $(PERLCFG) $(TARGET) $(UTILS)
  157.  
  158. $(TARGET):     $(BUILTHDRS) $(OBJ)
  159.     $(link) $(LDFLAGS) $(OBJ) $(LIBS) -out:$(TARGET)
  160.  
  161. # collect some perl environment info
  162. $(PERLCFG): mkprlenv.wnt
  163. !INCLUDE "mkprlenv.wnt"
  164.  
  165. $(OBJ): estruct.h nemode.h edef.h neproto.h proto.h nefkeys.h
  166.  
  167. nebind.h \
  168. nefkeys.h \
  169. neexec.h \
  170. nefunc.h \
  171. neproto.h \
  172. nename.h :    cmdtbl mktbls.exe
  173.     mktbls.exe cmdtbl
  174.  
  175. nefsms.h \
  176. nevars.h \
  177. nemode.h:    modetbl mktbls.exe
  178.     mktbls.exe modetbl
  179.  
  180. perl.c: perl.xs ptypemap
  181.     perl $(VILE_PERL_UTILS)\xsubpp -typemap $(VILE_PERL_UTILS)\typemap \
  182.         -typemap ptypemap perl.xs > $@
  183.  
  184. mktbls.exe:  mktbls.c
  185.     $(cc) $(CFLAGS) mktbls.c -Fomktbls -link $(CON_LDFLAGS)
  186.  
  187. vile-c-filt.exe: c-filt.c
  188.     $(cc) $(CFLAGS) c-filt.c \
  189.     -Fovile-c-filt -link $(CON_LDFLAGS)
  190.  
  191. w32ole.res: w32ole.rc winvile.tlb
  192.     $(RC) $(DISP_DEF) w32ole.rc
  193.  
  194. winviletlb.h winvile.tlb: winvile.odl
  195.     midl -h winviletlb.h -tlb winvile.tlb winvile.odl
  196.  
  197. clean:
  198.     del *.exe
  199.     del *.obj
  200.     del ne*.h
  201.     -del $(THE_PERLCFG)
  202.     -del perl.c
  203.     -del winviletlb.h
  204.     -del *.tlb
  205.     -del *.res
  206.  
  207. api.obj:    api.h
  208. bind.obj:    nefunc.h btree.h
  209. btree.obj:    btree.h
  210. eval.obj:    nevars.h
  211. exec.obj:    neexec.h nefunc.h
  212. externs.obj:    nebind.h nename.h neproto.h nefunc.h
  213. filec.obj:    dirstuff.h
  214. glob.obj:    dirstuff.h
  215. globals.obj:    nefunc.h
  216. main.obj:    chgdfunc.h nevars.h
  217. modes.obj:    chgdfunc.h nefsms.h
  218. opers.obj:    nefunc.h
  219. path.obj:    dirstuff.h
  220. perl.obj:    api.h
  221. random.obj:    nefunc.h
  222. select.obj:    nefunc.h
  223. spawn.obj:    nefunc.h
  224. tags.obj:    btree.h
  225. termio.obj:    nefunc.h
  226. version.obj:    patchlev.h
  227. w32misc.obj:    nefunc.h
  228. w32ole.obj:    w32ole.h winviletlb.h w32reg.h
  229. w32reg.obj:    w32reg.h
  230. word.obj:    nefunc.h
  231.