emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/bnf-mode 7535299 13/22: Add initial ability to generate


From: Stefan Monnier
Subject: [elpa] externals/bnf-mode 7535299 13/22: Add initial ability to generate info page
Date: Tue, 3 Mar 2020 10:56:54 -0500 (EST)

branch: externals/bnf-mode
commit 7535299ff0ff2334b863b00d76fd197bc355dcab
Author: Serghei Iakovlev <address@hidden>
Commit: Serghei Iakovlev <address@hidden>

    Add initial ability to generate info page
---
 Makefile                    | 53 +++++++++++++++++++++++++++------------------
 default.mk                  |  9 ++++++--
 default.mk => docs/Makefile | 44 ++++++++++++++-----------------------
 docs/bnf-mode.texi          |  0
 4 files changed, 55 insertions(+), 51 deletions(-)

diff --git a/Makefile b/Makefile
index 5c248fb..7dc4b03 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 2019-2020 Serghei Iakovlev
+# Copyright (C) 2019, 2020 Free Software Foundation, Inc.
 #
 # License
 #
@@ -28,8 +28,9 @@ define org-clean
        @cat $^ | sed -e "s/\[\[.*\.svg\]\]//g"
 endef
 
-$(ARCHIVE_NAME).info: README.org
-       $(call org-clean,$^) | $(PANDOC) $(PANDOCLAGS) -t texinfo | makeinfo -o 
$@
+# TODO: Move to docs
+$(PACKAGE).info: README.org
+       $(call org-clean,$^) | $(PANDOC) $(PANDOCLAGS) -t texinfo | $(MAKEINFO) 
-o $@
 
 README: README.org
        $(call org-clean,$^) | $(PANDOC) $(PANDOCLAGS) -t plain | sed -e 
"s/\[\]//g" > $@
@@ -37,11 +38,11 @@ README: README.org
 ChangeLog: NEWS
        @cp $^ $@
 
-$(ARCHIVE_NAME)-pkg.el: $(ARCHIVE_NAME).el
+$(PACKAGE)-pkg.el: $(PACKAGE).el
        @$(CASK) pkg-file
 
-$(PACKAGE_NAME).tar: README ChangeLog LICENSE $(ARCHIVE_NAME).el 
$(ARCHIVE_NAME)-pkg.el $(ARCHIVE_NAME).info dir
-       @$(TAR) -c -v -f $(PACKAGE_NAME).tar --transform 
"s@^@$(PACKAGE_NAME)/@" $^
+$(ARCHIVE_NAME).tar: README ChangeLog LICENSE $(PACKAGE).el $(PACKAGE)-pkg.el 
$(PACKAGE).info dir
+       @$(TAR) -c -v -f $(ARCHIVE_NAME).tar --transform 
"s@^@$(ARCHIVE_NAME)/@" $^
 
 ## Public targets
 
@@ -65,35 +66,45 @@ test:
        @$(CASK) exec ert-runner $(TESTFLAGS)
 
 .PHONY: clean
-clean:
+clean: clean-docs
        $(info Remove all byte compiled Elisp files...)
        @$(CASK) clean-elc
        $(info Remove build artefacts...)
-       @$(RM) -f README ChangeLog $(ARCHIVE_NAME).info coverage-final.json
-       @$(RM) -f $(ARCHIVE_NAME)-pkg.el $(ARCHIVE_NAME)-*.tar
+       @$(RM) README ChangeLog $(PACKAGE).info coverage-final.json
+       @$(RM) $(PACKAGE)-pkg.el $(PACKAGE)-*.tar
+
+.PHONY:
+clean-docs:
+       @$(MAKE) -C docs clean
 
 .PHONY: package
-package: $(PACKAGE_NAME).tar
+package: $(ARCHIVE_NAME).tar
 
 .PHONY: install
-install: $(PACKAGE_NAME).tar
+install: $(ARCHIVE_NAME).tar
        @$(EMACS) --batch -l package -f package-initialize --eval \
-               "(let ((debug-on-error t))(package-install-file 
\"$(PWD)/$(PACKAGE_NAME).tar\"))"
+               "(let ((debug-on-error t))(package-install-file 
\"$(PWD)/$(ARCHIVE_NAME).tar\"))"
+
+.PHONY: info
+info:
+       @$(MAKE) -C docs info
 
 .PHONY: help
 help: .title
        @echo 'Run "make init" first to install and update all local 
dependencies.'
        @echo ''
        @echo 'Available targets:'
