-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·48 lines (35 loc) · 1.26 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
# Name of your emacs binary
EMACS=emacs
BATCH=$(EMACS) --batch -Q --eval '(require (quote org))' --eval '(setq starter-kit-dir default-directory)'
FILES = starter-kit.org \
starter-kit-bindings.org \
starter-kit-defuns.org \
starter-kit-misc.org \
starter-kit-registers.org
FILESO = $(FILES:.org=.el)
all: el
$(BATCH) --eval '(mapc (lambda (x) (byte-compile-file (symbol-name x))) (quote ($(FILESO))))'
el: $(FILES)
$(BATCH) --eval '(mapc (lambda (x) (org-babel-load-file (symbol-name x))) (quote ($(FILES))))'
%.el: %.org
$(BATCH) --eval '(org-babel-load-file "$<")'
doc: doc/index.html
doc/index.html:
mkdir -p doc
$(EMACS) --batch -Q --eval '(org-babel-load-file "starter-kit-publish.org")'
rm starter-kit-publish.el
cp doc/starter-kit.html doc/index.html
echo "Documentation published to doc/"
# Packaging
NAME=literate-starter-kit
PACKAGE=$(NAME)
$(PACKAGE): $(wildcard *.org) init.el Makefile literate-starter-kit-pkg.el
mkdir -p $(PACKAGE)
cp $^ $(PACKAGE)
$(BATCH) starter-kit.org --eval "(org-export-to-file 'ascii \"$(PACKAGE)/README\")"
$(PACKAGE).tar: $(PACKAGE)
tar cf $@ $<
package: $(PACKAGE).tar
clean:
rm -f *.elc *.aux *.tex *.pdf starter-kit*.el starter-kit*.html doc/*html *~ .starter-kit*.part.org
rm -rf $(PACKAGE).tar $(PACKAGE)