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

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

[elpa] externals/bnf-mode 026dfcd 09/22: Mode variables definition from


From: Stefan Monnier
Subject: [elpa] externals/bnf-mode 026dfcd 09/22: Mode variables definition from Makefile to the common place
Date: Tue, 3 Mar 2020 10:56:53 -0500 (EST)

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

    Mode variables definition from Makefile to the common place
---
 .elpaignore |   1 +
 Makefile    | 119 ++++++++++++++++++------------------------------------------
 default.mk  |  51 ++++++++++++++++++++++++++
 3 files changed, 88 insertions(+), 83 deletions(-)

diff --git a/.elpaignore b/.elpaignore
index 570e5e3..ca37d8b 100644
--- a/.elpaignore
+++ b/.elpaignore
@@ -2,4 +2,5 @@
 .ert-runner
 .gitignore
 Makefile
+default.mk
 test
diff --git a/Makefile b/Makefile
index a55c782..5f11037 100644
--- a/Makefile
+++ b/Makefile
@@ -13,81 +13,34 @@
 # 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, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this file.  If not, see <https://www.gnu.org/licenses/>.
 
-## Sane defaults
-SHELL ?= $(shell which sh)
-ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
-
-EMACS ?= emacs
-CASK ?= cask
-PANDOC ?= pandoc
-TAR ?= tar
-
-EMACSFLAGS ?=
-TESTFLAGS ?= --reporter ert+duration
-PANDOCLAGS ?= --fail-if-warnings \
-       --reference-links \
-       --atx-headers \
-       -f org+empty_paragraphs
-
-PKGDIR = $(ROOT_DIR)
-
-ARCHIVE_NAME = bnf-mode
-VERSION = $(shell sh -c "grep -oh -E 'Version:.*' bnf-mode.el | cut -d' ' -f2")
-PACKAGE_NAME = $(ARCHIVE_NAME)-$(VERSION)
+include default.mk
 
 .DEFAULT_GOAL = build
 
-.SILENT: ;               # no need for @
-.ONESHELL: ;             # recipes execute in same shell
-.NOTPARALLEL: ;          # wait for this target to finish
-.EXPORT_ALL_VARIABLES: ; # send all vars to shell
-Makefile: ;              # skip prerequisite discovery
-
-## File lists
-
-SRCS = bnf-mode.el
-OBJS = $(SRCS:.el=.elc)
-
-## Internal variables
-
-EMACSBATCH = $(EMACS) -Q --batch -L . $(EMACSFLAGS)
-RUNEMACS =
-
-## Programs availability
-
-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: pkg-dir
 pkg-dir:
-ifeq ($(PKGDIR),$(ROOT_DIR))
+ifeq ($(PKGDIR),$(TOP))
 ifndef HAVE_CASK
        $(error "$(CASK) is not available.  Please run make help")
 else
-       PKGDIR=$(shell EMACS=$(EMACS) $(CASK) package-directory)
+       @PKGDIR=$(shell EMACS=$(EMACS) $(CASK) package-directory)
 endif
 endif
 
 %.elc: %.el $(PKGDIR)
-       $(RUNEMACS) --eval '(setq byte-compile-error-on-warn t)' -f 
batch-byte-compile $<
+       @printf "Compiling $<\n"
+       @$(RUNEMACS) --eval '(setq byte-compile-error-on-warn t)' -f 
batch-byte-compile $<
 
 $(PKGDIR): pkg-dir Cask
-       $(CASK) install
-       touch $(PKGDIR)
+       @$(CASK) install
+       @touch $(PKGDIR)
 
 ## Remove badges
 
 define org-clean
-       cat $^ | sed -e "s/\[\[.*\.svg\]\]//g"
+       @cat $^ | sed -e "s/\[\[.*\.svg\]\]//g"
 endef
 
 $(ARCHIVE_NAME).info: README.org
