view runtime/syntax/generator/Makefile @ 34346:776cb5c73d6f

runtime(vim): include Vim Syntax generator Commit: https://github.com/vim/vim/commit/9b53c052d58f73f2078c61a74622687306e51c17 Author: h-east <h.east.727@gmail.com> Date: Tue Feb 13 21:09:22 2024 +0100 runtime(vim): include Vim Syntax generator fixes: https://github.com/vim/vim/issues/13939 closes: https://github.com/vim/vim/issues/14021 related: vim-jp/syntax-vim-ex#28 Signed-off-by: h-east <h.east.727@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Tue, 13 Feb 2024 21:15:03 +0100
parents
children da420cabb018
line wrap: on
line source

VIM_SRCDIR = ../../../src
RUN_VIM = $(VIM_SRCDIR)/vim -N -u NONE -i NONE -n
REVISION ?= $(shell date +%Y-%m-%dT%H:%M:%S%:z)

SRC =	$(VIM_SRCDIR)/eval.c $(VIM_SRCDIR)/ex_cmds.h $(VIM_SRCDIR)/ex_docmd.c \
		$(VIM_SRCDIR)/fileio.c $(VIM_SRCDIR)/option.c $(VIM_SRCDIR)/syntax.c

export VIM_SRCDIR

.PHONY: generate clean
all: generate

generate: vim.vim

vim.vim: vim.vim.rc update_date.vim
	@echo "Generating vim.vim ..."
	@cp -f vim.vim.rc ../vim.vim
	@$(RUN_VIM) -S update_date.vim
	@sed -i -e 's/__REVISION__/$(REVISION)/' ../vim.vim
	@echo "done."

vim.vim.rc: gen_syntax_vim.vim vim.vim.base $(SRC)
	@echo "Generating vim.vim.rc ..."
	@rm -f sanity_check.err generator.err
	@$(RUN_VIM) -S gen_syntax_vim.vim
	@if test -f sanity_check.err ; then \
		echo ; \
		echo "Sanity errors:" ; \
		cat sanity_check.err ; \
		exit 1 ; \
	fi
	@if test -f generator.err ; then \
		echo ; \
		echo "Generator errors:" ; \
		cat generator.err ; \
		echo ; \
		exit 1 ; \
	fi
	@echo "done."

clean:
	rm -f vim.vim.rc
	rm -f vim.vim
	rm -f sanity_check.err generator.err