Add Makefiles to .emacs.d

This commit is contained in:
Tom Willemsen 2012-12-04 22:05:24 +01:00
parent 2622f3e7d9
commit 9b3cc1d28d
7 changed files with 81 additions and 0 deletions

5
.emacs.d/Makefile Normal file
View file

@ -0,0 +1,5 @@
DESTDIR=$(HOME)/.emacs.d
objects=init.elc init.el gnus.elc gnus.el
modules=eshell site-lisp snippets
include emacs.mk

52
.emacs.d/emacs.mk Normal file
View file

@ -0,0 +1,52 @@
LOAD_PATH=. /usr/share/emacs/site-lisp $(HOME)/.emacs.d/site-lisp
EMACS=emacs $(addprefix -L ,$(LOAD_PATH))
FG_YEL=\033[0;33m
FG_GRE=\033[0;32m
FG_RED=\033[0;31m
CLR_RE=\033[0;00m
compile = $(EMACS) -Q -batch -eval "(byte-compile-file \"$(1)\")"
define newer =
$(shell if [ "$(1)" -nt "$(DESTDIR)/$(1)" ]; then echo "newer"; fi)
endef
install-objects=$(addprefix install-,$(objects))
uninstall-objects=$(addprefix uninstall-,$(objects))
check-objects=$(addprefix check-,$(objects))
install-modules=$(addprefix install-,$(modules))
uninstall-modules=$(addprefix uninstall-,$(modules))
check-modules=$(addprefix check-,$(modules))
.PHONY: install uninstall check uninstall $(modules)
all: $(modules) $(objects)
install: $(install-modules) $(install-objects)
check: $(check-modules) $(check-objects)
uninstall: $(uninstall-modules) $(uninstall-objects)
$(filter %.elc,$(objects)): %.elc: %.el
$(call compile,$^)
$(modules): %:
@$(MAKE) -C $*
$(install-objects): install-%: %
$(if $(call newer,$*),install -pDm 644 "$*" "$(DESTDIR)/$*")
$(install-modules): install-%:
@$(MAKE) -C $* install
$(uninstall-objects): uninstall-%:
$(if $(call newer,$*),rm -f "$(DESTDIR)/$*")
$(uninstall-modules): uninstall-%:
@$(MAKE) -C $* uninstall
$(check-objects): check-%:
@$(if $(call newer,$*), \
echo -e "$(FG_YEL)$* $(FG_GRE)newer$(CLR_RE)!", \
echo -e "$(FG_YEL)$* $(FG_RED)not newer$(CLR_RE).")
$(check-modules): check-%:
@$(MAKE) -C $* check

5
.emacs.d/eshell/Makefile Normal file
View file

@ -0,0 +1,5 @@
DESTDIR=$(HOME)/.emacs.d/eshell
objects=alias
modules=
include ../emacs.mk

View file

@ -0,0 +1,7 @@
DESTDIR=$(HOME)/.emacs.d/eshell
objects=dzen.elc dzen.el eltuki.elc eltuki.el ext.elc ext.el \
metalexpress.elc metalexpress.el mu4e-init.elc mu4e-init.el \
newsticker-init.elc newsticker-init.el oni.elc oni.el org-init.elc \
org-init.el quick-edit-mode.elc quick-edit-mode.el
include ../emacs.mk

View file

@ -0,0 +1,4 @@
DESTDIR=$(HOME)/.emacs.d/snippets
modules=html-mode org-mode
include ../emacs.mk

View file

@ -0,0 +1,4 @@
DESTDIR=$(HOME)/.emacs.d/snippets/html-mode
objects=for generic-block
include ../../emacs.mk

View file

@ -0,0 +1,4 @@
DESTDIR=$(HOME)/.emacs.d/snippets/org-mode
objects=codeblock heading
include ../../emacs.mk