File: Makefile

package info (click to toggle)
fountain-mode 3.7.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,968 kB
  • sloc: lisp: 3,345; makefile: 60
file content (63 lines) | stat: -rw-r--r-- 2,122 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# n.b. This Makefile is for development convenience only. It is not
# required to build or install Fountain Mode.

.POSIX:
PROG		= fountain-mode
LISP_FILE	= ${PROG}.el
DEPS		= seq package-lint
NEWS_FILE	= NEWS.md
DOCS_DIR	= doc
TEXI_FILE	= ${DOCS_DIR}/${PROG}.texi
INFO_FILE	= ${DOCS_DIR}/${PROG}.info
CSS_FILE	= ${DOCS_DIR}/style.css
HTML_DIR	= ${DOCS_DIR}/html
GENERATED_DOCS = ${INFO_FILE}
GENERATED_DOCS += ${DOCS_DIR}/dir
GENERATED_DOCS += ${DOCS_DIR}/*.epub ${DOCS_DIR}/*.pdf ${HTML_DIR}/*.html
GENERATED_DOCS += ${DOCS_DIR}/*.aux ${DOCS_DIR}/*.fn ${DOCS_DIR}/*.log
GENERATED_DOCS += ${DOCS_DIR}/*.toc ${DOCS_DIR}/*.vr
VERS		= ${shell grep -oE -m1 'Version:[ 0-9.]+' ${LISP_FILE} | tr -d :}
TAG		= ${shell echo ${VERS} | sed -E 's/Version:? ([0-9.]+)/v\1/'}
INIT		= \
(progn (require (quote package)) \
       (push (cons "melpa" "https://melpa.org/packages/") package-archives) \
       (package-initialize) \
       (dolist (pkg (quote (${DEPS}))) \
               (unless (package-installed-p pkg) \
                       (unless (assoc pkg package-archive-contents) \
                               (package-refresh-contents)) \
                        (package-install pkg))))

all: clean check compile manuals

check:
	@emacs -Q --eval '${INIT}' --batch -f package-lint-batch-and-exit ${LISP_FILE}

compile:
	@emacs -Q --eval '${INIT}' -L . --batch -f batch-byte-compile ${LISP_FILE}

manuals: info-manual html-manual epub-manual pdf-manual

info-manual:
	makeinfo --output ${INFO_FILE} ${TEXI_FILE}
	install-info ${INFO_FILE} ${DOCS_DIR}/dir

html-manual:
	texi2any --html --css-include=${CSS_FILE} --output ${HTML_DIR} ${TEXI_FILE}

epub-manual:
	texi2any --epub3 --output ${DOCS_DIR}/${PROG}.epub ${TEXI_FILE}

pdf-manual:
	texi2pdf --clean --output ${DOCS_DIR}/${PROG}.pdf ${TEXI_FILE}

tag-release: check compile
	printf '%s\n' '/^## master/ s/master/${VERS}/' . w | ed -s ${NEWS_FILE}
	git commit -m 'Add ${VERS} to ${NEWS_FILE}' ${NEWS_FILE}
	awk '/^## Version/ { v ++1 } v == 1' ${NEWS_FILE} \
	| sed 's/^## //' | tr -d \` \
	| git tag -F - ${TAG}

clean:
	rm -f ${PROG}.elc
	rm -rf ${GENERATED_DOCS}