# # makefile for vile on WIN32 using Microsoft Visual C++ # # $Header: /usr/build/vile/vile/RCS/makefile.wnt,v 1.32 1998/10/01 10:14:08 cmorgan Exp $ # # !include !IF "$(CFG)" == "" CFG=vile !MESSAGE No configuration (CFG) specified. Defaulting to vile (console) !ENDIF !IF ("$(CFG)" != "vile" && "$(CFG)" != "winvile" && \ "$(CFG)" != "vile-with-perl" && "$(CFG)" != "winvile-with-perl") || \ ("$(OPT)" != "" && "$(OPT)" != "ole-auto") || \ ("$(OPT)" == "ole-auto" && \ ("$(CFG)" == "vile" || "$(CFG)" == "vile-with-perl")) !MESSAGE Invalid configuration specified! !MESSAGE !MESSAGE You can specify a configuration when running NMAKE on this makefile !MESSAGE by defining a CFG and/or OPT macro on the command line. Possible !MESSAGE configuration choices are: !MESSAGE !MESSAGE vile - console !MESSAGE vile-with-perl - console and embedded perl !MESSAGE winvile - gui !MESSAGE winvile-with-perl - gui and embedded perl !MESSAGE !MESSAGE The 'with-perl' configurations have two preconditions which must be !MESSAGE met prior to initiating the build. Refer to the file "mkprlenv.wnt" !MESSAGE for more details. !MESSAGE !MESSAGE The only supported OPT value is: !MESSAGE !MESSAGE ole-auto - add basic ole automation to winvile !MESSAGE !MESSAGE Examples: !MESSAGE !MESSAGE /* build console editor */ !MESSAGE nmake -f makefile.wnt !MESSAGE !MESSAGE /* build gui editor with embedded perl and basic ole automation */ !MESSAGE nmake -f makefile.wnt CFG=winvile-with-perl OPT=ole-auto !MESSAGE !ERROR An invalid configuration is specified. !ENDIF # remove the "#" to get debugging info (and a larger executable) CC_DEBUG = #$(cdebug) LD_DEBUG = #$(ldebug) # Other vars CON_LDFLAGS = -nologo -pdb:none DEVNULL = nul PERLCFG = $(DEVNULL) THE_PERLCFG = perl_env.inc !IF EXIST("$(THE_PERLCFG)") !INCLUDE "$(THE_PERLCFG)" !ENDIF !IF "$(CFG)" == "vile" || "$(CFG)" == "vile-with-perl" DISP_DEF = -DDISP_NTCONS TARGET = vile.exe UTILS = vile-c-filt.exe CFLAGS = $(cvarsmt) $(CC_DEBUG) -nologo -DWIN32_LEAN_AND_MEAN -G4 \ -Dscrn_chosen $(DISP_DEF) $(PERLOPTS) LDFLAGS = -nologo -pdb:none SCREEN = ntconio LIBS = $(LD_DEBUG) $(conlflags) $(conlibsmt) user32.lib $(VILE_PERL_LIB) !endif !IF "$(CFG)" == "winvile" || "$(CFG)" == "winvile-with-perl" DISP_DEF = -DDISP_NTWIN TARGET = winvile.exe UTILS = vile-c-filt.exe CFLAGS = $(cvarsmt) $(CC_DEBUG) -nologo -DWIN32_LEAN_AND_MEAN -G4 \ -Dscrn_chosen $(DISP_DEF) $(PERLOPTS) LDFLAGS = -nologo /nologo /subsystem:windows /incremental:no -pdb:none SCREEN = ntwinio LIBS = $(LD_DEBUG) $(guilflags) $(guilibsmt) $(VILE_PERL_LIB) $(OLELIBS) !endif !IF "$(OPT)" == "ole-auto" CFLAGS = $(CFLAGS) -DVILE_OLE OLEOBJS = w32ole.obj w32reg.obj w32ole.res OLESRCS = w32ole.cpp w32reg.c OLELIBS = ole32.lib uuid.lib oleaut32.lib !endif !IF "$(CFG)" == "winvile-with-perl" || "$(CFG)" == "vile-with-perl" # # CPAN's most recent X86 binary perl distribution, dated 12-Nov-97, does # not export perl's record separator symbol ($/). Consequently, the # preprocessor macro HAVE_BROKEN_PERL_RS must be defined to permit # successful linking of perl-embedded versions of the editor. When this # macro is defined, READLINE performance in perl.xs may be adversely # affected. Comment out the makefile macro "PERLFIX" if your version of # perl properly exports $/ . # PERLFIX = -DHAVE_BROKEN_PERL_RS PERLOPTS = -DOPT_PERL=1 -I$(VILE_PERL_INC) $(PERLFIX) PERLOBJS = api.obj perl.obj watch.obj PERLSRCS = api.c perl.c watch.c PERLCFG = $(THE_PERLCFG) # # The following perl scripts, stored in the subdirectory .\perl, are # known to work under win32: # PERL_SCRIPTS = glob2re.pl visit.pl hgrep.pl search.pl syntax.pl hilite.pl !ENDIF # these are normal editable headers HDRS = estruct.h edef.h proto.h dirstuff.h # these headers are built by the mktbls program from the information in cmdtbl # and in modetbl BUILTHDRS = nebind.h neproto.h neexec.h nefunc.h nemode.h nename.h nevars.h \ nefkeys.h nefsms.h SRC = main.c $(SCREEN).c \ basic.c bind.c btree.c buffer.c crypt.c \ csrch.c display.c eval.c exec.c externs.c \ fences.c file.c filec.c \ fileio.c finderr.c glob.c globals.c history.c \ input.c insert.c itbuff.c isearch.c \ line.c modes.c msgs.c npopen.c oneliner.c opers.c \ path.c random.c regexp.c \ region.c search.c select.c spawn.c \ tags.c tbuff.c termio.c undo.c \ version.c window.c word.c wordmov.c map.c \ w32cbrd.c w32misc.c w32pipe.c $(PERLSRCS) \ $(OLESRCS) OBJ = main.obj $(SCREEN).obj \ basic.obj bind.obj btree.obj buffer.obj crypt.obj \ csrch.obj display.obj eval.obj exec.obj externs.obj \ fences.obj file.obj filec.obj \ fileio.obj finderr.obj glob.obj globals.obj history.obj \ input.obj insert.obj itbuff.obj isearch.obj \ line.obj modes.obj msgs.obj npopen.obj oneliner.obj opers.obj \ path.obj random.obj regexp.obj \ region.obj search.obj select.obj spawn.obj \ tags.obj tbuff.obj termio.obj undo.obj \ version.obj window.obj word.obj wordmov.obj map.obj \ w32cbrd.obj w32misc.obj w32pipe.obj $(PERLOBJS) \ $(OLEOBJS) .c.obj: $(cc) $(CFLAGS) -c $< -Fo$@ .cpp.obj: $(cc) $(CFLAGS) $(CFLAGS) -c $< -Fo$@ all: $(PERLCFG) $(TARGET) $(UTILS) $(TARGET): $(BUILTHDRS) $(OBJ) $(link) $(LDFLAGS) $(OBJ) $(LIBS) -out:$(TARGET) # collect some perl environment info $(PERLCFG): mkprlenv.wnt !INCLUDE "mkprlenv.wnt" $(OBJ): estruct.h nemode.h edef.h neproto.h proto.h nefkeys.h nebind.h \ nefkeys.h \ neexec.h \ nefunc.h \ neproto.h \ nename.h : cmdtbl mktbls.exe mktbls.exe cmdtbl nefsms.h \ nevars.h \ nemode.h: modetbl mktbls.exe mktbls.exe modetbl perl.c: perl.xs ptypemap perl $(VILE_PERL_UTILS)\xsubpp -typemap $(VILE_PERL_UTILS)\typemap \ -typemap ptypemap perl.xs > $@ mktbls.exe: mktbls.c $(cc) $(CFLAGS) mktbls.c -Fomktbls -link $(CON_LDFLAGS) vile-c-filt.exe: c-filt.c $(cc) $(CFLAGS) c-filt.c \ -Fovile-c-filt -link $(CON_LDFLAGS) w32ole.res: w32ole.rc winvile.tlb $(RC) $(DISP_DEF) w32ole.rc winviletlb.h winvile.tlb: winvile.odl midl -h winviletlb.h -tlb winvile.tlb winvile.odl clean: del *.exe del *.obj del ne*.h -del $(THE_PERLCFG) -del perl.c -del winviletlb.h -del *.tlb -del *.res api.obj: api.h bind.obj: nefunc.h btree.h btree.obj: btree.h eval.obj: nevars.h exec.obj: neexec.h nefunc.h externs.obj: nebind.h nename.h neproto.h nefunc.h filec.obj: dirstuff.h glob.obj: dirstuff.h globals.obj: nefunc.h main.obj: chgdfunc.h nevars.h modes.obj: chgdfunc.h nefsms.h opers.obj: nefunc.h path.obj: dirstuff.h perl.obj: api.h random.obj: nefunc.h select.obj: nefunc.h spawn.obj: nefunc.h tags.obj: btree.h termio.obj: nefunc.h version.obj: patchlev.h w32misc.obj: nefunc.h w32ole.obj: w32ole.h winviletlb.h w32reg.h w32reg.obj: w32reg.h word.obj: nefunc.h