Add a makefile
authorDaniel Semyonov <daniel@dsemy.com>
Tue, 29 Jun 2021 00:40:11 +0000 (03:40 +0300)
committerAlex Schroeder <alex@gnu.org>
Tue, 29 Jun 2021 06:36:56 +0000 (08:36 +0200)
Contains three targets - info, package and clean:
- info creates the info manual for the package.
- package creates an installable (via 'M-x package-install-file')
  package archive.
- clean cleans any "build artefacts".
The default (all) target is equivalent to the clean target followed by
the package target.
Add 'config.mk' for build configuration.
Add 'elpher-pkg.el' (could possibly be generated in the future),
required to install as a package.

config.mk [new file with mode: 0644]
elpher-pkg.el [new file with mode: 0644]
makefile [new file with mode: 0644]

diff --git a/config.mk b/config.mk
new file mode 100644 (file)
index 0000000..443dca8
--- /dev/null
+++ b/config.mk
@@ -0,0 +1,6 @@
+PKG     = elpher
+VERSION = 2.11.0
+
+INSTALLINFO = install-info
+MAKEINFO    = makeinfo
+TAR         = tar
diff --git a/elpher-pkg.el b/elpher-pkg.el
new file mode 100644 (file)
index 0000000..13255f3
--- /dev/null
@@ -0,0 +1,9 @@
+(define-package "elpher" "2.11.0" "A friendly gopher and gemini client"
+  '((emacs "26.2"))
+  :keywords ("convenience")
+  :authors (("Tim Vaughan" . "plugd@thelambdalab.xyz"))
+  :maintainer ("Alex Schroeder" . "alex@alexschroeder.ch")
+  :url "https://alexschroeder.ch/cgit/elpher")
+;; Local Variables:
+;; no-byte-compile: t
+;; end:
diff --git a/makefile b/makefile
new file mode 100644 (file)
index 0000000..ac9c1c5
--- /dev/null
+++ b/makefile
@@ -0,0 +1,32 @@
+include config.mk
+
+.PHONY: all help info package clean
+
+.SUFFIXES: .texi .info
+
+all: clean package
+
+help:
+       $(info make info     - generate the info manual)
+       $(info make package  - generate a tar file containing the package)
+       $(info make clean    - remove generated files)
+       @exit
+
+.texi.info:
+       $(MAKEINFO) --no-split $< -o $@
+
+dir: $(PKG).info
+       $(INSTALLINFO) $? $@
+
+info: $(PKG).info dir
+
+$(PKG)-$(VERSION).tar: $(PKG).info dir *.el COPYING
+       mkdir $(PKG)-$(VERSION)
+       cp -a $? $(PKG)-$(VERSION)/
+       $(TAR) -cf $@ $(PKG)-$(VERSION)
+       rm -rf $(PKG)-$(VERSION)
+
+package: $(PKG)-$(VERSION).tar
+
+clean:
+       rm -f $(PKG).info dir $(PKG)-$(VERSION).tar