-
Notifications
You must be signed in to change notification settings - Fork 92
/
Copy pathMakefile
61 lines (46 loc) · 1.3 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
## -*- mode: makefile-gmake -*-
EMACS = emacs
EMACS_BATCH = $(EMACS) -batch
TARGET = $(patsubst %.el,%.elc,init.el)
DIRS = lisp
SUBDIRS = $(shell find $(DIRS) -maxdepth 2 \
! -name .git \
! -name doc \
! -name test \
! -name tests \
! -name obsolete \
-type d -print)
MY_LOADPATH = -L . $(patsubst %,-L %, $(SUBDIRS))
BATCH_LOAD = $(EMACS_BATCH) $(MY_LOADPATH)
.PHONY: test build clean
# Main rule
all: init.el
init.org: ~/org/init.org
@if test ~/org/init.org -nt $@; then \
rm -f $@; \
cp -p ~/org/init.org $@; \
chmod 444 $@; \
fi
# Generate lisp and compile it
init.el: init.org
@rm -f $@
@$(BATCH_LOAD) \
--eval "(require 'org)" \
--eval "(org-babel-load-file \"init.org\")"
@chmod 444 $@
%.elc: %.el
@echo Compiling file $<
@$(BATCH_LOAD) -f batch-byte-compile $<
speed: init.elc
time $(BATCH_LOAD) -Q -L . -l init \
--eval "(message \"Hello, world\!\")"
slow: init.el
time $(BATCH_LOAD) -Q -L . -l init --debug-init \
--eval "(message \"Hello, world\!\")"
open: init.el
@open $$(dirname $$(which emacs))/../Applications/*.app
open-quick: init.el
@open $$(dirname $$(which emacs))/../Applications/*.app
clean:
rm -f init.el *.elc *~ settings.el
### Makefile ends here