summaryrefslogtreecommitdiffstats
path: root/src/Makefile
diff options
context:
space:
mode:
authorichizok <gclient.gaap@gmail.com>2022-01-31 12:27:18 +0000
committerBram Moolenaar <Bram@vim.org>2022-01-31 12:27:18 +0000
commit672776dbe8427876ef4bfce84520712df87b6eb1 (patch)
tree96bd350e3654192104bfa9480fa2056a2e94c40f /src/Makefile
parent48a604845e33399893d6bf293e71bcd2a412800d (diff)
patch 8.2.4270: generating nv_cmdidxs.h requires building Vim twicev8.2.4270
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)
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/Makefile b/src/Makefile
index 549b8177b7..96ec34a6c3 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -2141,19 +2141,21 @@ autoconf:
# This only needs to be run when a command name has been added or changed.
# If this fails because you don't have Vim yet, first build and install Vim
# without changes.
+# This requires a "vim" executable with the +eval feature.
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
- ./$(VIMTARGET) --clean -X --not-a-term -u create_nvcmdidxs.vim
-
+# added.
+# This requires a "vim" executable with the +eval feature.
+# If this fails because you don't have Vim yet:
+# - change nv_cmds[] in nv_cmds.h to add the new normal/visual mode command.
+# - run "make nvcmdidxs" to generate nv_cmdidxs.h
+nvcmdidxs: auto/config.mk nv_cmds.h
+ $(CC) -I$(srcdir) $(ALL_CFLAGS) create_nvcmdidxs.c -o create_nvcmdidxs
+ vim --clean -N -X --not-a-term -u create_nvcmdidxs.vim -c quit
+ -rm -f create_nvcmdidxs
# The normal command to compile a .c file to its .o file.
# Without or with ALL_CFLAGS.
@@ -4012,7 +4014,7 @@ objects/move.o: move.c vim.h protodef.h auto/config.h feature.h os_unix.h \
objects/normal.o: normal.c vim.h protodef.h auto/config.h feature.h os_unix.h \
auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
- proto.h globals.h errors.h nv_cmdidxs.h
+ proto.h globals.h errors.h nv_cmdidxs.h nv_cmds.h
objects/ops.o: ops.c vim.h protodef.h auto/config.h feature.h os_unix.h \
auto/osdef.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \