forked from jwiegley/dot-emacs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (40 loc) · 1.32 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
## -*- mode: makefile-gmake -*-
DIRS = override lib lisp site-lisp
SUBDIRS = $(shell find $(DIRS) -maxdepth 2 ! -name .git ! -name style -type d -print)
LIB_SOURCE = $(wildcard override/*.el) $(wildcard lib/*.el) \
$(wildcard lisp/*.el) $(wildcard site-lisp/*.el)
TARGET = $(patsubst %.el,%.elc, $(LIB_SOURCE)) \
$(patsubst %.el,%.elc, dot-gnus.el dot-org.el init.el)
EMACS = emacs
EMACS_BATCH = $(EMACS) -Q -batch
MY_LOADPATH = -L . $(patsubst %,-L %, $(SUBDIRS))
BATCH_LOAD = $(EMACS_BATCH) $(MY_LOADPATH)
all: $(TARGET)
compile:
for i in $(DIRS); do \
$(BATCH_LOAD) --eval '(batch-byte-recompile-directory 0)' $$i; \
done
init.elc: init.el dot-org.elc dot-gnus.elc
@rm -f $@
@echo Compiling file init.el
@$(BATCH_LOAD) -f batch-byte-compile init.el
dot-org.elc: dot-org.el
@rm -f $@
@echo Compiling file dot-org.el
@$(BATCH_LOAD) -f batch-byte-compile dot-org.el
dot-gnus.elc: dot-gnus.el
@rm -f $@
@echo Compiling file dot-gnus.el
@$(BATCH_LOAD) -f batch-byte-compile dot-gnus.el
%.elc: %.el
@echo Compiling file $<
@$(BATCH_LOAD) -f batch-byte-compile $<
clean:
rm -f *.elc
find . -name '*.elc' | while read file ; do \
if ! test -f $$(echo $$file | sed 's/\.elc$$/.el/'); then \
echo Removing old file: $$file ; \
rm $$file ; \
fi ; \
done
### Makefile ends here