-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
65 lines (48 loc) · 1.7 KB
/
Makefile
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
64
65
include config.mk
.PHONY: all autoloads clean compile help info package
.SUFFIXES: .texi .info
all: clean package
autoloads: $(PKG)-loaddefs.el
compile: clean $(PKG).elc
help:
$(info make help - show brief help)
$(info make - generate a tar file containing the package)
$(info make all - ditto)
$(info make package - ditto)
$(info make info - generate the info manual)
$(info make compile - byte-compile the package lisp files)
$(info make autoloads - create $(PKG)-loaddefs.el to load Elpher in-place)
$(info make clean - remove generated files)
@exit
%.info: %.texi
$(MAKEINFO) --no-split $< -o $@
%.html: %.texi
$(MAKEINFO) --no-split --html $< -o $@
%.pdf: %.texi
$(MAKEINFO) --no-split --pdf $< -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).elc $(PKG)-loaddefs.el
rm -f $(PKG).info dir $(PKG)-$(VERSION).tar
rm -f $(PKG).html $(PKG).pdf $(PKG).aux $(PKG).fn $(PKG).fns $(PKG).log $(PKG).toc
define LOADDEFS_TPL
(add-to-list 'load-path (directory-file-name\n\
........................(or (file-name-directory #$$) (car load-path))))
endef
#' (ends emacs font-face garbage due to previous single quote)
$(PKG)-loaddefs.el:
$(EMACS) -L $(PWD) \
--eval "(setq-default backup-inhibited t)" \
--eval "(setq generated-autoload-file \"$(PWD)/$@\")" \
--eval "(update-directory-autoloads \"$(PWD)\")"
sed -i "s/^;;; Code:$$/;;; Code:\n\n$(subst ., ,$(LOADDEFS_TPL))/" $@
$(PKG).elc:
$(EMACS) -f batch-byte-compile $(@:.elc=.el)