From: Glenn Morris Date: Sun, 4 Apr 2021 23:57:55 +0000 (-0700) Subject: Regenerate semantic grammars if the generating code changes X-Git-Tag: emacs-28.0.90~3014 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9cb3db0bade2ea43bad9cadc7864887c09bc7cd0;p=emacs.git Regenerate semantic grammars if the generating code changes * admin/grammars/Makefile.in (emacs): Set load-prefer-newer. (grammar_bovine, grammar_wisent): New variables. (${bovinedir}/%-by.el, ${bovinedir}/scm-by.el) (${cedetdir}/semantic/%-wy.el, ${wisentdir}/%-wy.el) (${wisentdir}/javat-wy.el, ${cedetdir}/srecode/srt-wy.el): Depend on the source file for the generating function. * lisp/cedet/semantic/bovine/grammar.el (bovine--make-parser-1): * lisp/cedet/semantic/wisent/grammar.el (wisent--make-parser-1): Force generation of the output file. The previous "is the output newer than the input" failed to account for changes in the generation code itself. Force so we can let make figure it out. --- diff --git a/admin/grammars/Makefile.in b/admin/grammars/Makefile.in index 1573eb3bde9..35ce55461f3 100644 --- a/admin/grammars/Makefile.in +++ b/admin/grammars/Makefile.in @@ -34,7 +34,7 @@ top_builddir = @top_builddir@ unexport EMACSDATA EMACSDOC EMACSPATH EMACS = ${top_builddir}/src/emacs -emacs = EMACSLOADPATH= "${EMACS}" -batch --no-site-file --no-site-lisp +emacs = EMACSLOADPATH= "${EMACS}" -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' make_bovine = ${emacs} -l semantic/bovine/grammar -f bovine-batch-make-parser make_wisent = ${emacs} -l semantic/wisent/grammar -f wisent-batch-make-parser @@ -43,6 +43,9 @@ cedetdir = ${top_srcdir}/lisp/cedet bovinedir = ${cedetdir}/semantic/bovine wisentdir = ${cedetdir}/semantic/wisent +grammar_bovine = ${bovinedir}/grammar.el +grammar_wisent = ${wisentdir}/grammar.el + BOVINE = \ ${bovinedir}/c-by.el \ ${bovinedir}/make-by.el \ @@ -68,36 +71,33 @@ bovine: ${BOVINE} wisent: ${WISENT} -## TODO add dependencies on semantic/{bovine,wisent}/grammar.el - ## c-by.el, make-by.el. -${bovinedir}/%-by.el: ${srcdir}/%.by +${bovinedir}/%-by.el: ${srcdir}/%.by ${grammar_bovine} $(AM_V_GEN)[ ! -f "$@" ] || chmod +w "$@" $(AM_V_at)${make_bovine} -o "$@" $< -${bovinedir}/scm-by.el: ${srcdir}/scheme.by +${bovinedir}/scm-by.el: ${srcdir}/scheme.by ${grammar_bovine} $(AM_V_GEN)[ ! -f "$@" ] || chmod +w "$@" $(AM_V_at)${make_bovine} -o "$@" $< ## grammar-wy.el -${cedetdir}/semantic/%-wy.el: ${srcdir}/%.wy +${cedetdir}/semantic/%-wy.el: ${srcdir}/%.wy ${grammar_wisent} $(AM_V_GEN)[ ! -f "$@" ] || chmod +w "$@" $(AM_V_at)${make_wisent} -o "$@" $< ## js-wy.el, python-wy.el -${wisentdir}/%-wy.el: ${srcdir}/%.wy +${wisentdir}/%-wy.el: ${srcdir}/%.wy ${grammar_wisent} $(AM_V_GEN)[ ! -f "$@" ] || chmod +w "$@" $(AM_V_at)${make_wisent} -o "$@" $< -${wisentdir}/javat-wy.el: ${srcdir}/java-tags.wy +${wisentdir}/javat-wy.el: ${srcdir}/java-tags.wy ${grammar_wisent} $(AM_V_GEN)[ ! -f "$@" ] || chmod +w "$@" $(AM_V_at)${make_wisent} -o "$@" $< -${cedetdir}/srecode/srt-wy.el: ${srcdir}/srecode-template.wy +${cedetdir}/srecode/srt-wy.el: ${srcdir}/srecode-template.wy ${grammar_wisent} $(AM_V_GEN)[ ! -f "$@" ] || chmod +w "$@" $(AM_V_at)${make_wisent} -o "$@" $< - .PHONY: distclean bootstrap-clean maintainer-clean extraclean gen-clean distclean: diff --git a/lisp/cedet/semantic/bovine/grammar.el b/lisp/cedet/semantic/bovine/grammar.el index a5b9873445e..a2717d711fe 100644 --- a/lisp/cedet/semantic/bovine/grammar.el +++ b/lisp/cedet/semantic/bovine/grammar.el @@ -475,7 +475,7 @@ Menu items are appended to the common grammar menu.") (with-current-buffer (find-file-noselect infile) (setq infile buffer-file-name) (if outdir (setq default-directory outdir)) - (semantic-grammar-create-package nil t)) + (semantic-grammar-create-package t t)) (error (message "%s" (error-message-string err)) nil))) lang filename copyright-end) (when (and packagename diff --git a/lisp/cedet/semantic/wisent/grammar.el b/lisp/cedet/semantic/wisent/grammar.el index 465d4720031..c5e4554082e 100644 --- a/lisp/cedet/semantic/wisent/grammar.el +++ b/lisp/cedet/semantic/wisent/grammar.el @@ -477,7 +477,7 @@ Menu items are appended to the common grammar menu.") (condition-case err (with-current-buffer (find-file-noselect infile) (if outdir (setq default-directory outdir)) - (semantic-grammar-create-package nil t)) + (semantic-grammar-create-package t t)) (error (message "%s" (error-message-string err)) nil))) output-data) (when (setq output-data (assoc packagename wisent-make-parsers--parser-file-name))