-       @echo '  help:     Show this help and exit'
-       @echo '  init:     Initialize the project (has to be launched first)'
-       @echo '  checkdoc: Checks BNF Mode code for errors in the documentation'
-       @echo '  build:    Byte compile BNF Mode package'
-       @echo '  test:     Run the non-interactive unit test suite'
-       @echo '  clean:    Remove all byte compiled Elisp files as well as 
build'
-       @echo '            artefacts'
-       @echo '  package:  Build package'
-       @echo '  install:  Install BNF Mode'
+       @echo '  help:       Show this help and exit'
+       @echo '  init:       Initialize the project (has to be launched first)'
+       @echo '  checkdoc:   Checks BNF Mode code for errors in the 
documentation'
+       @echo '  build:      Byte compile BNF Mode package'
+       @echo '  test:       Run the non-interactive unit test suite'
+       @echo '  clean:      Remove all byte compiled Elisp files, 
documentation,'
+       @echo '              build artefacts and tarball'
+       @echo '  clean-docs: Remove all ganerated documentation'
+       @echo '  package:    Build package'
+       @echo '  install:    Install BNF Mode'
+       @echo '  info:       Generate info manual'
        @echo ''
        @echo 'Available programs:'
        @echo '  $(CASK): $(if $(HAVE_CASK),yes,no)'
diff --git a/default.mk b/default.mk
index 3a36193..e48a3ba 100644
--- a/default.mk
+++ b/default.mk
@@ -22,6 +22,9 @@ CASK   ?= cask
 PANDOC ?= pandoc
 TAR    ?= tar
 
+INSTALL_INFO ?= $(shell command -v ginstall-info || printf install-info)
+MAKEINFO     ?= makeinfo
+
 EMACSBATCH = $(EMACS) -Q --batch -L . $(EMACSFLAGS)
 RUNEMACS   =
 
@@ -40,10 +43,12 @@ PANDOCLAGS ?= --fail-if-warnings \
        --atx-headers \
        -f org+empty_paragraphs
 
-ARCHIVE_NAME = bnf-mode
-PACKAGE_NAME = $(ARCHIVE_NAME)-$(VERSION)
+PACKAGE = bnf-mode
+ARCHIVE_NAME = $(PACKAGE)-$(VERSION)
 
 VERSION = 0.4.4
 
 SRCS = bnf-mode.el
 OBJS = $(SRCS:.el=.elc)
+
+INFOPAGES = $(addsuffix .info,$(PACKAGE))
diff --git a/default.mk b/docs/Makefile
similarity index 51%
copy from default.mk
copy to docs/Makefile
index 3a36193..8f6630b 100644
--- a/default.mk
+++ b/docs/Makefile
@@ -11,39 +11,27 @@
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-
+#
 # You should have received a copy of the GNU General Public License
 # along with this file.  If not, see <https://www.gnu.org/licenses/>.
 
-TOP := $(dir $(lastword $(MAKEFILE_LIST)))
-
-EMACS  ?= emacs
-CASK   ?= cask
-PANDOC ?= pandoc
-TAR    ?= tar
-
-EMACSBATCH = $(EMACS) -Q --batch -L . $(EMACSFLAGS)
-RUNEMACS   =
+include ../default.mk
 
-HAVE_CASK := $(shell sh -c "command -v $(CASK)")
-ifndef HAVE_CASK
-$(warning "$(CASK) is not available.  Please run make help")
-RUNEMACS = $(EMACSBATCH)
-else
-RUNEMACS = $(CASK) exec $(EMACSBATCH)
-endif
+.PHONY: all
+all: info
 
-EMACSFLAGS ?=
-TESTFLAGS  ?= --reporter ert+duration
-PANDOCLAGS ?= --fail-if-warnings \
-       --reference-links \
-       --atx-headers \
-       -f org+empty_paragraphs
+.PHONY: info
+info: $(INFOPAGES) dir
 
-ARCHIVE_NAME = bnf-mode
-PACKAGE_NAME = $(ARCHIVE_NAME)-$(VERSION)
+%.info: %.texi
+       $(info Generating $@)
+       @$(MAKEINFO) --no-split $< -o $@
 
-VERSION = 0.4.4
+dir: $(INFOPAGES)
+       $(info Generating dir)
+       @echo $^ | xargs -n 1 $(INSTALL_INFO) --dir=$@
 
-SRCS = bnf-mode.el
-OBJS = $(SRCS:.el=.elc)
+.PHONY:
+clean:
+       $(info Cleaning documentation...)
+       @$(RM) dir $(INFOPAGES)
diff --git a/docs/bnf-mode.texi b/docs/bnf-mode.texi
new file mode 100644
index 0000000..e69de29



reply via email to

[Prev in Thread] Current Thread [Next in Thread]