let elpher handle gemini, gopher links in eww buffer
[elpher.git] / Makefile
1 include config.mk
2
3 .PHONY: all autoloads clean compile help info package
4
5 .SUFFIXES: .texi .info
6
7 all: clean package
8
9 autoloads: $(PKG)-loaddefs.el
10
11 compile: clean $(PKG).elc
12
13 help:
14         $(info make help      - show brief help)
15         $(info make           - generate a tar file containing the package)
16         $(info make all       - ditto)
17         $(info make package   - ditto)
18         $(info make info      - generate the info manual)
19         $(info make compile   - byte-compile the package lisp files)
20         $(info make autoloads - create $(PKG)-loaddefs.el to load Elpher in-place)
21         $(info make clean     - remove generated files)
22         @exit
23
24 %.info: %.texi
25         $(MAKEINFO) --no-split $< -o $@
26
27 %.html: %.texi
28         $(MAKEINFO) --no-split --html $< -o $@
29
30 %.pdf: %.texi
31         $(MAKEINFO) --no-split --pdf $< -o $@
32
33 dir: $(PKG).info
34         $(INSTALLINFO) $? $@
35
36 info: $(PKG).info dir
37
38 $(PKG)-$(VERSION).tar: $(PKG).info dir *.el COPYING
39         mkdir $(PKG)-$(VERSION)
40         cp -a $? $(PKG)-$(VERSION)/
41         $(TAR) -cf $@ $(PKG)-$(VERSION)
42         rm -rf $(PKG)-$(VERSION)
43
44 package: $(PKG)-$(VERSION).tar
45
46 clean:
47         rm -f $(PKG).elc $(PKG)-loaddefs.el
48         rm -f $(PKG).info dir $(PKG)-$(VERSION).tar
49         rm -f $(PKG).html $(PKG).pdf $(PKG).aux $(PKG).fn $(PKG).fns $(PKG).log $(PKG).toc
50
51 define LOADDEFS_TPL
52 (add-to-list 'load-path (directory-file-name\n\
53 ........................(or (file-name-directory #$$) (car load-path))))
54 endef
55 #' (ends emacs font-face garbage due to previous single quote)
56
57 $(PKG)-loaddefs.el:
58         $(EMACS) -L $(PWD) \
59                 --eval "(setq-default backup-inhibited t)" \
60                 --eval "(setq generated-autoload-file \"$(PWD)/$@\")" \
61                 --eval "(update-directory-autoloads \"$(PWD)\")"
62         sed -i "s/^;;; Code:$$/;;; Code:\n\n$(subst ., ,$(LOADDEFS_TPL))/" $@
63
64 $(PKG).elc:
65         $(EMACS) -f batch-byte-compile $(@:.elc=.el)