diff src/Make_mvc.mak @ 27484:ee1019e59bef v8.2.4270

patch 8.2.4270: generating nv_cmdidxs.h requires building Vim twice Commit: https://github.com/vim/vim/commit/672776dbe8427876ef4bfce84520712df87b6eb1 Author: ichizok <gclient.gaap@gmail.com> Date: Mon Jan 31 12:27:18 2022 +0000 patch 8.2.4270: generating nv_cmdidxs.h requires building Vim twice Problem: Generating nv_cmdidxs.h requires building Vim twice. Solution: Move the table into a separate file and use a separate executable to extract the command characters. (Ozaki Kiichi, closes #9669)
author Bram Moolenaar <Bram@vim.org>
date Mon, 31 Jan 2022 13:30:05 +0100
parents 4050f0554902
children c7e18e99dbe8
line wrap: on
line diff
--- a/src/Make_mvc.mak
+++ b/src/Make_mvc.mak
@@ -1444,17 +1444,17 @@ clean: testclean
 # If this fails because you don't have Vim yet, first build and install Vim
 # without changes.
 cmdidxs: ex_cmds.h
-	vim --clean -X --not-a-term -u create_cmdidxs.vim
+	vim --clean -N -X --not-a-term -u create_cmdidxs.vim -c quit
 
 # Run vim script to generate the normal/visual mode command lookup table.
 # This only needs to be run when a new normal/visual mode command has been
 # added.  If this fails because you don't have Vim yet:
-#   - change nv_cmds[] in normal.c to add the new normal/visual mode command.
-#   - build Vim
-#   - run "make nvcmdidxs" using the new Vim to generate nv_cmdidxs.h
-#   - rebuild Vim to use the newly generated nv_cmdidxs.h file.
-nvcmdidxs: normal.c
-	.\$(VIM) --clean -X --not-a-term -u create_nvcmdidxs.vim
+#   - change nv_cmds[] in nv_cmds.h to add the new normal/visual mode command.
+#   - run "make nvcmdidxs" to generate nv_cmdidxs.h
+nvcmdidxs: nv_cmds.h
+	$(CC) /nologo -I. -Iproto -DNDEBUG create_nvcmdidxs.c -link -subsystem:$(SUBSYSTEM_TOOLS)
+	vim --clean -N -X --not-a-term -u create_nvcmdidxs.vim -c quit
+	-del create_nvcmdidxs.exe
 
 test:
 	cd testdir
@@ -1719,7 +1719,7 @@ lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).l
 
 $(OUTDIR)/channel.obj:	$(OUTDIR) channel.c $(INCL)
 
-$(OUTDIR)/normal.obj:	$(OUTDIR) normal.c  $(INCL) nv_cmdidxs.h
+$(OUTDIR)/normal.obj:	$(OUTDIR) normal.c  $(INCL) nv_cmdidxs.h nv_cmds.h
 
 $(OUTDIR)/option.obj:	$(OUTDIR) option.c  $(INCL) optiondefs.h