@@ -97,13 +50,13 @@ README: README.org
        $(call org-clean,$^) | $(PANDOC) $(PANDOCLAGS) -t plain | sed -e 
"s/\[\]//g" > $@
 
 ChangeLog: NEWS
-       cp $^ $@
+       @cp $^ $@
 
 $(ARCHIVE_NAME)-pkg.el: $(ARCHIVE_NAME).el
-       $(CASK) pkg-file
+       @$(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)/@" 
$^
+       @$(TAR) -c -v -f $(PACKAGE_NAME).tar --transform 
"s@^@$(PACKAGE_NAME)/@" $^
 
 ## Public targets
 
@@ -123,40 +76,40 @@ build: $(OBJS)
 
 .PHONY: test
 test:
-       $(CASK) exec ert-runner $(TESTFLAGS)
+       @$(CASK) exec ert-runner $(TESTFLAGS)
 
 .PHONY: clean
 clean:
-       $(CASK) clean-elc
-       $(RM) -f README ChangeLog $(ARCHIVE_NAME).info coverage-final.json
-       $(RM) -f $(ARCHIVE_NAME)-pkg.el $(ARCHIVE_NAME)-*.tar
+       @$(CASK) clean-elc
+       @$(RM) -f README ChangeLog $(ARCHIVE_NAME).info coverage-final.json
+       @$(RM) -f $(ARCHIVE_NAME)-pkg.el $(ARCHIVE_NAME)-*.tar
 
 .PHONY: package
 package: $(PACKAGE_NAME).tar
 
 .PHONY: install
 install: $(PACKAGE_NAME).tar
-       $(EMACS) --batch -l package -f package-initialize --eval \
+       @$(EMACS) --batch -l package -f package-initialize --eval \
                "(let ((debug-on-error t))(package-install-file 
\"$(PWD)/$(PACKAGE_NAME).tar\"))"
 
 .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 '            artifacts'
-       echo '  package:  Build package'
-       echo '  install:  Install BNF Mode'
-       echo ''
-       echo 'Available programs:'
-       echo '  $(CASK): $(if $(HAVE_CASK),yes,no)'
-       echo ''
-       echo 'You need $(CASK) to develop BNF Mode.'
-       echo 'See http://cask.readthedocs.io/ for more.'
-       echo ''
+       @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 '            artifacts'
+       @echo '  package:  Build package'
+       @echo '  install:  Install BNF Mode'
+       @echo ''
+       @echo 'Available programs:'
+       @echo '  $(CASK): $(if $(HAVE_CASK),yes,no)'
+       @echo ''
+       @echo 'You need $(CASK) to develop BNF Mode.'
+       @echo 'See http://cask.readthedocs.io/ for more.'
+       @echo ''
diff --git a/default.mk b/default.mk
new file mode 100644
index 0000000..67e653d
--- /dev/null
+++ b/default.mk
@@ -0,0 +1,51 @@
+# Copyright (C) 2019-2020 Serghei Iakovlev
+#
+# License
+#
+# This file is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 3
+# of the License, or (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# 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)))
+
+PKGDIR = $(TOP)
+
+EMACS  ?= emacs
+CASK   ?= cask
+PANDOC ?= pandoc
+TAR    ?= tar
+
+EMACSBATCH = $(EMACS) -Q --batch -L . $(EMACSFLAGS)
+RUNEMACS   =
+
+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
+
+EMACSFLAGS ?=
+TESTFLAGS  ?= --reporter ert+duration
+PANDOCLAGS ?= --fail-if-warnings \
+       --reference-links \
+       --atx-headers \
+       -f org+empty_paragraphs
+
+ARCHIVE_NAME = bnf-mode
+PACKAGE_NAME = $(ARCHIVE_NAME)-$(VERSION)
+
+VERSION = 0.4.4
+
+SRCS = bnf-mode.el
+OBJS = $(SRCS:.el=.elc)



reply via email to

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