]> git.eshelyaron.com Git - emacs.git/commitdiff
Regenerate semantic grammars if the generating code changes
authorGlenn Morris <rgm@gnu.org>
Sun, 4 Apr 2021 23:57:55 +0000 (16:57 -0700)
committerGlenn Morris <rgm@gnu.org>
Sun, 4 Apr 2021 23:57:55 +0000 (16:57 -0700)
* 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.

admin/grammars/Makefile.in
lisp/cedet/semantic/bovine/grammar.el
lisp/cedet/semantic/wisent/grammar.el

index 1573eb3bde968b0266b898c9123f2f718a3b891a..35ce55461f33cfb570d1d9290bfde28adea45279 100644 (file)
@@ -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:
index a5b9873445e761b844939a52387936e03ce2ea11..a2717d711fe06b2c9e15d9709930ae5d0116df45 100644 (file)
@@ -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
index 465d472003122b5bb33907fcc49ed65a78ed597f..c5e4554082e675915561e61a268749994c6f50d5 100644 (file)
@@ -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))