# # makefile for vile on WIN32 using Microsoft Visual C++ # # $Header: /usr/build/vile/vile/RCS/makefile.wnt,v 1.85 2005/03/11 00:53:06 tom Exp $ # # !include ############################################################################### # These are the symbols that you may wish to set on the command line: # CFG - primary configuration (console vs windows) # DBG - nonempty for debugging # FLT - nonempty for built-in filters # LEX - name of flex/lex program, if any (needed to make most filters). # OPT - secondary configuration (extra features) # ICON - winvile's icon # TRACE - nonempty to suppress tracing when building a debug-executable. # PROGNAME - vile/winvile $progname value ############################################################################### # you can override the icon to suit your taste (e.g,. vile, kitchen-sink, # or V-eye pumpkin). ICON = vile !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 # $(cflags), defined via ntwin32.mak, is a critical compiler resource. # This variable controls what OS features, such as a mouse wheel, can be # accessed via include files. CFLWIN32 = $(cflags:-W3=) # strip out warning option CFLWIN32 = $(CFLWIN32:-c=) # strip out -c flag # remove the "#" to get debugging info (and a larger executable) CC_DEBUG = -W4 #$(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 # debug/release configurations !IF "$(DBG)" != "" MY_CCOPT = $(cdebug) -DVILE_ERROR_ABORT MY_LDOPT = $(ldebug) !IF "$(TRACE)" == "" DBGOBJS = trace.obj MY_CCOPT = $(MY_CCOPT) -DOPT_TRACE !ENDIF !else MY_LDOPT = -pdb:none !endif # options common to all configurations MY_CCOPT = $(MY_CCOPT) -DOPT_LOCALE !IF "$(CFG)" == "vile" || "$(CFG)" == "vile-with-perl" DISP_DEF = -DDISP_NTCONS TARGET = vile CFLAGS = $(cvarsmt) $(CC_DEBUG) -nologo -DWIN32_LEAN_AND_MEAN -G4 \ -Dscrn_chosen $(DISP_DEF) $(PERLOPTS) $(MY_CCOPT) $(CFLWIN32) LDFLAGS = -nologo $(MY_LDOPT) SCREEN = ntconio LIBS = $(LD_DEBUG) $(conlflags) $(conlibsmt) user32.lib comdlg32.lib \ ole32.lib shell32.lib $(VILE_PERL_LIB) !endif !IF "$(CFG)" == "winvile" || "$(CFG)" == "winvile-with-perl" DISP_DEF = -DDISP_NTWIN TARGET = winvile CFLAGS = $(cvarsmt) $(CC_DEBUG) -nologo -DWIN32_LEAN_AND_MEAN -G4 \ -Dscrn_chosen $(DISP_DEF) $(PERLOPTS) $(MY_CCOPT) $(CFLWIN32) LDFLAGS = -nologo /subsystem:windows /incremental:no $(MY_LDOPT) SCREEN = ntwinio LIBS = $(LD_DEBUG) $(guilflags) $(guilibsmt) ole32.lib shell32.lib \ $(VILE_PERL_LIB) $(OLELIBS) EXTRA = winvile.res !endif !IF "$(PROGNAME)" != "" && "$(PROGNAME)" != "$(TARGET)" !MESSAGE Overriding target name to $(PROGNAME) TARGET = $(PROGNAME) CFLAGS = $(CFLAGS) -DPROGRAM_NAME=\"$(PROGNAME)\" !endif MAPFILE = $(TARGET).map ZIPFILE = $(TARGET).zip EXEFILE = $(TARGET).exe !IF "$(OPT)" == "ole-auto" CFLAGS = $(CFLAGS) -DVILE_OLE OLEOBJS = w32ole.obj w32reg.obj w32ole.res OLESRCS = w32ole.cpp w32reg.c WRAPUTIL = wvwrap.exe EXTRA = OLELIBS = uuid.lib oleaut32.lib comsupp.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 = \ perl/Breadcrumbs.pm \ perl/CaptHook.pm \ perl/Glob2re.pm \ perl/Vile/Manual.pm \ perl/Vile/exporter.pm \ perl/Visit.pm \ perl/directory.pm \ perl/dirlist.pm \ perl/hgrep.pm \ perl/search.pm !ENDIF MYLIBS = # these headers are built by the mktbls program from the information in cmdtbl # and in modetbl MYHDRS = \ nebind.h \ neexec.h \ nefkeys.h \ nefsms.h \ nefunc.h \ nemode.h \ nename.h \ neproto.h \ nevars.h FLTLIB = filters\builtflt.lib !IF "$(FLT)" != "" EXTRA = $(EXTRA) builtflt.obj # MYHDRS = $(MYHDRS) builtflt.h MYLIBS = $(MYLIBS) $(FLTLIB) CFLAGS = $(CFLAGS) -DOPT_FILTER -Ifilters -I. !IF "$(LEX)" != "" CFLAGS = $(CFLAGS) -DOPT_LEX_FILTER !endif !endif # these are normal editable headers HDRS = estruct.h edef.h proto.h dirstuff.h SRC = main.c $(SCREEN).c \ basic.c bind.c btree.c buffer.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 oneliner.c opers.c \ path.c random.c regexp.c \ region.c search.c select.c spawn.c statevar.c \ tags.c tbuff.c termio.c ucrypt.c undo.c \ version.c window.c word.c wordmov.c map.c \ w32cbrd.c w32cmd.c w32misc.c w32oo.cpp w32pipe.c $(PERLSRCS) \ $(OLESRCS) OBJ = main.obj $(SCREEN).obj \ basic.obj bind.obj btree.obj buffer.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 oneliner.obj opers.obj \ path.obj random.obj regexp.obj \ region.obj search.obj select.obj spawn.obj statevar.obj \ tags.obj tbuff.obj termio.obj ucrypt.obj undo.obj \ version.obj window.obj word.obj wordmov.obj map.obj \ w32cbrd.obj w32cmd.obj w32misc.obj w32oo.obj w32pipe.obj $(PERLOBJS) \ $(OLEOBJS) $(DBGOBJS) $(EXTRA) .c.obj: $(cc) $(CFLAGS) -c $< -Fo$@ .cpp.obj: $(cc) $(CFLAGS) -c $< -Fo$@ all :: $(PERLCFG) $(EXEFILE) $(WRAPUTIL) sources :: $(MYHDRS) $(EXEFILE) : $(MYHDRS) $(OBJ) $(MYLIBS) $(link) $(LDFLAGS) $(OBJ) $(MYLIBS) $(LIBS) -out:$(EXEFILE) -map:$(MAPFILE) winvile.res : winvile.rc winvile.h $(RC) -DVILE_ICON="$(ICON).ico" -Iicons winvile.rc # collect some perl environment info $(PERLCFG): $(PERL_SCRIPTS) mkprlenv.wnt !INCLUDE "mkprlenv.wnt" $(OBJ): estruct.h edef.h proto.h $(MYHDRS) builtflt.obj : builtflt.h MAKE_FLT = FLT=$(FLT) LEX="$(LEX)" DBG="$(DBG)" SCREEN="$(SCREEN)" -$(MAKEFLAGS) builtflt.h : cd filters $(MAKE) -f makefile.wnt genmake.exe $(MAKE_FLT) mk-0th.bat genmake.mak ..\$@ cd .. $(FLTLIB) : $(MYHDRS) cd filters $(MAKE) -f makefile.wnt all $(MAKE_FLT) cd .. 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 > $@ vile-perl-api.pod: perl.xs perl -lne "print if s/^\s{1,2}#\s{0,1}//" perl.xs > $@ vile-perl-api.doc: vile-perl-api.pod perl -e "use Pod::Text; pod2text(\"$?\");" > $@ wvwrap.exe: wvwrap.obj $(link) $(LDFLAGS) wvwrap.obj $(LIBS) -out:$(@) mktbls.exe: mktbls.c $(cc) $(CFLAGS) mktbls.c -Fomktbls -link $(CON_LDFLAGS) w32ole.res: w32ole.rc winvile.tlb $(RC) $(DISP_DEF) -DVILE_ICON="$(ICON).ico" -Iicons w32ole.rc winviletlb.h winvile.tlb: winvile.odl midl -h winviletlb.h -tlb winvile.tlb winvile.odl clean :: -del *.bak -del *.exe -del *.map -del *.obj -del ne*.h -del $(THE_PERLCFG) -del builtflt.h -del perl.c -del winviletlb.h -del winvile_i.c -del *.tlb -del *.res dist : $(EXEFILE) - del $(ZIPFILE) echo "$(TARGET)", vi-like-emacs for win32 >zipnote.txt zip $(TARGET).zip readme.pc readme $(EXEFILE) $(MAPFILE) vile.hlp zip -z $(ZIPFILE)